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

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Sun Jun 7 17:18:42 PDT 2015

Dear Arno and Ramon,

Please help me with this question about the use of parfor().


On Thu, Jun 4, 2015 at 6:48 AM, Katharina Ledergerber <
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
> To unsubscribe, send an empty email to
> 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

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/7306e548/attachment.html>

More information about the eeglablist mailing list