[kepler-dev] Running Matlab in Kepler

Christopher Brooks cxh at eecs.berkeley.edu
Mon Mar 3 19:43:07 PST 2008


Hi Madu,

The Kepler MatlabExpression actor appears to invoke Matlab as a
separate process each time the actor fires.
I can't be sure about this though, the code is difficult to read.
Can anyone comment on whether the Kepler actor invokes a separate
Matlab process each time it fires?

To get your demo to run I had to change each actor so that the
path to the matlab executable was set.  MatlabExpression should
probably be able to find the matlab executable itself or else
use a SharedParameter here so that all the instances of the
actor use the same value.

Your demo did not run for me because my Matlab license expired
on March 1.


The Ptolemy Matlab Expression actor uses JNI to connect to Matlab
and thus has somewhat tighter connectivity.  The downside
of the Ptolemy Matlab Expressino actor uses JNI, which requires separate
binaries for each platform and in general is not that reliable.
However, recent updates to the Matlab actor should increase
its reliability.

I was able to create an instance of the Matlab Expression actor
from within Kepler by doing Tools -> Instantiate Component
and then entering the classpath ptolemy.matlab.Expression

However, the Ptolemy matlab demo did not run  within Kepler:

ptolemy.kernel.util.IllegalActionException: There was a problem invoking 
the Ptolemy II Matlab interface.
The interface has been tested under Windows and Linux,
requires that Matlab be installed on the local machine.Refer to 
$PTII/ptolemy/matlab/makefile for moreinformation.
   in .MatlabExpression.MatlabExpression
Because:
Did not find 'ptolemy/matlab/ptmatlab' in path, searched user.home 
(c:\cxh\src\kepler) user.dir (C:\Documents and Settings\cxh) and the 
classpath for 'ptolemy/matlab/ptmatlab.dll', but that was not found either.
classpath was: 
c:\cxh\src\kepler\build\classes;c:\cxh\src\kepler\build\src;c:\cxh\src\kepler;c:\cxh\src\kepler\configs;c:\cxh\src\kepler\lib;c:\cxh\src\kepler\lib\images;c:\cxh\src\kepler\build\kepler-icons.jar;c:\cxh\ptII\lib\diva.jar;c:\cxh\ptII\build\ptolemy-doc.jar;c:\cxh\ptII\build\classes;c:\cxh\ptII\build\src 
Also tried loadLibrary("ptmatlab", exception for loadLibrary was: 
java.lang.UnsatisfiedLinkError: no ptmatlab in java.library.path
	at ptolemy.matlab.Expression.preinitialize(Expression.java:202)
	at ptolemy.actor.Director.preinitialize(Director.java:865)

So, the next step would be to get the Ptolemy Matlab Expression actor
to work in Kepler or to try the same experiment in Ptolemy.

I can't try it right now because my Matlab license has expired.

_Christopher


myerramothu at miners.utep.edu wrote:
> Hello Everyone,
>  
> Thank you Dr. Ludaescher for your reply. The problem that I posted in 
> Kepler users mailing list was my first question and I think the problem 
> was because I was running Matlab in Kepler using windows operating 
> system. I was able to run the Matlab in Kepler without any error using 
> Linux operating system.
>  
> My current problem is: I observed a significant slow down in the 
> execution of my Matlab functions when they are executed in Kepler. 
> The Matlab actor I am using is /Matlabexpression/. I am sending you 
> a workflow that calculates the kurtosis and skewness of a Gaussian 
> random sequence as an attachment to this email. The workflow that I am 
> sending was developed and executed by me in Linux operating system and 
> time taken to execute this workflow was approximately 2mins and 10secs. 
> However, the Matlab instructions used in this workflow can be executed 
> approximately in 1-2secs when typed directly in Matlab command line.
>  
> Your help will be very valuable for me to further use the Kepler.
>  
> Please check the attachment to this email.
>  
> Thank you very much for your time,
> Sincerely,
> Madhu.
> 
> 
> 
> 
>     ------------------------------------------------------------------------
>     CC: myerramothu at miners.utep.edu; daks-dev at googlegroups.com;
>     crawl at sdsc.edu; cxh at eecs.berkeley.edu; jones at nceas.ucsb.edu
>     From: altintas at sdsc.edu
>     Subject: Re: Running Matlab in Kepler
>     Date: Sun, 2 Mar 2008 21:49:12 -0800
>     To: ludaesch at ucdavis.edu
> 
>     Hi Madhu,
> 
>     Which Matlab actor are you using?  I couldn't find your post to
>     kepler-dev. Could you please forward that one as well?
> 
>     Thanks,
>     -ilkay
> 
>     On Mar 1, 2008, at 2:56 PM, Bertram Ludaescher wrote:
> 
>         Hi Madhu:
> 
>         I haven't used the Matlab actor directly, so not sure whether
>         the problem you describe is a known issue.
>         I'm cc-ing some people who might know.
> 
>         All (Ptolemy/Kepler people developers):
>         Have you witnessed the problem Madhu described?
>         I think we use the same Matlab actor in Kepler that is used in
>         Ptolemy, yes?
> 
>         Madhu:
>         You might also send a workflow snippet (e.g. MOML) that shows
>         the problem to kepler-dev.
> 
>         best
> 
>         BL
> 
> 
>         On Thu, Feb 28, 2008 at 5:20 PM, <myerramothu at miners.utep.edu
>         <mailto:myerramothu at miners.utep.edu>> wrote:
> 
>             Hello Dr. Ludaescher,
>              
>             Sorry to contact you directly.
>             I sent an e-mail to the the Kepler mailing list
>             about using Kepler with Matlab but I didn't get any reply.
>             I'm having the following problem:
>             t here is a significant slow down in the execution of my Matlab
>             functions when they are executed inside Kepler.
>             I would like to know if this is a characteristic of Kepler with
>             Matlab or if it could be a problem specific to my
>             implementation.
> 
>             Thank you for your attention,
>             Sincerely,
>             Madhu.
>              
>             Madhu Kishore Yerramothu
>             Graduate Teaching Assistant,
>             Department of Electrical and Computer Engineering,
>             University of Texas at El Paso
>             El Paso, TX 79968.
>             Phone: 915 217 4778
>             Email: myerramothu at miners.utep.edu
>             <mailto:myerramothu at miners.utep.edu>
> 
>              
>              
> 
> 
> 



More information about the Kepler-dev mailing list