Matlab integrates mathematical computing, visualization, and a powerful language to provide a flexible environment for technical computing. The open architecture makes it easy to use MATLAB and its companion products to explore data, create algorithms, and create custom tools that provide early insights and competitive advantages. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Matlab Timeout
When your interactive MATLAB session has been idle for 4 hours or more you
will find MATLAB still open on your desktop. However, you will see
the following message displayed in the Command Window:
This does not mean your MATLAB session has closed or exited. It just means the licenses in use have been returned to the license server. To resume a timed-out MATLAB session, just start using MATLAB again. If a license key is available, MATLAB checks it out automatically. Likewise, as you use the toolboxes and other products that you had checked out, MATLAB obtains license keys for these products as well. If a license key is not available, MATLAB periodically attempts to check out a license, issuing warning messages. After 10 warnings, if a license key is still not available, MATLAB will save the workspace and exit. Submitting a single Matlab job
To submit Matlab scripts to the batch queue, first create a batch script file
(a csh or bash file) that contains any desired PBS options and the commands to
run Matlab non-interactively.
Sample file matlab.script #!/bin/bash # #PBS -N Matlab #PBS -m be #PBS -k oe date /usr/local/bin/matlab -nodesktop << EOF #starts Matlab a = 10; #Matlab commands b = 20; c = 30; d = sqrt((a + b + c)/pi); exit EOF #end of Matlab commands
This qsub command requests one Matlab license ('matlab=1'), so the job will
remain in the queue until a license is available. You will receive email when
the job is executed and when it ends, because of the line Passing parameters to a Matlab batch job
You can set up a batch script and pass parameters to the job at the time of submission. For example: #!/bin/bash # #PBS -N Matlab #PBS -m be #PBS -j oe date echo "a is $a, b is $b, c is $c"; matlab -nodesktop << EOF #starts Matlab d = sqrt(($a + $b + $c/pi)); d exit EOF #end of Matlab commands qsub -v a=10,b=20,c=30 -l nodes=1 matlab.bat The output from this Matlab process will go into the standard output for the job, a file called Matlab.o###### (where ##### is the job number) in the current working directory. Click here to see the output. Submitting a swarm of Matlab jobs
The swarm program is a convenient way to submit large numbers of jobs. You create a swarm command file containing a single line for each independent job. The swarm program will then package up the commands into batch jobs and submit them to the batch system. See the swarm page for more information. Create a swarm command file, named Sample Matlab swarm command file: /usr/local/bin/matlab -nodesktop < /data/user/run1.m /usr/local/bin/matlab -nodesktop < /data/user/run2.m /usr/local/bin/matlab -nodesktop < /data/user/run3.m [...] Submit this swarm command file
depending on which Matlab licenses (resources) are required. More information about Matlab resources is in the next section. Regardless of the number of commands in your swarm command file, you should always specify 'matlab=1' and never a larger number. Swarm will automatically request one Matlab license for each submitted job.Note that an unlimited number of jobs can be submitted to the queue, but the number that will actually run simultaneously depends on the per-user Matlab license limit, and the number of available licenses. The batch system will restrict the number of Matlab licenses that are allocated to an individual user. This limit is subject to change depending on the number of licenses and usage. Matlab resources (licenses)
The PBS Batch system on the Biowulf cluster keeps track of the Matlab licenses via the Matlab "resources". Jobs requiring a Matlab license will be started or remain in the queue depending on the availability of Matlab licenses. All Matlab jobs must therefore specify the appropriate resource when the job is submitted. For example, qsub -l nodes=1:g4,matlab=1 my_job_scripttells PBS that one Matlab license is required ('matlab=1'), as well as a node with 4Mb memory ('g4'). Similarly, a job that requires the Bioinformatics toolbox should be submitted as: qsub -l nodes=1,matlab=1,matlab-bio=1 my_job_script(Note that both a Matlab license and Bioinformatics Toolbox license is required). If using Matlab interactively, the same resources must be specified: biowulf% VERY IMPORTANT to exit the interactive shell as well as Matlab,
otherwise the batch system will not release the resource.
Total and free licenses, the resource name, and the per-user license limit can be seen by typing 'licenses' at the Biowulf prompt or by checking this webpage. The available toolboxes and corresponding resource names are also listed in the following table:
A '-' indicates that the toolbox is not licensed, and therefore no resource needs to be specified. Note that an unlimited number of jobs can be submitted to the queue, but they will run depending on the number of available licenses and the per-user license limit. Matlab Distrbuted (Parallel) Computing Toolbox
The Matlab Parallel Computing Toolbox enables you to develop distributed and parallel MATLAB applications and execute them on the cluster. The product also support parallel for loops and global array semantics via distributed arrays for creating parallel applications without explicit message passing.
See Distributed Matlab on Biowulf for examples on using the Distributed Computing Toolbox on biowulf. Matlab Compiler
The number of simultaneous Matlab jobs on the Biowulf cluster is limited by the number of Matlab licenses. An alternative is to compile your Matlab program using the Matlab compiler. Compiled programs do not require a Matlab license to run, so you can run a large number of simultaneous jobs. See Matlab compiler on Helix for details on how to use the compiler.
Since there is only one compiler license, and compilation can take a while, it may happen that the compiler license is not accessible at the time you want to compile. One way to avoid this problem is to submit your compilation as a batch job. The batch script would look something like this: #!/bin/bash # #PBS -N Matlab #PBS -m be #PBS -k oe cd /data/user/myprogs mcc -m matlab_file This script would be submitted with: qsub -l nodes=1,matlab-compiler=1 batchscript
The job will remain in the queue until a Matlab compiler license is available. You can check the status of the job with comment = Insufficient amount of server resource matlab-compiler Run the Matlab GUI interactively
If you simply log in to Biowulf and give the matlab command,
matlab will run on the main Biowulf login node. This is highly
discouraged because the login node has only 2 processors and is not intended
for running computational applications. Instead, to run matlab
interactively, you should allocate a node for interactive use and run on that
node, as described in the example below.
To run the biowulf% Failure to Launch
Desktop Class", cd to $HOME/.matlab and remove the directory R14
and try again.
You must use Xwindows software to connect to Biowulf if you want to use the Matlab GUI. For batch jobs, or for non-GUI interactive jobs, Xwindows is not required. <> Run Matlab interactively without the GUI
It is also possible to run Matlab interactively on the command-line, without the GUI. This would typically be useful only for debugging. Again, this should be done by allocating an interactive node. Example: biowulf%
Documentation
Run
Matlab in Batch mode on Unix MachinesMatlab's Search Results on Batch Batch Queuing System on Biowulf Matlab Help Matlab FAQ The Mathworks Homepage |