This title has a more general scope: it is about using Sho-based applications in a distributed environment.

What's the problem here?

Well, if you have to push a computation to hundreds of virtual machines, you cannot afford installing TSF or Sho pre-requisite, for that matter, on all these machines. So you need to be able to develop the app on one or more developer machine(s) then push the app to the nodes of your distributed environment and have it just work on each node.

So, what's the solution?

Turns out that it suffices to append a relatively small piece of Sho to the working folder of your application and it would just work.

Here is the recipe:

1) Let us say you have built your application in the target working folder WF.

2) Go to the Sho installation folder (likely in Program Files(x86) ) on one of the development machines and copy the following objects to WF: MathFunc.dll, MatrixInterf.dll, Rand.dll , ShoArray.dll  and   bin64 , bin32   folders with everything in them (the resulting bin* folders must be subfolders of the WF).

3) Done. It will just work when you copy WF over to a remove (virtual) machine and run your app inside it.

Here is an example, based on the TSF.NET sample project "Sample_CalendarEvents":

1) The build target folder after building the project was like this:

09/30/2011  05:51 PM            25,088 ConstrainedShoOptimizers.dll
09/30/2011  05:51 PM            69,120 ConstrainedShoOptimizers.pdb
09/30/2011  05:51 PM            15,360 CurvePatterns.dll
09/30/2011  05:51 PM            38,400 CurvePatterns.pdb
09/09/2011  10:13 AM         2,598,776 Microsoft.Solver.Foundation.dll
01/05/2012  02:17 PM            11,776 Sample_CalendarEvents.exe
09/20/2011  07:43 AM               144 Sample_CalendarEvents.exe.config
01/05/2012  02:17 PM            26,112 Sample_CalendarEvents.pdb
03/26/2012  01:42 PM             2,560 Sample_CalendarEvents.suo
09/09/2011  10:13 AM            22,528 ShoOptimizer.dll
09/09/2011  10:13 AM            25,816 ShoOptimizer.xml
08/17/2011  04:25 PM           156,160 ShoViz.dll
08/17/2011  04:25 PM           101,202 ShoViz.xml
09/09/2011  10:13 AM           132,096 Stats.dll
09/09/2011  10:13 AM           209,381 Stats.xml
09/30/2011  05:51 PM            31,232 TimeSeriesExplorer.dll
09/30/2011  05:51 PM            97,792 TimeSeriesExplorer.pdb
09/30/2011  05:51 PM            43,008 TsChartsPlots.dll
09/30/2011  05:51 PM            54,784 TsChartsPlots.pdb
01/05/2012  11:09 AM           346,112 TsExponentialSmoothing.dll
01/05/2012  11:09 AM           968,192 TsExponentialSmoothing.pdb
10/02/2011  03:14 PM            74,752 TSSSMsupportedForecasters.dll
10/02/2011  03:14 PM           214,528 TSSSMsupportedForecasters.pdb
09/30/2011  05:51 PM            11,264 VectorClustering.dll

 

2) My Sho\Sho 2.0 for .NET 4\bin folder was like this:

03/26/2012  11:49 AM    <DIR>          bin32
03/26/2012  11:49 AM    <DIR>          bin64
01/04/2012  03:18 PM            24,576 DlmIO.dll
01/04/2012  03:18 PM            48,497 DlmIO.xml
01/04/2012  03:18 PM            13,824 EmbeddedSho.dll
01/04/2012  03:18 PM            30,208 EmbeddedSho.pdb
11/22/2011  05:57 PM            23,896 ipy.exe
11/22/2011  05:57 PM            23,896 ipy64.exe
11/22/2011  05:57 PM            23,384 ipyw.exe
11/22/2011  05:57 PM            23,384 ipyw64.exe
11/22/2011  05:57 PM         1,496,408 IronPython.dll
11/22/2011  05:57 PM           451,928 IronPython.Modules.dll
11/22/2011  05:57 PM            60,182 IronPython.Modules.xml
11/22/2011  05:57 PM           376,988 IronPython.xml
01/04/2012  03:18 PM            41,984 MathFunc.dll
01/04/2012  03:18 PM           133,692 MathFunc.Xml
01/04/2012  03:17 PM            41,984 MatrixInterf.dll
01/04/2012  03:17 PM            52,229 MatrixInterf.Xml
11/22/2011  05:57 PM           952,152 Microsoft.Dynamic.dll
11/22/2011  05:57 PM            58,712 Microsoft.Scripting.Debugging.dll
11/22/2011  05:57 PM           166,744 Microsoft.Scripting.dll
01/04/2012  03:18 PM            70,656 PythonExt.dll
01/04/2012  03:18 PM             7,680 Rand.dll
01/04/2012  03:18 PM             4,405 Rand.Xml
11/22/2011  05:57 PM               255 sho.bat
11/22/2011  05:57 PM               255 sho64.bat
01/04/2012  03:18 PM           214,528 ShoArray.dll

....etc....

 

3) After copying things into the folder it became like this:

03/26/2012  02:05 PM    <DIR>          bin32
03/26/2012  01:49 PM    <DIR>          bin64
09/30/2011  05:51 PM            25,088 ConstrainedShoOptimizers.dll
09/30/2011  05:51 PM            69,120 ConstrainedShoOptimizers.pdb
09/30/2011  05:51 PM            15,360 CurvePatterns.dll
09/30/2011  05:51 PM            38,400 CurvePatterns.pdb
01/04/2012  03:18 PM            41,984 MathFunc.dll
01/04/2012  03:17 PM            41,984 MatrixInterf.dll
09/09/2011  10:13 AM         2,598,776 Microsoft.Solver.Foundation.dll
01/04/2012  03:18 PM             7,680 Rand.dll
01/05/2012  02:17 PM            11,776 Sample_CalendarEvents.exe
09/20/2011  07:43 AM               144 Sample_CalendarEvents.exe.config
01/05/2012  02:17 PM            26,112 Sample_CalendarEvents.pdb
03/26/2012  01:42 PM             2,560 Sample_CalendarEvents.suo
01/04/2012  03:18 PM           214,528 ShoArray.dll
09/09/2011  10:13 AM            22,528 ShoOptimizer.dll
09/09/2011  10:13 AM            25,816 ShoOptimizer.xml
08/17/2011  04:25 PM           156,160 ShoViz.dll
08/17/2011  04:25 PM           101,202 ShoViz.xml
09/09/2011  10:13 AM           132,096 Stats.dll
09/09/2011  10:13 AM           209,381 Stats.xml
09/30/2011  05:51 PM            31,232 TimeSeriesExplorer.dll
09/30/2011  05:51 PM            97,792 TimeSeriesExplorer.pdb
09/30/2011  05:51 PM            43,008 TsChartsPlots.dll
09/30/2011  05:51 PM            54,784 TsChartsPlots.pdb
01/05/2012  11:09 AM           346,112 TsExponentialSmoothing.dll
01/05/2012  11:09 AM           968,192 TsExponentialSmoothing.pdb
10/02/2011  03:14 PM            74,752 TSSSMsupportedForecasters.dll
10/02/2011  03:14 PM           214,528 TSSSMsupportedForecasters.pdb
09/30/2011  05:51 PM            11,264 VectorClustering.dll

 

In the next blog post on this topic we will discuss setting up a Visual Studio project where the copying of the above 6 objects happens during the build process.

Have fun.

Alex--