[kepler-dev] [Fwd: Re: [kepler-users] Running Kepler from the commandline]

Christopher Brooks cxh at eecs.berkeley.edu
Wed Apr 30 10:36:42 PDT 2008


Hi Niels,

MoMLApplication will take parameters from the command line.

ptII/ptolemy/actor/gui/MoMLApplication.java says:

--start--
 If a Ptolemy model is instantiated on the command line, either
 by giving a MoML file or a -class argument, then parameters of that
 model can be set on the command line.  The syntax is:
 <pre>
 $PTII/bin/ptolemy <i>modelFile.xml</i> -<i>parameterName</i> <i>value</i>
 </pre>
 where <i>parameterName</i> is the name of a parameter relative to
 the top level of a model or the director of a model.  For instance,
 if foo.xml defines a toplevel entity named <code>x</code> and
 <code>x</code> contains an entity named <code>y</code> and a
 parameter named <code>a</code>, and <code>y</code> contains a
 parameter named <code>b</code>, then:
 <pre>
 $PTII/bin/ptolemy foo.xml -a 5 -y.b 10
 </pre>
 would set the values of the two parameters.t
--end--

(Ignore the $PTII/bin/ptolemy script, it is not part of Kepler)

"kepler.bat -gui"  invokes org.kepler.loader.Kepler which
will invoke org.kepler.gui.KeplerApplication which invokes
ptolemy.vergil.VergilApplication which extends MoMLApplication

"kepler.bat -nogui" invokes ptolemy.actor.gui.PtExecuteApplication
which extends MoMLApplication

_Christopher

--------
    
    Hi Niels,
    
    I do not know if you can pass parameters at start-up, but there is a
       ptolemy.actor.parameters.ParameterSet    attribute
    That can read a text file at start-up and create parameters in the workflow
    from its content.=20
    
    You can put this attribute into the workflow through Tools/Instantiate
    Attribute
    
    The parameters defined in the text file should not be created as Parameters
    in the workflow as well, because the latter ones shadow the former ones.
    However, you can create in the ParameterSet=B9s dialog a parameter with a
    value, which becomes the default value if that parameter happens NOT to be
    defined in the text file.
    
    You can put the text file to the same place as the workflow and refer to it
    in ParameterSet without an absolute path (it does not look for it in the
    current dir but in the dir of the workflow).
    
    The text file format is the simplest: =B3parameter=3Dvalue=B2  lines,  # is
    allowed for comments
    You can use the defined parameters in the definition of other parameters;
    they are evaluated after all are read in.
    
    As far as I know, Dan is going to fix the start-up scripts so that you will
    be able to run workflows from command-line on any platform.
    I am using my own script on Linux for the same purpose and I can give it to
    you but that is not part of the repository (and is .sh only not .bat).
    
    Best regards
    Norbert
    
    
      Norbert Podhorszki
      ------------------------------------------
      Scientific Computing Group
      National Center for Computational Sciences
      Oak Ridge National Laboratory
      Phone: (865) 574-7159
    
    
    
    
    On 4/30/08 12:21 PM, "Matthew Jones" <jones at nceas.ucsb.edu> wrote:
    
    > Forwarding a request regarding the command line actor...
    >=20
    > Matt
    >=20
    > From: niels hoffmann <nielslcr at gmail.com>
    > Date: Wed, 30 Apr 2008 14:51:26 +1200
    > To: Matthew Jones <jones at nceas.ucsb.edu>
    > Subject: Re: [kepler-users] Running Kepler from the commandline
    >=20
    > Hi Matt,
    > =20
    > Forwarding would be very kind.
    > =20
    > Thank you,
    > Niels Hoffmann
    >=20
    > On Wed, Apr 30, 2008 at 9:52 AM, Matthew Jones <jones at nceas.ucsb.edu> wro
   =
    te:
    >> I'm not sure.  Could redirect your question to Danial Crawl (who's on bo
   =
    th
    >> kepler-dev and kepler-users mailing lists), as he wrote the new shell sc
   =
    ript
    >> and will definitely know whether you can pass parameters as you asked?
    >> Thanks,=20
    >>=20
    >>=20
    >> Matt
    >>=20
    >> niels hoffmann wrote:
    >>> Hi Matt,
    >>>  Thanks for your answer.
    >>> I downloaded the kepler20080428 nightly build and you are right the new
    >>> kepler.bat is much easier and clearer to work with.
    >>> I do have one other question though. Is it possible to pass in paramete
   =
    rs on
    >>> the commandline to a workflow?
    >>> Like: kepler.bat -runwf -nocache c:\temp\kepler_cmd_webservice.xml
    >>> <argument1> <argument2>
    >>> If so what would be the correct syntax?
    >>>  Kind regards,
    >>> Niels Hoffmann
    >>>   Hi Niels,
    >>>=20
    >>> Its probably a classpath problem that could be fixed by modifying the s
   =
    hell
    >>> script.  I'm not sure of the state of the script in the rc3 release.  W
   =
    e've
    >>> had a lot of trouble with this, so Dan Crawl has been working on refact
   =
    oring
    >>> the startup scripts for Kepler so that there is a single shell script t
   =
    hat
    >>> can launch with or without a GUI.  This is checked into the current
    >>> development version of Kepler, can be found in the nightly builds, and 
   =
    will
    >>> be released with Kepler 1.0.0 within the next few weeks.  I think you w
   =
    ill
    >>> find this new version of the scripts substantially more robust and easi
   =
    er to
    >>> work with.
    >>>=20
    >>> Matt
    >>>=20
    >>> niels hoffmann wrote:
    >>> =20
    >>>> Hi List,
    >>>>  We have a need to run Kepler without user interface. We basically wan
   =
    t to
    >>>> call a workflow from a portlet.
    >>>> I've read the doco on the website that says you need to replace
    >>>> org.kepler.gui.KeplerApplication with
    >>>> ptolemy.actor.gui.MoMLSimpleApplication in the batch file.
    >>>> However, if I do that I get a java.lang.NoClassDefFoundError.
    >>>> The other suggestion is to build using ant, but the build.xml doesn't 
   =
    seem
    >>>> to have a build_momlexecute target?
    >>>>  Is the documentation on the website not up to date with the 1.0 rc3
    >>>> version and do I actually need to do something different or is somethi
   =
    ng
    >>>> else the problem?
    >>>>  Kind regards,
    >>>> Niels Hoffmann
    >>>>=20


More information about the Kepler-dev mailing list