Bug #6481
openstrange issue with MultipleTabDisplay actor and with Display like actors in general (missing output port in non-gui mode)
0%
Description
Hi there,
I will paste here description that already went to Jianwu via e-mail, but I think it describes the issue in details:
Some time ago we have published our patches to MultipleTabDisplay actor so it is consistent with new way of redirecting output.
The issue here is, that we have problem with running Kepler workflows in non-gui mode.
The issue lays in missing "output" port inside Multiple Tab Display actor.
The problem is that in GUI mode, everything works just fine (see the screen shoot).
In non-gui mode, we are getting an exception (see the attachment - exception.txt).
Command line used for starting workflow is:
./kepler.sh -runwf -nogui -nocache ~/Desktop/testMTD.xml
Problematic workflow was reduced, and now, we have smallest case that triggers exception.
The workflow is inside: testMTD.xml.
The problem occurs in case Multiple Tab Display actor is inside Composite actor. If the MTD is placed on main workflow, everything is just fine.
If we start testMTD workflow in GUI mode - everything is OK.
If we start it following way:
./kepler.sh -runwf -nogui -nocache testMTD.xml
We are getting exception.
I have done some initial debugging, and it looks like issue lies in reading output port from the actor. It is not reported in the code.
Entity.java class has method: getPort. In this method, if I take a look at the code, I can see that variable "_portList" doesn't contain "output" port.
This is what I can see while running Kepler in Eclipse (non-gui mode of Kepler)
[
ptolemy.actor.TypedIOPort
{.testMTD.CompositeActor.MultipleTabDisplay.input},
ptolemy.actor.TypedIOPort
{.testMTD.CompositeActor.MultipleTabDisplay.trigger}
]
This is the code, that should return "output" port.
public Port getPort(String name) {
try {
_workspace.getReadAccess();
return (Port) _portList.get(name);
} finally {
_workspace.doneReading();
}
}
"_portList" doesn't contain output port, even though, this port is visible in GUI mode, and - in fact - works fine (take a look at screen shot).
The question here is. Where should we look for the bug? Do you have any suggestions?
Files
Updated by Christopher Brooks over 10 years ago
The MultipleTabDisplay actor is not a part of the Ptolemy core, so I don't have much to add.
I suggest looking at how Kepler handles running graphical actors in a non-graphical context. The way that Ptolemy would do this is that we would use a filter in ptolemy.moml.filter to remove the graphical actors. I'm not sure how Kepler does it.
Updated by jianwu jianwu over 10 years ago
I think the reason is the workflow's composite actor has an output port that connects the output port of MultipleTabDisplay actor. I tested another workflow like your one but the output port of MultipleTabDisplay actor is not connected. It works for me.
When you run with '-nogui' option, Kepler/Ptolemy will replace the original actor class with a class without display (should be 'ptolemy.actor.lib.Discard' in most cases). That's why the output port is gone. Because most display related actors do not have output port, so this approach works for them.
Updated by Owsiak Michal over 10 years ago
- File Sleep_no_display.kar Sleep_no_display.kar added
- File Sleep_display.kar Sleep_display.kar added
In principal, I agree. Display actors typically don't need to produce any output.
However, this might be a "synchronization issue".
Our workflows are quite complex and we have numerous conditions that determine when workflow stops. Before it stops, we have to be sure that all outputs were correctly produced - so we can check whether everything is OK. And this might be an issue when there is no output port in display like actor - e.g. "Display" actor.
Let me show a simple case (attached file: Sleep_no_display.kar)
If you execute this workflow, it will stop before output is produced. This is not good as we don't know what was the condition before workflow stopped.
In case of the Multiple Tab Display actor, we can avoid this issue as we can "synchronize" the execution. Take a look here: Sleep_display.kar
In second case, we can enforce that Multiple Tab Display actor is executed before we proceed to Stop actor.
That's why we have decided to introduce "output" port into MTD actor. Now, with Kepler 2.4, we have issue with our workflows as they don't run correctly in non-gui mode.
I hope it is now more clear what is the purpose of the output port in the MTD.
Updated by jianwu jianwu over 10 years ago
A workaround is to use 'redirectgui' option, since no actor class replacement is involved in it. I tried a workflow with the output port of MTD connected and it finished with no exception.
Updated by Owsiak Michal over 10 years ago
Hello Jianwu,
it worked for me.
Thanks!
I will do additional testing with this flag and check whether it works fine with our workflows
Cheers