[Eeglablist] How to use parallel pools in the std_precomp function?

Arnaud Delorme arno at ucsd.edu
Sun Jun 7 23:00:18 PDT 2015


Dear Katharina,

I think the standard way to change line 483 of std_precomp (in my version) from 

        for index = 1:length(STUDY.design(g.design).cell)

to

        parfor index = 1:length(STUDY.design(g.design).cell)

Then type in on the command line 

matlabpool(4);

Then run the spectral computation. It would make sense to change this line by default since parfor defaults to for by default (so we will do it).
Best,

Arno

> On Jun 7, 2015, at 5:18 PM, Makoto Miyakoshi <mmiyakoshi at ucsd.edu> wrote:
> 
> Dear Arno and Ramon,
> 
> Please help me with this question about the use of parfor().
> 
> Makoto
> 
> On Thu, Jun 4, 2015 at 6:48 AM, Katharina Ledergerber <k.ledergerber at psychologie.uzh.ch <mailto:k.ledergerber at psychologie.uzh.ch>> wrote:
> Hi everyone,
> 
> I am quite new to EEGLAB and I hope that I can explain my problem properly. I have a question on how to use parallel pools with the std_precomp function.
> 
> Currently I am applying time-frequency analyses on my high-density EEG data, recorded with a 128 electrode system. Therefore I use the standard std_precomp function to precompute channel measure ERSP/ITC on my files in the STUDY (for all subjects and all channels):
> 
> [STUDY ALLEEG] = std_precomp(STUDY, ALLEEG, {}, 'design', 1, 'ersp', 'on', 'itc', 'on');
> STUDY = pop_savestudy( STUDY, ALLEEG, 'filename', STUDY.filename, 'filepath', STUDY.filepath, 'savemode', 'resave');
> 
> As it is an FFT, it takes quite a while to compute (right now approx. 100 min per subject). Since I do not have a very powerful computer (4 cores, 8GB RAM), I thought I could try the precomputation on a more powerful computer (16 cores, 32GB RAM) to save time. To make use of all the cores I tried to apply parpool.
> 
> parpool (‚local‘, 8)
> [STUDY ALLEEG] = std_precomp(STUDY, ALLEEG,{} , 'design', 1, 'ersp', 'on', 'itc', 'on');
> STUDY = pop_savestudy( STUDY, ALLEEG, 'filename', STUDY.filename, 'filepath', STUDY.filepath, 'savemode', 'resave‘);
> delete(gcp);
> 
> It seemed to work, since all 16 cores showed activity. Strangely, the more powerful computer took as much time as my computer. Could it be that jobs are not distributed among cores, but all cores do exactly the same? Since I am very new to EEGLAB I have still some trouble understanding what the std_precomp function does in detail. I guess to distribute jobs among cores I should implement parfor loops in the std_precomp function instead of the ordinary for loops? I think, though that it is not as easy to implement, since parfor loops do have some restrictions in terms of what you can put in the loop.
> Does anyone have a function already modified with parfor loops? Otherwise, I am grateful for any advice about using parallel pools and ERSP precomputation.
> 
> Thanks,
> Katharina
> 
> Katharina Ledergerber, MSc.
> PhD student
> University of Zurich
> Developmental Psychology:
> Childhood and Infancy
> Binzmuehlestrasse 14, Box 21
> CH-8050 Zurich
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html <http://sccn.ucsd.edu/eeglab/eeglabmail.html>
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu <mailto:eeglablist-unsubscribe at sccn.ucsd.edu>
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu <mailto:eeglablist-request at sccn.ucsd.edu>
> 
> 
> 
> -- 
> Makoto Miyakoshi
> Swartz Center for Computational Neuroscience
> Institute for Neural Computation, University of California San Diego

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20150607/6161cc7f/attachment.html>


More information about the eeglablist mailing list