[pymvpa] how to do multiprocessing in pymvpa?

Nick Oosterhof nikolaas.oosterhof at unitn.it
Mon Feb 4 13:17:10 UTC 2013


On 4 February 2013 14:09, Meng Liang <meng.liang at hotmail.co.uk> wrote:
> I'm trying to run a searchlight analysis using the whole brain mask but I
> found it impossible to finish within a reasonable time - it has been running
> three days for one two-way classification task in one subject, and it still
> hasn't finished. To make the computing faster, would multiprocessing be an
> option? I didn't see any part of the tutorial mentioning multiprocessing -
> is it because it is already embedded/implemented in pymvpa commands?

Yes, multi-core support is already part of pyMVPA's searchlight
implementation. It requires, however, the presence of pprocess [1].
The Searchlight constructor has an optional parameter 'nproc' that
controls the number of parallel processes to use. By default
(nproc=None) it uses the number of cores of the machine - unless
pprocess is not available, in which case nproc=1.

As per the example (doc/examples/searchlight.py) it is recommended to
enable the searchlight debug messages - these include messages related
to  parallelization.

In my experience it's easy to use pprocess with neurodebian. On a mac
(OS X Lion) I did not get it to work, although I have to admit I did
not try very hard.

[1] http://pypi.python.org/pypi/pprocess



>
> Best,
> Meng
>
> _______________________________________________
> Pkg-ExpPsy-PyMVPA mailing list
> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa



More information about the Pkg-ExpPsy-PyMVPA mailing list