Prev: ssGetInputPortWidth
Next: Problems with Regress
From: Vesal on 11 Jan 2010 15:17 I am currently investigating methods of using MATLAB functions within the .NET platform. From my research, it would seem that all compilations of MATLAB code require MCR to run on the user's machine. This solution is not scalable for my purposes. Is there any method to use MATLAB code from .NET without the need for MCR? For example, can a .NET DLL be built that contains all necessary code so that MCR is not required? Or can MATLAB code be converted directly to another programming language? Any and all advice and suggestions are welcome. Thank you.
From: Titus Edelhofer on 12 Jan 2010 07:44 "Vesal " <vesal(a)yahoo.com> schrieb im Newsbeitrag news:hig0vv$kl2$1(a)fred.mathworks.com... >I am currently investigating methods of using MATLAB functions within the >.NET platform. From my research, it would seem that all compilations of >MATLAB code require MCR to run on the user's machine. This solution is not >scalable for my purposes. > Is there any method to use MATLAB code from .NET without the need for MCR? > For example, can a .NET DLL be built that contains all necessary code so > that MCR is not required? Or can MATLAB code be converted directly to > another programming language? > Any and all advice and suggestions are welcome. > Thank you. > Hi, yes and no: compiled MATLAB code always requires the MCR, since the compiled code depends on the run-time libraries contained in the MCR (just like you need the Microsoft .NET Framework on every machine you want to run .NET code). What makes me curious is the "this solution is not scalable", what do you mean by this? If installing the MCR is not an option one could think of setting up a web service that the user can connect to ... Titus
From: Vesal on 12 Jan 2010 11:10 Thanks for your reply. The processes that use MATLAB are server-based for a web application. However, MCR is a single threaded application, therefore our web sessions do not scale across our server’s processors. The MCR will queue all calls and process them one at a time. To work around this limitation we have moved our MATLAB code into separate processes. If the deployment server has 8 cores we will install 8 instances of these special MATLAB services. After each service has spun up, the MCR eats up 200-250mb per service after loading the MCR. 8 instances will require up to 1.5G of ram, 16 instances require 3G! Our website then dispatches all incoming requests in a round robin fashion across the 8 services. This solution allows us to increase the scalability (concurrency) however at a cost to performance as we incur latency in managing and calling the external services (processes). This is described more fully in MATLAB's help on scalability (from which the poor-performance solution above was provided): "Many session scaling issues arise because the MCR is single threaded. A single-threaded application prevents two users from doing work that involves the MCR at the same time. One user must wait for the other to finish before continuing. This wait can prove to be substantial if one user is performing a resource-intensive task while the other is attempting a quick calculation." (http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/example_guide/br9zbie-1.html#br9zvr3). For this reason, I am searching for a solution that does not require MCR. Any alternative workarounds would be very helpful. Thanks again.
From: Stephen Lienhard on 12 Jan 2010 11:33 "Vesal " <vesal(a)yahoo.com> wrote in message <hii6te$110$1(a)fred.mathworks.com>... > Thanks for your reply. > > <SNIP> After each service has spun up, the MCR eats up 200-250mb per service after loading the MCR. 8 instances will require up to 1.5G of ram, 16 instances require 3G! Our website then dispatches all incoming requests in a round robin fashion across the 8 services. This solution allows us to increase the scalability (concurrency) however at a cost to performance as we incur latency in managing and calling the external services (processes). <SNIP> We have a similar set up. But each MCR instance takes about 40meg. (not including calcs)
From: Vesal on 12 Jan 2010 11:53
> We have a similar set up. But each MCR instance takes about 40meg. (not including calcs) The initial memory is about 40MB for us too. However, once a function call is made, it increases to about 200-250MB (due to the loading of MATLAB toolbox functions). |