[kepler-dev] Stop a workflow from Command Line

Christopher Brooks cxh at eecs.berkeley.edu
Mon Mar 29 13:40:52 PDT 2010


Hi Subhav,
Are you talking about the PN model of computation?
If so, then take a look at:
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest/ptII/doc/codeDoc/ptolemy/domains/pn/kernel/PNDirector.html
--start--
There are at least three ways for a PN model to terminate itself:

    1. Have the model starve itself. Typically, a boolean switch is used.
       See the PN OrderedMerge demo at ptolemy/domains/pn/demo/OrderedMerge/OrderedMerge.xml
    2. Have the model call the Stop actor. See the PN RemoveNilTokens demo at
       ptolemy/domains/pn/demo/RemoveNilTokens/RemoveNilTokens.xmll
    3. Set the firingCountLimit (LimitedFiringSource._firingCountLimit) actor parameter
       to the number of iterations desired. Actors such as Ramp extend LimitedFiringSource
       and have the firingCountLimit parameter.
--end--

Unfortunately, the Kepler-2.0 documentation for the PN director has not been updated to
reflect recent changes in the class documentation for PNDirector.java.  I think this
is because directors-2.0/resources/kar/CoreDirectors/PNDirector.xml has not been updated.
Thus, right clicking on the PNDirector and choosing Documentation->Display does not
include the above.  I'll submit a bug.

There is no particular command line interface to stop a model.  In theory, an actor could
be written that would watch for signals and if the appropriate signal was sent, then
it would fire.  This actor could then be connected to a Stop actor.  However, I'm not
so sure signal handling in Java is well documented or portable.

The way this would work in Unix is to run the model in the background and then
use "kill -1 %1" where -1 means that SIGHUP is passed to the Kepler process.


Note that vergil includes a -runThenExit command line argument, see
ptolemy/actor/gui/ConfigurationApplication.java
For this to work, the application has to terminate though.

I'm not sure if Kepler exposes that command line argument.  See
https://kepler-project.org/developers/reference/executing-kepler-from-the-command-line

_Christopher

On 3/28/10 11:59 PM, subhav mital wrote:
> Hello,
>
> Just wondering if there is any way to stop a workflow after execution is
> complete. While running some actors, even after the workflow has
> completed, the play button seems on and one has to manually hit the stop
> button.
>
> Is there any command line statement to start and stop a workflow without
> having to manually do this ?
>
> Thanks.
>
>
>
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev

-- 
Christopher Brooks, PMP                       University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841 fax:510.642.2718	      (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 cell: 707.332.0670


More information about the Kepler-dev mailing list