[FieldTrip] Run ft_prepare_vol_sens on multiple core

Richards, John RICHARDS at mailbox.sc.edu
Wed Apr 20 14:18:15 CEST 2022


Frans

Yes, there are two places with the parfor.  I did grep on the programs in the fieldtrip folder

./external/simbio/JERLab_sb_transfer.m:%JERLab start the parallel pool, use parfor
./external/simbio/JERLab_sb_transfer.m:parfor i=2:length(vol.elecnodes)
./JERLab_ft_prepare_leadfield.m:% with max number of nodes; primarily parfor loop for ft_compute_leadfield
./JERLab_ft_prepare_leadfield.m:   parfor i=1:length(insideindx)

I also modified the ft_prepare_leadfield, but don't use it.
./ft_prepare_leadfield.m:   parfor i=1:length(insideindx)


I also added a cfg option that I named "computeparallel", probably in JERLab_ft_prepare_leadfield, which controls if a parfor is used or if this is done in the default version.  Several of the examples in the FT documentation use 10 mm or larger hex source model and head models, likely because these can be computed relatively quickly, and we "could" use the default version.   I use 3mm hex or 3mm tetra for child/adults, and 2mm for infants, which take "several hours" in the default non-parallel version.   We also run these on a large linux cluster.   With only one subject we request machines with the max no of cores (28, or 48).  However, there is some "optimal speed-size" tradeoff for no of cores, and some times we do several subjects at the same time with smaller heads and so can designate the no of cores.   Generally our pipeline gets one EEG subject, possibly with individual MRI on that subject or with "close MRI" or "average template", and we run one subject in the LF with 48 cores.   However, we also have done some studies with 87+ subjects with multiple head models and run them on the 28 core machines in a slurm cluster system.

FYI, in our cluster we have a "home" folder that is used by all the machines.  MATLAB places the programs for the parfor in the home .matlab folder.  If we run more than one program on the same machine we have to explicitly declare the folder to be used in the parfor procedure so the two programs do not overwrite their work.

John

***********************************************
John E. Richards
Carolina Distinguished Professor
Department of Psychology
University of South Carolina
Columbia, SC  29208
Dept Phone: 803 777 2079
Fax: 803 777 9558
Email: richards-john at sc.edu<mailto:richards-john at sc.edu>
https://jerlab.sc.edu
*************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220420/14c7faaa/attachment.htm>


More information about the fieldtrip mailing list