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

Edward A. Lee eal at eecs.berkeley.edu
Fri Sep 11 08:19:50 PDT 2009


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!
>>>>
>>>
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eal.vcf
Type: text/x-vcard
Size: 351 bytes
Desc: not available
URL: <http://mercury.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20090911/4d003138/attachment.vcf>


More information about the Kepler-dev mailing list