10.06.2016 Views

eldo_user

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Eldo Control Language<br />

Parallel Operation<br />

.define_task t_step_para<br />

set i = 0<br />

para_step (type=step,<br />

+ param=i,<br />

+ start=100k,<br />

+ stop=10k,<br />

+ step=-10k)<br />

set j = ijob()<br />

fprint(stdout,<br />

+ "Beginning run %d with i=%.2g.\n",<br />

+ j,<br />

+ i)<br />

system("sleep 10")<br />

if (j == 5)<br />

fprint(stdout, "Break on run 5!\n")<br />

break<br />

endif<br />

fprint(stdout,<br />

+ "End of run %d.\n",<br />

+ j)<br />

end_para_step<br />

.end_define_task<br />

.t_step_para<br />

The output of this example may be:<br />

Beginning run 1 with i=1e+05.<br />

Beginning run 3 with i=8e+04.<br />

Beginning run 2 with i=9e+04.<br />

Beginning run 4 with i=7e+04.<br />

End of run 2.<br />

End of run 1.<br />

Beginning run 6 with i=5e+04.<br />

Beginning run 5 with i=6e+04.<br />

End of run 3.<br />

End of run 4.<br />

Beginning run 7 with i=4e+04.<br />

Break on run 5!<br />

End of run 6.<br />

End of run 7.<br />

Multiple Levels of Parallelism<br />

It is possible to have nested loops executed in parallel.<br />

Example: use of a matrix to store extract results of nested loops:<br />

Eldo® User's Manual, 15.3 1051

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!