[EMAIL PROTECTED] (Paul A Crosby) writes:

> I've been building a DE simulation of job assignment in a PC cluster using
> Ptolemy II under RedHat 7.2. I've put it together in Vergil using my own
> Actors, and it seems to be working the way I want it to. However I'd like
> to run it about 1000 times, and I don't want to do this by hand each time. 
> 
> There doesn't seem to be an "iterations" option like the the SDF domain
> has for DE. Is there anything simple I can do here, or will I have to work
> out how to use Ptjacl? I'm still quite naive about all of this, so
> apologies if I'm missing something obvious. 
> 
> I'd be grateful for any suggestions here.
> 
> Thanks,
> 
> Paul Crosby


I might be missing the point here, but DE is a timed domain, so
a simulation runs for a particular amount of time.  The DE Director
a start time and a stop time, which can be synchronized to real time.

The design doc at
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII1.0/ptII1.0/doc/design/design.pdf 
has the details.

Now, if what you are tring to do is repeat the same simulation 1000
times, then that is a slightly different.  Say your DE demo
has a start time of 0.0 and a stop time of 100.0 and is not
synchronized to real time.  The DE Inspection demo is like this.

I have some notes about how create a class called
MoMLSimpleApplication that will read in a .xml file and run it.
The notes are at
http://ptolemy.eecs.berkeley.edu/~cxh/ptpub/filter.htm

You could probably adapt that class so that you could run
it from a command line.  If your shell has the 'repeat'
built-in, then you could do something like:

repeat 2 $PTII/bin/ptinvoke ptolemy.actor.gui.MoMLSimpleApplication 
ptolemy/domains/de/test/auto/multirate.xml

Or, you could hack up a shell script.

Note that if the demo is graphical, then MoMLSimpleApplication might
not automatically exit.  This is probably a bug.  One hack would be to 
try using the -test code that is in ptolemy.actor.gui.MoMLApplication 
that is supposed to kill the process after 2 seconds.  You could also
use a Timer.


To use ptjacl, check out the createAndExecute proc in
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII1.0/ptII1.0/util/testsuite/auto.tcl


cxh@cooley 144% cd $PTII
cxh@cooley 145% cat t.tcl
proc createAndExecute {file} {
    set parser [java::new ptolemy.moml.MoMLParser]
    set toplevel [java::cast ptolemy.actor.CompositeActor \
            [$parser parseFile $file]]
    set manager [java::new ptolemy.actor.Manager \
            [$toplevel workspace] "manager"]
    $toplevel setManager $manager
    # Success is just not throwing an exception.
    $manager execute
}



for {set i 0} {$i < 10} {incr i} {
    createAndExecute ptolemy/domains/de/test/auto/multirate.xml
}
cxh@cooley 146% $PTII/bin/ptjacl
"/vol/doppler/doppler2/tools/java/j2sdk1_3_1/bin/java" 
"-Dptolemy.ptII.dir=/home/eecs/cxh/ptII" -classpath 
"/home/eecs/cxh/ptII:/home/eecs/cxh/ptII/lib/ptjacl.jar:/home/eecs/cxh/ptII/lib/diva.jar:/home/eecs/cxh/ptII/vendors/sun/jini/jini1_0_1/lib/jini-jspaces.jar:/home/eecs/cxh/ptII/vendors/sun/jini/jini1_0_1/lib/mahalo-dl.jar:/home/eecs/cxh/ptII/vendors/sun/commapi/comm.jar:/home/eecs/cxh/ptII/lib/sootclasses.jar:/home/eecs/cxh/ptII/lib/jasminclasses.jar:/vol/doppler/doppler2/tools/java/j2sdk1_3_1/jre/lib/rt.jar:/home/eecs/cxh/ptII/lib/ptjacl.jar:/home/eecs/cxh/ptII/lib/sootclasses.jar:/home/eecs/cxh/ptII/lib/jasminclasses.jar:/vol/doppler/doppler2/tools/java/j2sdk1_3_1/jre/lib/rt.jar"
 tcl.lang.Shell
% 
% source t.tcl
254 ms. Memory: 3520K Free: 1708K (49%)
62 ms. Memory: 3520K Free: 1917K (54%)
136 ms. Memory: 3520K Free: 2162K (61%)
217 ms. Memory: 3520K Free: 701K (20%)
78 ms. Memory: 3520K Free: 1128K (32%)
45 ms. Memory: 3904K Free: 1703K (44%)
195 ms. Memory: 3904K Free: 242K (6%)
149 ms. Memory: 3520K Free: 1664K (47%)
63 ms. Memory: 3520K Free: 1854K (53%)
102 ms. Memory: 3520K Free: 2107K (60%)
% exit
cxh@cooley 147% 

There are some notes about ptjacl at
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII1.0/ptII1.0/doc/coding/testing.htm

-Christopher

Christopher Hylands    [EMAIL PROTECTED]  University of California
Ptolemy/Gigascale Silicon Research Center     US Mail: 558 Cory Hall #1770
ph: (510)643-9841 fax:(510)642-2739           Berkeley, CA 94720-1770
home: (510)526-4010                           (Office: 400A Cory)

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to