08.06.2015 Views

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

SHOW MORE
SHOW LESS

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

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

Big(ger) Data<br />

We can use the same jugfile.py system as before, except that now, instead of<br />

running it directly on the master, we schedule it on the cluster. First, write a very<br />

simple wrapper script:<br />

#!/usr/bin/env bash<br />

jug execute jugfile.py<br />

Call it using run-jugfile.sh and use chmod +x run-jugfile.sh to give it an<br />

executable permission:<br />

For c in 'seq 16'; do qsub run-jugfile.sh; done<br />

This will create 16 jobs, each of which will run the run-jugfile.sh script, which<br />

will simply call jug. You can still use the master as you wish. In particular, you can at<br />

any moment run jug status and see the status of the computation. In fact, jug was<br />

developed in exactly such an environment, so it works very well in it.<br />

Eventually, the computation will be finished and we can kill off all the nodes. Be sure<br />

to save the desired results somewhere and run the following:<br />

starcluster terminate mycluster<br />

Note that terminating will really destroy the filesystem and all your results. Of<br />

course, it is possible to change this default. You can have the cluster write to a<br />

filesystem which is not allocated and destroyed by starcluster but is available to you<br />

on a regular instance; in fact the flexibility of these tools is immense. However, these<br />

advanced manipulations could not all fit in this chapter.<br />

Starcluster has excellent documentation online at http://star.mit.edu/cluster/,<br />

which you should read for more information about all the possibilities of this tool.<br />

We have seen only a small fraction of the functionality and used only the default<br />

settings here.<br />

[ 258 ]

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

Saved successfully!

Ooh no, something went wrong!