How to run a job on a remote cluster?

18 visualizzazioni (ultimi 30 giorni)
Ryan
Ryan il 4 Ott 2014
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 Commento
Aleksander Lidtke
Aleksander Lidtke il 24 Ago 2015
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.

Accedi per commentare.

Risposte (1)

Edric Ellis
Edric Ellis il 6 Ott 2014
Parallel Computing Toolbox relies on Java, so you should omit the -nojvm flag from your matlab command-line.
  2 Commenti
Ryan
Ryan il 6 Ott 2014
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 il 6 Ott 2014
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.

Accedi per commentare.

Categorie

Scopri di più su Cluster Configuration in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by