필터 지우기
필터 지우기

How to run a job on a remote cluster?

조회 수: 14 (최근 30일)
Ryan
Ryan 2014년 10월 4일
댓글: Aleksander Lidtke 2015년 8월 24일
I created a bash script that I have uploaded to a remote cluster via scp. In this script I load a Matlab module (version R2014a) which I use to run some Matlab code.
#$ -pe smp 4 //tells the cluster to provide 4 cores local to a single node
module load matlab14/R2014a
matlab -nosplash -nodisplay -r "code I want to run"
Within my Matlab code I am creating a parallel object and running the following (I'm trying to learn how to run a job in parallel on the cluster before writing the real code).
pool = parpool('local',4);
parfor k = 1 : 10000
disp(k); //console input saved is to file to demonstrate I have the general syntax right
end
delete(pool);
When I run my code I get the following error
{^HUndefined variable "com" or class
"com.mathworks.toolbox.distcomp.pmode.SessionInfo.NULL_SESSION_INFO".
Error in parpool (line 96)
sessionInfo =
com.mathworks.toolbox.distcomp.pmode.SessionInfo.NULL_SESSION_INFO;
Error in main (line 4)
pool = parpool('local',4);
Error in run (line 63)
evalin('caller', [script ';']);
}^H
^G{^HError: File: /Users/name/scripts/main.m Line: 4 Column: 1
The input character is not valid in MATLAB statements or expressions.
Error in run (line 63)
evalin('caller', [script ';']);
}^H
^G{^HUndefined variable "com" or class
"com.mathworks.toolbox.distcomp.pmode.SessionInfo.NULL_SESSION_INFO".
Error in parpool (line 96)
sessionInfo =
com.mathworks.toolbox.distcomp.pmode.SessionInfo.NULL_SESSION_INFO;
Error in main (line 4)
pool = parpool('local',4);
Error in run (line 63)
evalin('caller', [script ';']);
}^H
^G
What might I be doing wrong and how might I fix it? I have been able to run other Matlab scripts but I have not been able to run any that implement parallelization. I checked the cluster and the Parallel Computing Toolbox is present.
  댓글 수: 1
Aleksander Lidtke
Aleksander Lidtke 2015년 8월 24일
Hi, I just ran into the same issue. My supercomputer help page suggests starting Matlab with -nodisplay -nojvm -nosplash options. It turns out that -nojvm causes this error. The variable com the error message mentions is, in fact, some Java module, so it won't work without the Jave Virtual Machine.

댓글을 달려면 로그인하십시오.

답변 (1개)

Edric Ellis
Edric Ellis 2014년 10월 6일
Parallel Computing Toolbox relies on Java, so you should omit the -nojvm flag from your matlab command-line.
  댓글 수: 2
Ryan
Ryan 2014년 10월 6일
Yes, you are correct. I had already removed it and forgot to remove it for this post. It did not change the results I was getting though. I have updated my post.
Edric Ellis
Edric Ellis 2014년 10월 6일
Hm, the error message that you get (unhelpful though it is) is precisely the error that you see when specifying -nojvm, and I know of no other way to get that error. Perhaps you could try adding
error(javachk('jvm'))
to the start of your script - that will error out if Java is not enabled before you get any further.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Cluster Configuration에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by