<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><base href="x-msg://1705/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Yeah, pprocess.get_number_of_cores() looks to find info about the cores in /proc/cpuinfo which does not exist on OSX. <div><br></div><div><br></div><div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div>----</div><div>Jonas Kaplan, Ph.D.<br>Research Assistant Professor<br>Brain & Creativity Institute<br>University of Southern California</div></span>

</div>
<br><div><div>On Feb 4, 2013, at 10:40 AM, Meng Liang <<a href="mailto:meng.liang@hotmail.co.uk">meng.liang@hotmail.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="hmmessage" style="font-size: 10pt; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div dir="ltr">Hi Michael and Jonas,<br><br>Thanks very much for your prompt reply! Jonas's suggestion solved the problem - If I do not put 'nproc = 3' explicitly in the searchlight command, I always get the error "IOError: [Errno 2] No such file file or directory: '/proc/cpuinfo'".<br><br>Thanks again!<br><br>Best,<br>Meng<br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From:<span class="Apple-converted-space"> </span><a href="mailto:jtkaplan@usc.edu">jtkaplan@usc.edu</a><br>Date: Mon, 4 Feb 2013 10:14:45 -0800<br>To:<span class="Apple-converted-space"> </span><a href="mailto:pkg-exppsy-pymvpa@lists.alioth.debian.org">pkg-exppsy-pymvpa@lists.alioth.debian.org</a><br>Subject: Re: [pymvpa] how to do multiprocessing in pymvpa?<br><br><div>I have pprocess working on Mac OSX for searchlights. The trick is that it fails when checking the number of cores, so you have to specify nproc. </div><div><br></div><div>Jonas<br><br>On Feb 4, 2013, at 9:57 AM, Meng Liang <<a href="mailto:meng.liang@hotmail.co.uk">meng.liang@hotmail.co.uk</a>> wrote:<br><br></div><blockquote><div dir="ltr">Hi Nick,<br><br>Thanks so much for your reply! Following your suggestion, I downloaded and installed the pprocess on Neurodebian virtual machine on a Windows 7 PC and now the script runs much faster!<span class="Apple-converted-space"> </span><br><br>However, it does not work on Mac. I googled but didn't find much relevant info about it - I got the feeling that pprocess is not supported in Mac. Is it true? If so, doesn't that mean running pymvpa on Mac machines cannot utilize multi-core computation?<br><br>Finally, an irrelevant question: is the value of 'radius' parameter in the Searchlight command in millimeter? It says so in Pymvpa documentation (<span class="Apple-converted-space"> </span><a href="http://www.pymvpa.org/modref/mvpa.measures.searchlight.html" target="_blank">http://www.pymvpa.org/modref/mvpa.measures.searchlight.html</a><span class="Apple-converted-space"> </span>). But in a given example on Pymvpa website, it seems to suggest that the value of 'radius' means the number of voxels (<span class="Apple-converted-space"> </span><a href="http://www.pymvpa.org/examples/searchlight_minimal.html" target="_blank">http://www.pymvpa.org/examples/searchlight_minimal.html</a><span class="Apple-converted-space"> </span>): "<span class="ecxc"># setup searchlight with 2 voxels radius</span>" and "<span class="ecxn">sl</span><span class="Apple-converted-space"> </span><span class="ecxo">=</span><span class="Apple-converted-space"> </span><span class="ecxn">sphere_searchlight</span><span class="p">(</span><span class="ecxn">cv</span><span class="p">,</span><span class="Apple-converted-space"> </span><span class="ecxn">radius</span><span class="ecxo">=</span><span class="ecxmi">2</span><span class="p">,</span><span class="Apple-converted-space"> </span><span class="ecxn">space</span><span class="ecxo">=</span><span class="s">'myspace'</span><span class="p">,...</span>". It's a bit confusing to me...<br><br>Also, do you know if multi-core support is also available for other commands other than searchlight? I find that cross-validation with large number of permutations is also quite slow - it would be good if multi-core support is also implemented in the permutation scenario.<span class="Apple-converted-space"> </span><br><br>Best,<br>Meng<br><br><br><br><div><div id="ecxSkyDrivePlaceholder"></div>> Date: Mon, 4 Feb 2013 14:17:10 +0100<br>> From:<span class="Apple-converted-space"> </span><a href="mailto:nikolaas.oosterhof@unitn.it">nikolaas.oosterhof@unitn.it</a><br>> To:<span class="Apple-converted-space"> </span><a href="mailto:pkg-exppsy-pymvpa@lists.alioth.debian.org">pkg-exppsy-pymvpa@lists.alioth.debian.org</a><br>> Subject: Re: [pymvpa] how to do multiprocessing in pymvpa?<br>><span class="Apple-converted-space"> </span><br>> On 4 February 2013 14:09, Meng Liang <<a href="mailto:meng.liang@hotmail.co.uk">meng.liang@hotmail.co.uk</a>> wrote:<br>> > I'm trying to run a searchlight analysis using the whole brain mask but I<br>> > found it impossible to finish within a reasonable time - it has been running<br>> > three days for one two-way classification task in one subject, and it still<br>> > hasn't finished. To make the computing faster, would multiprocessing be an<br>> > option? I didn't see any part of the tutorial mentioning multiprocessing -<br>> > is it because it is already embedded/implemented in pymvpa commands?<br>><span class="Apple-converted-space"> </span><br>> Yes, multi-core support is already part of pyMVPA's searchlight<br>> implementation. It requires, however, the presence of pprocess [1].<br>> The Searchlight constructor has an optional parameter 'nproc' that<br>> controls the number of parallel processes to use. By default<br>> (nproc=None) it uses the number of cores of the machine - unless<br>> pprocess is not available, in which case nproc=1.<br>><span class="Apple-converted-space"> </span><br>> As per the example (doc/examples/searchlight.py) it is recommended to<br>> enable the searchlight debug messages - these include messages related<br>> to parallelization.<br>><span class="Apple-converted-space"> </span><br>> In my experience it's easy to use pprocess with neurodebian. On a mac<br>> (OS X Lion) I did not get it to work, although I have to admit I did<br>> not try very hard.<br>><span class="Apple-converted-space"> </span><br>> [1]<span class="Apple-converted-space"> </span><a href="http://pypi.python.org/pypi/pprocess" target="_blank">http://pypi.python.org/pypi/pprocess</a><br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> ><br>> > Best,<br>> > Meng<br>> ><br>> > _______________________________________________<br>> > Pkg-ExpPsy-PyMVPA mailing list<br>> ><span class="Apple-converted-space"> </span><a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>> ><span class="Apple-converted-space"> </span><a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br>><span class="Apple-converted-space"> </span><br>> _______________________________________________<br>> Pkg-ExpPsy-PyMVPA mailing list<br>><span class="Apple-converted-space"> </span><a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>><span class="Apple-converted-space"> </span><a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br></div></div></blockquote><blockquote><span>_______________________________________________</span><br><span>Pkg-ExpPsy-PyMVPA mailing list</span><br><span><a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a></span><br><span><a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a></span></blockquote><br>_______________________________________________ Pkg-ExpPsy-PyMVPA mailing list<span class="Apple-converted-space"> </span><a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><span class="Apple-converted-space"> </span><a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a></div></div>_______________________________________________<br>Pkg-ExpPsy-PyMVPA mailing list<br><a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br><a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a></div></blockquote></div><br></div></body></html>