[Swift-user] Running Python scripts on Swift

Matt Lee mrlee at uchicago.edu
Mon May 21 08:33:12 CDT 2012


Hello,

I have a few python scripts that chain input/output, and I was wondering
what the best way to call these scripts?

Thus far, I've tried placing them into a shell script, but I'm not sure how
to make the shell scripts take arguments.  How would one do this?
Here's what I have:

type shellfile;
type pythonfile;
type inputfile;

app (reducefile sout) runmapreduce(shellfile shellscript, inputfile f,
pythonfile map, pythonfile combine, pythonfile reduce){
      shell "source" @shellscript @f @map @combine @reduce
stdout=@filename(sout);
}
shellfile mapreduce_shell_script<single_file_mapper;file="mapreduce.sh">;
pythonfile map_fun<single_file_mapper;file="mapcount.py">;
pythonfile combine_fun<single_file_mapper;file="combinecount.py">;
pythonfile reduce_fun<single_file_mapper;file="reducecount.py">;

The shell script doesn't take the arguments, which leads me to believe I
have specified them incorrectly.  Would it be better to make the python
files themselves executable, and simply chain their operation within a
swift app function?

I also was wondering if there was a way within swift to specify the node
upon which a specific job was run?  More specifically, I'd like to run a
job on the master node that aggregates the results of the computations on
the worker nodes.  Would such a thing be possible in swift, or would I need
to configure coasters to accommodate this?

Thanks,

Matt Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-user/attachments/20120521/70ecad0c/attachment.html>


More information about the Swift-user mailing list