MATLAB
From FarmShare
(Difference between revisions)
Line 1: | Line 1: | ||
- | + | ==example single matlab file run via qsub== | |
- | + | Here's our helloworld.m: | |
+ | <pre> | ||
+ | disp('Hello World'); | ||
+ | </pre> | ||
- | + | Here's a command to run that. | |
+ | /afs/ir.stanford.edu/software/matlab-2011b/bin/matlab -nodesktop < helloworld.m | ||
- | + | We want to run this same command via the job scheduling system. Let's write a job script. | |
- | |||
- | |||
- | |||
<pre> | <pre> | ||
- | + | $ cat matlab_example.script | |
+ | #!/bin/bash | ||
- | + | #$ -N matlab_example | |
- | + | #$ -m bes | |
- | + | #$ -M chekh@stanford.edu | |
- | + | ||
- | + | /afs/ir.stanford.edu/software/matlab-2011b/bin/matlab -nodesktop < /afs/ir/users/c/h/chekh/helloworld.m | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
</pre> | </pre> | ||
- | + | Submit the script: | |
+ | qsub matlab_example.script | ||
- | + | Look at the job status: | |
- | + | qstat | |
- | + | You should get output files like matlab_example.script.eXXXXX and matlab_example.script.oXXXXX | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + |
Revision as of 13:36, 18 January 2012
example single matlab file run via qsub
Here's our helloworld.m:
disp('Hello World');
Here's a command to run that.
/afs/ir.stanford.edu/software/matlab-2011b/bin/matlab -nodesktop < helloworld.m
We want to run this same command via the job scheduling system. Let's write a job script.
$ cat matlab_example.script #!/bin/bash #$ -N matlab_example #$ -m bes #$ -M chekh@stanford.edu /afs/ir.stanford.edu/software/matlab-2011b/bin/matlab -nodesktop < /afs/ir/users/c/h/chekh/helloworld.m
Submit the script:
qsub matlab_example.script
Look at the job status:
qstat
You should get output files like matlab_example.script.eXXXXX and matlab_example.script.oXXXXX