[kepler-dev] Different runModelInThread() Result Between Windows and Linux
ZhangJie
zhangjiewanwansui at gmail.com
Thu Dec 4 16:46:06 PST 2014
Hi All,
I use the code of org/kepler/ExecutionEngine.java to run my Xml Kepler
Workflows. I executed lots of Workflows use the function of
runModelInThread() . I can get correct result in every thread of executions
when I run on windows machine. However I only get single correct result to
do this on Linux machine. In fact it couldn't run other workflow Threads. I
add sleep() between these parallel threads, I can get all the correct
executions again! Why? How can I run lots workflows without any wait? Is
there any advise from any one. More details about the runtime codes and
result are as follows:
Any help will be grately appriciated.
with regards,
Jie Zhang
import org.kepler.ExecutionEngine;
import ptolemy.actor.CompositeActor;
import Workflow.Kepler.KeplerL2OrderWorkFlowGenerator;
public class test extends Thread {
public String Id ;
private ExecutionEngine engine;
public test(String Id) {
this.Id=Id;
}
public void run() {
// 1.Generate Moml Kepler Workflow by my class
KeplerL2OrderWorkFlowGenerator kL2WFG = new
KeplerL2OrderWorkFlowGenerator(
this.Id);
String Moml=kL2WFG.KeplerWorkflow();
//2.Run Moml by Kepler ExecutionEngine
System.out.println("Begin to execute!")
engine = ExecutionEngine.getInstance();
try {
engine.runModel((CompositeActor)
ExecutionEngine.parseMoML(Moml));
} catch (Exception e) {
System.out.println("Error running model or
finding output file: "
+ e.getMessage());
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int i = 0; i < 50; i++) {
test tempTest=new test("WorkFlow"+i);
tempTest.start();
//In Linux Mmachine,I have to add sleep()
//Thread.sleep(15000);
}
}
}
Result in Windows
Begin to execute!
Running model in new thread: L2CP201412040015KeplerWF
Running model in new thread: L2CP201412040004KeplerWF
Running model in new thread: L2CP201412040013KeplerWF
Running model in new thread: L2CP201412040012KeplerWF
Running model in new thread: L2CP201412040008KeplerWF
Running model in new thread: L2CP201412040001KeplerWF
Running model in new thread: L2CP201412040017KeplerWF
Running model in new thread: L2CP201412040007KeplerWF
Running model in new thread: L2CP201412040011KeplerWF
Running model in new thread: L2CP201412040003KeplerWF
Running model in new thread: L2CP201412040005KeplerWF
Running model in new thread: L2CP201412040002KeplerWF
Running model in new thread: L2CP201412040018KeplerWF
. . . .
Running model in new thread: L2CP201412040014KeplerWF
21737 ms. Memory: 418304K Free: 295512K (71%)
Execution finished successfully.
. . . .
23436 ms. Memory: 418304K Free: 294916K (71%)
Execution finished successfully.
Result in Linux without wait, only have one result
Begin to execute!
Running model in new thread: L2CP201412040014KeplerWF
21737 ms. Memory: 418304K Free: 295512K (71%)
Execution finished successfully.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20141205/8bd268f3/attachment.html>
More information about the Kepler-dev
mailing list