[Swift-devel] A new use case for the persistent swift server
wilde at mcs.anl.gov
wilde at mcs.anl.gov
Sun Sep 5 10:44:11 CDT 2010
Mihael, as the Swift R interface progresses I realize we have another use case to consider for the persistent Wwift service:
- run the same script repeatedly, from different directories (perhaps with different arguments)
- since the script doesn't change, we can run a pre-compiled version: no need to regenerate the myscript.xml and myscript.kml files.
Can this be readily handled by the code you have underway to do multiple script executions from a single Swift invocation?
For the R code, the script (for now) is always the same simple foreach loop that executes an R list apply() function in parallel:
swiftapply.swift:
type file;
type RFile;
app (RFile result, file stout, file sterr) RunR (RFile rcall)
{
RunR @rcall @result stdout=@stout stderr=@sterr;
}
RFile rcalls[] <simple_mapper; prefix="cbatch.", suffix=".Rdata", padding=0>;
RFile results[] <simple_mapper; prefix="rbatch.", suffix=".Rdata", padding=0>;
file stout[] <simple_mapper; prefix="stdout.", suffix=".txt", padding=0>;
file sterr[] <simple_mapper; prefix="stderr.", suffix=".txt", padding=0>;
foreach c, i in rcalls {
(results[i],stout[i], sterr[i]) = RunR(c);
}
- Mike
More information about the Swift-devel
mailing list