Difference between revisions of "MATLAB/Batch"

From ScientificComputing
Jump to: navigation, search
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
  bsub [LSF options] matlab -nodisplay -nojvm -singleCompThread -r simulation
 
  bsub [LSF options] matlab -nodisplay -nojvm -singleCompThread -r simulation
  
Please note, that you have to leave away the file ending .m. Here you need to replace ''[LSF options]'' with LSF parameters for the resource requirements of the job. Please find a documentation about the parameters of bsub on the wiki page about the [[Using_the_batch_system|batch system]].
+
Please note, that you have to leave away the file ending .m. You need to replace ''[LSF options]'' with LSF parameters for the resource requirements of the job. Please find a documentation about the parameters of <tt>bsub</tt> on the wiki page about the [[Using_the_batch_system|batch system]].
  
 
We suggest you include the extra options shown above:
 
We suggest you include the extra options shown above:
Line 9: Line 9:
 
:since jobs on compute nodes are not run interactively, this flag explicitly tells Matlab that no graphical display (X server) is available is available.
 
:since jobs on compute nodes are not run interactively, this flag explicitly tells Matlab that no graphical display (X server) is available is available.
 
;<tt>-singleCompThread</tt>
 
;<tt>-singleCompThread</tt>
:forces Matlab to use only one thread for its computations. '''This option is crucial to prevent MATLAB from overloading Brutus nodes.'''
+
:forces Matlab to use only one thread for its computations. '''This option is crucial to prevent MATLAB from overloading the compute nodes.'''
 
;<tt>-nojvm</tt>
 
;<tt>-nojvm</tt>
 
:(optional) prevents the JVM (Java virtual machine) from being used.  Add this flag unless you need the JVM, such as the with the PCT (Parallel Computing Toolbox).
 
:(optional) prevents the JVM (Java virtual machine) from being used.  Add this flag unless you need the JVM, such as the with the PCT (Parallel Computing Toolbox).
  
 
For submitting parallel MATLAB jobs, please have a look at the tutorials about running MATLAB in parallel.
 
For submitting parallel MATLAB jobs, please have a look at the tutorials about running MATLAB in parallel.

Revision as of 11:12, 29 August 2016

Assuming that you already loaded the MATLAB module and have a MATLAB program simulation.m you would like to run, the command to submit a job to the batch system would look like

bsub [LSF options] matlab -nodisplay -nojvm -singleCompThread -r simulation

Please note, that you have to leave away the file ending .m. You need to replace [LSF options] with LSF parameters for the resource requirements of the job. Please find a documentation about the parameters of bsub on the wiki page about the batch system.

We suggest you include the extra options shown above:

-nodisplay
since jobs on compute nodes are not run interactively, this flag explicitly tells Matlab that no graphical display (X server) is available is available.
-singleCompThread
forces Matlab to use only one thread for its computations. This option is crucial to prevent MATLAB from overloading the compute nodes.
-nojvm
(optional) prevents the JVM (Java virtual machine) from being used. Add this flag unless you need the JVM, such as the with the PCT (Parallel Computing Toolbox).

For submitting parallel MATLAB jobs, please have a look at the tutorials about running MATLAB in parallel.