I have a question about runing the sbproj models in parfor loop
1. I load project and set up the solver:
sbioloadproject('modelName.sbproj','m1')
csObj = getconfigset(m1);
csObj.SolverType = 'sundials';
csObj.SolverOptions.AbsoluteToleranceScaling = 1;
csObj.SolverOptions.AbsoluteTolerance = 1E-16;
csObj.SolverOptions.RelativeTolerance = 1E-12;
csObj.MaximumWallClock = 60;
2. I define dose and variant:
dose1 = getdose(m1,'myDose1');
v1 = getvariant(m1,'myVariant1');
3. accelerate the model
sbioaccelerate(m1,csObj,v1,dose1);
4. simulate in parfor loop
m1ParConst = parallel.pool.Constant(m1);
parfor i = 1:r
[...
[t,y] = sbiosimulate(m1ParConst.Value,[],v1,dose1);
[...
end
Question:
Q1. Is this correct? If I include dose1 and v1 definition (i.e. if I uncomment dose1 and v1 in parfor loop) I get an error:
Undefined function 'getdose' for input arguments of type 'double'.
Error in parallel_function>make_general_channel/channel_general (line 923)
O = F(C{:});
Error in remoteParallelFunction (line 46)
out = parallel.internal.pool.serialize(feval(channel, channelArgs{:}));
Q2: are the solver settings respected? If I try to include csOBj in 'sbiosimulate' call I get an error as well.
2 Comments
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/510565-issues-with-doses-variants-in-parfor-loop-in-simbiology#comment_809177
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/510565-issues-with-doses-variants-in-parfor-loop-in-simbiology#comment_809177
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/510565-issues-with-doses-variants-in-parfor-loop-in-simbiology#comment_809251
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/510565-issues-with-doses-variants-in-parfor-loop-in-simbiology#comment_809251
Sign in to comment.