How to run Matlab jobs on the TIGRESS clusters
Running Matlab (Nobel)
Please note the following requirements when running Matlab on the Nobel clusters:
- To run Matlab interactively with its graphic interface, invoke it with the -singleCompThread command-line argument to prevent the creation of multiple threads.
- To run Matlab in command line mode, invoke it with the -singleCompThread -nodisplay -nosplash -nojvm command-line arguments to prevent the use of X Windows, and the creation of multiple threads:
- /usr/licensed/bin/matlab -singleCompThread -nodisplay -nosplash -nojvm -r <m_script_name>
(e.g., if your *.m script is 'myscript.m', then you must specify 'myscript' as <m_script_name>
without the quotes and without the '.m')
- /usr/licensed/bin/matlab -singleCompThread -nodisplay -nosplash -nojvm -r <m_script_name>
- NOTE: In the spirit of fairness to all users sharing these servers, running Matlab in multi-threaded mode on Nobel is not permitted.
Running Matlab (Adroit or Della)
Please note the following requirements when running Matlab on the Adroit or Della clusters:
- Invoke matlab with the -singleCompThread -nodisplay -nosplash -nojvm options to prevent the use of X Windows, and the creation of multiple threads.
- Your PBS script file must include the following lines:
- #PBS -l nodes=1:ppn=1
- cd <directory_containing_m_script>
- /usr/licensed/bin/matlab -singleCompThread -nodisplay -nosplash -nojvm -r <m_script_name>
(e.g., if your *.m script is 'myscript.m', then you must specify 'myscript' as <m_script_name>
without the quotes and without the '.m')
Running Matlab in multi-threaded mode (Adroit and Della only)
Most of the time, running Matlab in single-threaded mode (as described above) will meet your needs. But if you have very mathematically intense computations that might benefit from the built-in multi-threading provided by Matlab's BLAS implementation, then you can experiment with running in multi-threaded mode as follows:
- You will need to invoke Matlab as above, but without the -singleCompThread option.
- Your *.m script must include the following line:
- maxNumCompThreads(N)
(Note that you'll probably get a deprecation warning, which you can ignore.)
- maxNumCompThreads(N)
- Your PBS script must include the following lines:
- #PBS -l nodes=1:ppn=N
- cd <directory_containing_m_script>
- /usr/licensed/bin/matlab -nodisplay -nosplash -nojvm -r <m_script_name>
(e.g., if your *.m script is 'myscript.m', then you must specify 'myscript' as <m_script_name>
without the quotes and without the '.m')
NOTE: Both in your *.m script and in your PBS script, 'N' must be a number from 2 to the maximum number of cores per node on the cluster you are running. Use the smallest 'N' that gives you a significant performance boost.
