The source code for the parfor-loop that is trying to execute on the worker could not be found.
31 次查看(过去 30 天)
显示 更早的评论
Hi. I have compiled my code and I'm trying to run it by matlab runtime on a linux HPC server. The code has been parallelized by parfor and it works well in matlab, but when I try to run it with matlabruntime I get this error while I don't use "nanmean" in my code.
The source code (parallelized_closedLoopSimulation) for the parfor-loop that is trying to execute on the worker could not be found.
Caused by:
Undefined function 'nanmean' for input arguments of type 'double'.
Error using remoteParallelFunction (line 84)
Worker unable to find file.
Undefined function 'nanmean' for input arguments of type 'double'.
MATLAB:parfor:SourceCodeNotAvailable.
Here is part of my parfor loop:
parfor run = 1: nbRun
fprintf(['%%%%****** RUN NUM: ' num2str(run) '******%%%%%'])
%% ===== Step 3 - starting of 26 chunks of consequitive trials =======
for chunk = 1:length(chunks)
fprintf(['START chunk number: ' num2str(chunk) '/n']);
current_chunk = chunks{1,chunk}{1,1};
sCfg = [];
sCfg.dataset = currentSessionPath;
sCfg.trialdef.eventtype = cTRIGTYPE;
sCfg.trialdef.eventvalue = ceTRIG;
sCfg.trialdef.prestim = PRESTIM;
sCfg.trialdef.poststim = POSTSTIM;
sCfg.trialfun = cTRIALFUN;
...
end
1 个评论
Christopher McCausland
2023-12-12
Hi Sina,
nanmean() is an inbuilt function which calculates the mean value, ignoring NaN's. I believe it is depreciated and mean() with pairwise inputs to specify the NaN behaviour is preferred.
That being said, this is beside the point. Your worker nodes cannot see these inbuilt functions. Are you sure that the root folder of MATLAB installation to cluster ClusterMatlabRoot is set to the correct path?
Kind regards,
Christopher
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel for-Loops (parfor) 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!