Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
software:matlab:mills [2018-12-03 11:07] – [Submit job] anita | software:matlab:mills [2019-08-29 16:05] (current) – [Matlab script] anita | ||
---|---|---|---|
Line 4: | Line 4: | ||
On Mills, MATLAB projects should be developed using a Desktop installation of MATLAB and then copied to the cluster | On Mills, MATLAB projects should be developed using a Desktop installation of MATLAB and then copied to the cluster | ||
to be run in batch. | to be run in batch. | ||
- | consider an extended MATLAB example involving | + | consider an extended MATLAB example involving |
the first function in a loop, and to using the Parallel Toolbox. | the first function in a loop, and to using the Parallel Toolbox. | ||
Details on how to run these two scripts in batch are given with the resulting output files. | Details on how to run these two scripts in batch are given with the resulting output files. | ||
- | section with UNIX commands you can use to watch your jobs and gather [[#timing and core count]] numbers. | + | section with UNIX commands you can use to watch your jobs and gather [[#timings-and-core-count | timing and core count]] numbers. |
You will need to know how much memory and how many cores you should request for your jobs. | You will need to know how much memory and how many cores you should request for your jobs. | ||
Line 27: | Line 27: | ||
==== Matlab License Information ==== | ==== Matlab License Information ==== | ||
- | These are pushed into consumable (global, per-job) integer complexes in Grid Engine and can be checked using | + | Matlab licenses |
< | < | ||
Line 116: | Line 116: | ||
- | The page will using a Matlab function to illustrate using Matlab in batch and interactively. | + | The examples |
- | ===== Batch example ===== | ||
- | The basic steps to run [[: | ||
==== Matlab script ==== | ==== Matlab script ==== | ||
First, write a Matlab script file. It should have a comment on the first line describing the purpose of the script and have the '' | First, write a Matlab script file. It should have a comment on the first line describing the purpose of the script and have the '' | ||
Line 139: | Line 137: | ||
quit | quit | ||
</ | </ | ||
+ | |||
+ | This is a detailed script example, which calls the maxEig function. | ||
+ | |||
+ | <note tip> | ||
+ | Several MATLAB commands could be added to the beginning of this script to set the maximum number of computational threads to the number of slots assigned to your job. If the scheduler using CGROUPS to limit your job core count, then these commands are not necessary. | ||
+ | < | ||
+ | [compThreads, | ||
+ | if count == 1 | ||
+ | warning(' | ||
+ | autoCompThreads = maxNumCompThreads(compThreads); | ||
+ | disp(sprintf(' | ||
+ | end | ||
+ | </ | ||
+ | See [[maxNumCompThreadsGridEngine|Setting maximum number of computational threads]]</ | ||
+ | |||
+ | <note tip> | ||
+ | This script ends in a **__quit__** command (equivalent to MATLAB **__exit__**). | ||
+ | terminates MATLAB when done. If you run this from the bash command line with the '' | ||
+ | |||
+ | Without the **__quit__** you will come back to the MATLAB prompt on completion for a interactive job. If this is the last line of a batch queue script, then the only difference will be the MATLAB prompt ''>>'' | ||
+ | </ | ||
==== Grid Engine script ==== | ==== Grid Engine script ==== | ||
Line 206: | Line 225: | ||
</ | </ | ||
- | <note warning> | + | <note warning> |
In this example you will need a license for the base Matlab, and the parallel toolbox needs one license. | In this example you will need a license for the base Matlab, and the parallel toolbox needs one license. | ||
Line 363: | Line 382: | ||
We have the correct Grid Engine options '' | We have the correct Grid Engine options '' | ||
- | [[clusters: | + | [[software: |
===== Batch parallel example ===== | ===== Batch parallel example ===== | ||
Line 411: | Line 430: | ||
===== Interactive example ===== | ===== Interactive example ===== | ||
- | The basic steps to running a [[: | + | This example is based on being in your workgroup environment, |
- | + | ||
- | This demo starts in your MATLAB directory and with and active workgroup. | + | |
- | + | ||
==== Scheduling exclusive interactive job ==== | ==== Scheduling exclusive interactive job ==== | ||