Both sides previous revision Previous revision Next revision | Previous revision |
software:matlab:farber [2020-10-29 11:14] – [Interactive example] anita | software:matlab:farber [2021-04-27 16:21] (current) – external edit 127.0.0.1 |
---|
| |
===== Create a job script file ===== | ===== Create a job script file ===== |
You should create a job script file to submit a batch job. Start by modifying a job template file (''/opt/templates/gridengine''), for example, to submit a serial job on one core of a compute node, copy the serial template. | You should create a job script file to submit a batch job. Start by modifying a job template file (''/opt/shared/templates/gridengine''), for example, to submit a serial job on one core of a compute node, copy the serial template. |
In your copy change the commented ''vpkg_require'' command to | In your copy change the commented ''vpkg_require'' command to |
require MATLAB, and then add your shell commands to the end of the file. Your copy may contain the lines: | require MATLAB, and then add your shell commands to the end of the file. Your copy may contain the lines: |
===== Compiling your MATLAB ===== | ===== Compiling your MATLAB ===== |
| |
There is an example MCR project in the ''/opt/templates/'' directory for you to copy and try. Copy on the head node and qlogin to compile with MATLAB. Once your program is compiled you can run it interactively or in batch, without needing a MATLAB license. | There is an example MCR project in the ''/opt/shared/templates/'' directory for you to copy and try. Copy on the head node and qlogin to compile with MATLAB. Once your program is compiled you can run it interactively or in batch, without needing a MATLAB license. |
| |
==== Copy dev-projects template ==== | ==== Copy dev-projects template ==== |
On the head node | On the head node |
<code> | <code> |
cp -r /opt/templates/dev-projects/MCR . | cp -r /opt/shared/templates/dev-projects/MCR . |
cd MCR | cd MCR |
</code> | </code> |
| |
<code> | <code> |
cp /opt/templates/gridengine/matlab-mcr.qs . | cp /opt/shared/templates/gridengine/matlab-mcr.qs . |
vi matlab-mcr.qs | vi matlab-mcr.qs |
diff /opt/templates/gridengine/matlab-mcr.qs matlab-mcr.qs | diff /opt/shared/templates/gridengine/matlab-mcr.qs matlab-mcr.qs |
</code> | </code> |
The ''diff'' output shows changes made in the ''vi'' session: | The ''diff'' output shows changes made in the ''vi'' session: |
| |
| |
===== MCR array job example ===== | ====== MCR array job example ====== |
| |
Most Matlab functions can be compiled using the Matlab Compiler (MCC) and then deployed to run on the compute nodes in the MATLAB Compiler Runtime (MCR). The MCR is a prerequisite for deployment, and is installed on all the compute nodes. You must use VALET to set up the libraries you will need to run your function from the command line. You do not need to use the shell (''.sh'' file) that the compiler creates. | Most Matlab functions can be compiled using the Matlab Compiler (MCC) and then deployed to run on the compute nodes in the MATLAB Compiler Runtime (MCR). The MCR is a prerequisite for deployment, and is installed on all the compute nodes. You must use VALET to set up the libraries you will need to run your function from the command line. You do not need to use the shell (''.sh'' file) that the compiler creates. |
| |
The ''mcc'' command will generate a ''.sh'' file, which you can use to setup your environment and run the command. This does not use VALET and does not have any grid engine commands in it. We suggest you the gridengine template in the file | The ''mcc'' command will generate a ''.sh'' file, which you can use to setup your environment and run the command. This does not use VALET and does not have any grid engine commands in it. We suggest you the gridengine template in the file |
/opt/templates/gridengine/matlab-mcr.qs | /opt/shared/templates/gridengine/matlab-mcr.qs |
or modify this simple example: | or modify this simple example: |
<code> | <code> |