You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am failing to get MATLAB Stan to run with parallelized loop "parfor" ...
Things work with regular "for", work with parfor when workers pool is not started (meaning the parser swallows the syntax and types variables, etc), but as soon as I turn on the worker's pool it breaks with the following error.
Not sure yet what caused exact error I mention below, but there are seem to be a few issues with StanModel.m which would prevent multi-worker execution with "parfor" in MATLAB, since
fname = fullfile(self.working_dir,'temp.data.R');
fname = fullfile(self.working_dir,'temp.init.R');
always saves temporary data into the same file, overwriting it across workers
same issue is hidden someplace with the sample_file which would be by default
output-1.csv
same for all workers.
Also "cores" option does not seem to have been made available within MATLAB.
THANK YOU
-Leon
ERROR:
Error using StanModel/set.control (line 600)
Too many input arguments.
Error in StanModel/set (line 293)
self.control = p.Results.control;
Error in StanModel/sampling (line 709)
self.set(varargin{:});
Error in P3v2parfor>(parfor body) (line 90)
fit = model.sampling( 'data', peps_dat, 'iter', P.BTnum, 'warmup', round(.1
* P.BTnum), 'chains', P.numChains) ;
Error in P3v2parfor (line 82)
parfor nd =1:NndxActual % parfor % process multi-peptide proteins
The text was updated successfully, but these errors were encountered:
'cores' as in Rstan manual for example:
"cores: Number of cores to use when executing the chains in parallel, which defaults to
1 but we recommend setting the mc.cores option to be as many processors as the hardware and RAM allow (up to the number of chains)"
Do you in turn have any sample code of successful parfor use with Stan ?
given what I mention about use of the same file name 'temp.data.R" I do not see how
different threads would not interfere with one another ...
Each chain gets run in parallel as a separate process. I haven't found any way to control how these processes get distributed to different processors/cores, but I've observed that they tend to get distributed to however many cores you have available.
I understand your point about the filenames, and I'll add a unique tag to prevent the overwriting.
I am failing to get MATLAB Stan to run with parallelized loop "parfor" ...
Things work with regular "for", work with parfor when workers pool is not started (meaning the parser swallows the syntax and types variables, etc), but as soon as I turn on the worker's pool it breaks with the following error.
Not sure yet what caused exact error I mention below, but there are seem to be a few issues with StanModel.m which would prevent multi-worker execution with "parfor" in MATLAB, since
fname = fullfile(self.working_dir,'temp.data.R');
fname = fullfile(self.working_dir,'temp.init.R');
always saves temporary data into the same file, overwriting it across workers
same issue is hidden someplace with the sample_file which would be by default
output-1.csv
same for all workers.
Also "cores" option does not seem to have been made available within MATLAB.
THANK YOU
ERROR:
Error using StanModel/set.control (line 600)
Too many input arguments.
Error in StanModel/set (line 293)
self.control = p.Results.control;
Error in StanModel/sampling (line 709)
self.set(varargin{:});
Error in P3v2parfor>(parfor body) (line 90)
fit = model.sampling( 'data', peps_dat, 'iter', P.BTnum, 'warmup', round(.1
* P.BTnum), 'chains', P.numChains) ;
Error in P3v2parfor (line 82)
parfor nd =1:NndxActual % parfor % process multi-peptide proteins
The text was updated successfully, but these errors were encountered: