parfor
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?
what was wrong? it runs for me on my windows laptop and on my linux server
it's about a session. I am running the main analysis. When it stops, I will re-run with parfor and update you.
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);
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
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?
good point we could use options to set N
maybe I fixed it https://github.com/CPernet/spmup/commit/40e827dbd346ba2403cdcd775d7082a4d9cdcca3