[kepler-dev] how to enable 'listen to actor' without GUI?

Christopher Brooks cxh at eecs.berkeley.edu
Fri Sep 11 08:41:50 PDT 2009


Yep, I thought about adding an Attribute, but I was not
sure how I would optionally add the Attribute at runtime.
One possibility would be to have a top level parameter
that would enable the Attribute.  Then, the command
line could set that parameter as necessary.

I'm not clear on the use case here, would one want to listen
to all actors at runtime?  Or be able to specify different
actors to which to listen?

The advantage of using scripting here is that it is fairly
easy to generate a small script that does what every pre-configuration
is necessary on the model.

_Christopher

Christopher wrote:
> Hi Jianwu,
> You could just search for the code that invokes listen to actor,
> but the problem is that invoking the method requires determining
> the actor to which to listen.
> 
> I agree that my solution is more complex, but adding more and
> more command line options is not very scalable after a certain
> point.
> 
> _Christopher
> 
> 
> Jianwu Wang wrote:
>> Hi Christopher,
>>
>>    Thanks a lot for you help. The solution is more complex than I expected. I'll try to work it around.


Edward A. Lee wrote:
> 
> A better approach than a command-line option would be
> an Attribute that you can add to a model instructing it
> to listen to an actor. The actor name could be a parameter
> of the attribute. Or alternatively, the Attribute could be
> inserted in the actor that it listens to (in the UI, you
> would then just drag the attribute and drop it on the actor,
> but in this case I'm not sure how we would remove it).
> 
> The output file could also be a parameter
> (perhaps defaulting to stdout).  This would make it scalable,
> so you could add several such attributes and listed to several
> actors without their outputs becoming intertwined (they can be
> written to several files).
> 
> Then Jianwu would just need to add this attribute to his model.
> 
> This would be easy to implement...
> 
> Edward
> 
> 
> Christopher Brooks wrote:
>> Hi Jianwu,
>> You could just search for the code that invokes listen to actor,
>> but the problem is that invoking the method requires determining
>> the actor to which to listen.
>>
>> I agree that my solution is more complex, but adding more and
>> more command line options is not very scalable after a certain
>> point.
>>
>> _Christopher
>>
>>
>> Jianwu Wang wrote:
>>> Hi Christopher,
>>>
>>>    Thanks a lot for you help. The solution is more complex than I 
>>> expected. I'll try to work it around.
>>>
>>> Best wishes
>>>
>>> Sincerely yours
>>>
>>> Jianwu Wang
>>> jianwu at sdsc.edu
>>> http://users.sdsc.edu/~jianwu/
>>>
>>> Scientific Workflow Automation Technologies (SWAT) Laboratory
>>> San Diego Supercomputer Center University of California, San Diego
>>> San Diego, CA, U.S.A.
>>>
>>>
>>> Christopher Brooks wrote:
>>>> Hi Jianwu,
>>>> How I track these down is to search the ptII repository for the
>>>> menu string that corresponds with the functionality in which you
>>>> are interested.
>>>>
>>>> To my knowledge, we don't currently support enabling 'listen to
>>>> actor' from the command line.
>>>>
>>>> Instead of adding yet another command line argument, it might be worth
>>>> worth using Jacl to invoke Java commands.
>>>>
>>>> $PTII/bin/ptjacl foo.tcl workflow.xml
>>>> would invoke foo.tcl which could then read in workflow.xml, set up
>>>> any listeners and then run the model.
>>>>
>>>> For example, if foo.tcl contains:
>>>>
>>>>   java::new ptolemy.moml.MoMLSimpleApplication $argv
>>>>
>>>> Then
>>>>  $PTII/bin/ptjacl foo.tcl $PTII/ptolemy/actor/lib/test/auto/Ramp1.xml
>>>> will invoke the model.
>>>>
>>>> It is not that difficult to take control of execution, if foo.tcl 
>>>> contained
>>>>
>>>>
>>>> set parser [java::new ptolemy.moml.MoMLParser]
>>>> set toplevel [java::cast ptolemy.actor.TypedCompositeActor [$parser 
>>>> parseFile $argv]]
>>>> set manager [java::new ptolemy.actor.Manager \
>>>>             [$toplevel workspace] "manager"]
>>>> $toplevel setManager $manager
>>>> $manager execute
>>>>
>>>> then the model is parsed, a manager created and executed.
>>>>
>>>> _Christopher
>>>>
>>>> Jianwu Wang wrote:
>>>>> Hi there,
>>>>>
>>>>>    With Kepler GUI, we can use right-click item 'listen to actor' 
>>>>> to get the execution debug info of this actor. Now I have to run a 
>>>>> workflow in batch mode, e.g. kepler.sh -runwf -nogui -nocache 
>>>>> workflow.xml. Do we support the same function like 'listen to 
>>>>> actor' when executing workflow in batch mode? Do I need change some 
>>>>> configuration item of Kepler/Ptolemy configuration files to enable 
>>>>> that? Thanks a lot!
>>>>>
>>>>
>>

-- 
Christopher Brooks (cxh at eecs berkeley edu) 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 (W-F) 510.655.5480


More information about the Kepler-dev mailing list