spmup icon indicating copy to clipboard operation
spmup copied to clipboard

parfor

Open SiyaMRPhy opened this issue 3 years ago • 7 comments

https://github.com/CPernet/spmup/blob/6dbfe2ad39ff0d04904c6009933c7df2bac13d96/bids/spmup_BIDS_unpack.m#L184-L195

@CPernet This parfor was giving errors while running the script

I replaced it with a normal 'for', and it worked. Can you have a look at it?

SiyaMRPhy avatar Oct 07 '22 11:10 SiyaMRPhy

what was wrong? it runs for me on my windows laptop and on my linux server

CPernet avatar Oct 07 '22 12:10 CPernet

it's about a session. I am running the main analysis. When it stops, I will re-run with parfor and update you.

SiyaMRPhy avatar Oct 07 '22 12:10 SiyaMRPhy

Starting parallel pool (parpool) using the 'local' profile ... Preserving jobs with IDs: 660 because they contain crash dump files. You can use 'delete(myCluster.Jobs)' to remove all jobs created with profile local. To create 'myCluster' use 'myCluster = parcluster('local')'. Connected to the parallel pool (number of workers: 11). Error using spmup_BIDS_unpack/parfor%supply_1 Index exceeds the number of array elements (16).

Error in spmup_BIDS_unpack (line 191) parfor s=1:nb_sub

Error in ss_test_smpup (line 14) [BIDS,subjects] = spmup_BIDS_unpack(BIDS_dir,options);

SiyaMRPhy avatar Oct 07 '22 12:10 SiyaMRPhy

I see something to do with parpool management ... until I fix that you can simply set N in spmup_setparallel line 11, this should do the trick

CPernet avatar Oct 07 '22 13:10 CPernet

will do that. btb, its allotting N-1 cores for the parpool parpool(N-1) This should be based on the RAM available per core.

Isn't it better to add this in the field 'option' so that the user can set it?

SiyaMRPhy avatar Oct 07 '22 13:10 SiyaMRPhy

good point we could use options to set N

CPernet avatar Oct 07 '22 14:10 CPernet

maybe I fixed it https://github.com/CPernet/spmup/commit/40e827dbd346ba2403cdcd775d7082a4d9cdcca3

CPernet avatar Oct 07 '22 18:10 CPernet