I have run into a problem when trying to batch-estimate a series of EEG DCMs for ERP using the parallel computing toolbox in matlab (SPM12 v6225)
My jobs starts well and have 12 workers running, but sometimes the processes crash because a process cannot load the EEG file, which the DCM model refers back to. I should not that the DCMs I run in parallel are for the same participant, and hence refers back to the same EEG file.
I get an error using spm_eeg_load (line 45)
Cannot load file "..../cespmeeg.mat"
Error in spm_dcm_erp (line 344)
...
The problems seems to be that the estimation process of the DCM for ERP makes and update to the gainmatrix, and if one process tries to access the file while another process is updating the EEG file, the process crashes. It is not every time the job crashes, but only if two processes tries to access the same file simultaneously.
I have used the same parallel computing script to estimate series of DCMs for induced responses, both the spm_dcm_ind does not use the spm_eeg_load function. And therefore that has worked fine.
I have tried to use the addAttachedFiles function for the parallel computing toolbox and added both the EEG file and all the DCM files, which has been specified but not yet estimated.
Does anyone have a suggestion how to work around this problem? I had expected that the addAttachedFiles function would work, but apparently so, it did not.
Best wishes
Mark Christensen,
Univ. of Copenhagen
Dept. of Neuroscience and Pharmacology
|