Does each .sea file take the same amount of time?<br>How many .sea files are there in total?<br>How long for each .sea file?<br>What is the result? A new file?<br><br>Cheers,<br><br>Brian<br><br><div class="gmail_quote">On Sat, Oct 17, 2009 at 9:17 PM, Gökhan Sever <span dir="ltr"><<a href="mailto:gokhansever@gmail.com">gokhansever@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br><div class="gmail_quote"><div class="im">On Sat, Oct 17, 2009 at 10:58 PM, Brian Granger <span dir="ltr"><<a href="http://ellisonbg.net" target="_blank">ellisonbg.net</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div class="gmail_quote"><div>On Sat, Oct 17, 2009 at 5:41 PM, Gökhan Sever <span dir="ltr"><<a href="mailto:gokhansever@gmail.com" target="_blank">gokhansever@gmail.com</a>></span> wrote:<br></div>
<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I want to experiment IPython's parallel computing functionality. This far I couldn't progress much because ipcluster instantiation stalls giving the following messages without dropping me into the main IPython shell. <br>
<br>My intention is parallelise a small Python script that calls an external set of scripts that process the dataset I have in-hand. It is not a huge computing power demanding task but in my Intel 2.5Ghz Dual Core 2 it takes about 1.5 hours to process the whole dataset. Looking at the system monitor I see that the workload is not equally distributed in between CPUs (one of them usually much lazier than the other.) I am sure parallezing the code run would boost the processing speed. In my dataset I have 17 folders and each folder is independent from each other. My script visits each folder and calls the main external script via subprocess module's call function. Processing starts with the first folder, and doesn't work on the next folder unless the processing finishes with the previous folder. Basically, what I really want is to put externally called scripts into separate threads, so that I don't need to wait the previous job to be done during the processing process.<br>
<br>From the IPython parallel computing documentation, it seems like what I want is doable in IPython. However I need some advice whether my understanding is correct in this aspect. Also for the solution of the below warning messages. <br>
<br></blockquote></div><div><br>Yes, I think it would work just fine for that. If you have the names of the folders and a function that will compute what you want, given the name of the folder, you should be able to just use MultiEngineClient.map<br>
</div></div></blockquote></div><div><br>This is the script in hand that I want to parallelize:<br><br><br>import os<br>from subprocess import call<br><br>init = os.getcwd()<br><br>for root, dirs, files in os.walk('.'):<br>
dirs.sort()<br> for file in files:<br> if file.endswith('.sea') == True:<br> print file<br> os.chdir(root)<br> print os.getcwd()<br> call(['postprocessing_saudi', file])<br>
os.chdir(init)<br><br>From the top of the dataset folder hierarchy I call this script, and whenever a "sea" ended file encountered it executes set of external scripts starting with postprocessing_saudi bash script. And goes on with IDL, perl, python scripts till it finishes processing of that "sea" file and so on so forth till the directories exhaust. <br>
<br>If I can make parallel functionality working, will I need to make any changes in this code? If not could you be little more descriptive on the use of MultiEngineClient.map<br><br>Thanks for your comments.<br><br> </div>
<div><div></div><div class="h5">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div>
<br>Cheers,<br><font color="#888888"><br>Brian<br> <br></font></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>
Thanks.<br><br><br>[gsever@ccn Desktop]$ ipcluster local -n 4<br>
/usr/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/filepath.py:12: DeprecationWarning: the sha module is deprecated; use the hashlib module instead<br>
import sha<br>/usr/lib/python2.6/site-packages/foolscap-0.4.2-py2.6.egg/foolscap/banana.py:2: DeprecationWarning: the sets module is deprecated<br>2009-10-17 18:59:37-0500 [-] Log opened.<br>2009-10-17 18:59:37-0500 [-] Process ['ipcontroller', '--logfile=/home/gsever/.ipython/log/ipcontroller'] has started with pid=11066<br>
2009-10-17 18:59:37-0500 [-] Waiting for controller to finish starting...<br>2009-10-17 18:59:38-0500 [-] '/usr/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/filepath.py:12: DeprecationWarning: the sha module is deprecated; use the hashlib module instead\n import sha\n'<br>
2009-10-17 18:59:38-0500 [-] '/usr/lib/python2.6/site-packages/foolscap-0.4.2-py2.6.egg/foolscap/banana.py:2: DeprecationWarning: the sets module is deprecated\n'<br>2009-10-17 18:59:39-0500 [-] Controller started<br>
2009-10-17 18:59:39-0500 [-] Process ['ipengine', '--logfile=/home/gsever/.ipython/log/ipengine11066-'] has started with pid=11067<br>2009-10-17 18:59:39-0500 [-] Process ['ipengine', '--logfile=/home/gsever/.ipython/log/ipengine11066-'] has started with pid=11068<br>
2009-10-17 18:59:39-0500 [-] Process ['ipengine', '--logfile=/home/gsever/.ipython/log/ipengine11066-'] has started with pid=11069<br>2009-10-17 18:59:39-0500 [-] Process ['ipengine', '--logfile=/home/gsever/.ipython/log/ipengine11066-'] has started with pid=11070<br>
2009-10-17 18:59:39-0500 [-] Engines started with pids: [11067, 11068, 11069, 11070]<br>2009-10-17 18:59:39-0500 [-] '/usr/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/filepath.py:12: DeprecationWarning: the sha module is deprecated; use the hashlib module instead\n import sha\n'<br>
2009-10-17 18:59:39-0500 [-] '/usr/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/filepath.py:12: DeprecationWarning: the sha module is deprecated; use the hashlib module instead\n import sha\n'<br>
2009-10-17 18:59:39-0500 [-] '/usr/lib/python2.6/site-packages/foolscap-0.4.2-py2.6.egg/foolscap/banana.py:2: DeprecationWarning: the sets module is deprecated\n'<br>2009-10-17 18:59:40-0500 [-] '/usr/lib/python2.6/site-packages/foolscap-0.4.2-py2.6.egg/foolscap/banana.py:2: DeprecationWarning: the sets module is deprecated\n'<br>
2009-10-17 18:59:40-0500 [-] '/usr/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/filepath.py:12: DeprecationWarning: the sha module is deprecated; use the hashlib module instead\n import sha\n'<br>
2009-10-17 18:59:40-0500 [-] '/usr/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg/twisted/python/filepath.py:12: DeprecationWarning: the sha module is deprecated; use the hashlib module instead\n import sha\n'<br>
2009-10-17 18:59:40-0500 [-] '/usr/lib/python2.6/site-packages/foolscap-0.4.2-py2.6.egg/foolscap/banana.py:2: DeprecationWarning: the sets module is deprecated\n'<br>2009-10-17 18:59:40-0500 [-] '/usr/lib/python2.6/site-packages/foolscap-0.4.2-py2.6.egg/foolscap/banana.py:2: DeprecationWarning: the sets module is deprecated\n'<br>
<br clear="all"><br>Here is my system info:<br>================================================================================<br>Platform : Linux-2.6.29.6-217.2.3.fc11.i686.PAE-i686-with-fedora-11-Leonidas<br>Python : ('CPython', 'tags/r26', '66714')<br>
IPython : 0.10<br>NumPy : 1.4.0.dev<br>================================================================================<br><br>-- <br><font color="#888888">Gökhan<br>
</font><br></div></div><div>_______________________________________________<br>
IPython-user mailing list<br>
<a href="mailto:IPython-user@scipy.org" target="_blank">IPython-user@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
<br></div></blockquote></div><br>
</blockquote></div></div></div><br><br clear="all"><br>-- <br><font color="#888888">Gökhan<br>
</font></blockquote></div><br>