[Swift-user] Specifying execution dependencies directly
Mihael Hategan
hategan at mcs.anl.gov
Sat Feb 6 12:48:41 CST 2010
On Sat, 2010-02-06 at 13:03 -0500, Andriy Fedorov wrote:
> Hi,
>
> I have the following (what seems to me, typical) analysis scenario. I
> am running multiple instances of task A, task B needs to wait until
> all of the instances of A are completed, and analyze the outputs
> produced by As.
>
> If I was running this locally, I would pass the name of the directory
> with the results to B. However, in Swift, I need to somehow define
> that B cannot start until all of the As complete. Since B would expect
> a directory name, or an arbitrarily long list of files, I am not sure
> how this can be done. Should I develop the workflow as a shell script
> that would run swift script with As, then run B locally, then proceed
> with the rest of the computation?
You are right, this is a typical map/reduce problem.
Use an array that holds the results of all the As and pass that to B.
file aout[];
foreach v, k in someRangeOrSomething {
aout[k] = a(v);
}
file bout;
bout = b(aout);
More information about the Swift-user
mailing list