MATLAB

From FarmShare

(Difference between revisions)
Jump to: navigation, search
Line 29: Line 29:
Here are some training slides and example code that I copied from http://www.osc.edu/~samsi/sc11edu/
Here are some training slides and example code that I copied from http://www.osc.edu/~samsi/sc11edu/
* http://stanford.edu/~chekh/matlab.tar
* http://stanford.edu/~chekh/matlab.tar
 +
 +
==example single matlab file run==
 +
 +
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

Revision as of 16:43, 17 January 2012

We have a trial version of MATLAB Distributed Compute Server until 2011-12-25.

The standard MATLAB install in AFS now also has R2011b in addition to R2010b.

You will need to write your MATLAB code to use the Parallel Computing Toolbox before using the Distributed Computing Server.

Here's how to write a job using MDCS: http://docs.uabgrid.uab.edu/wiki/MatLab_CLI#Parallel_MATLAB

You can use the "maxNumCompThreads" command (deprecated) to see how many parallel threads you can run. I get "24" on barley, or "8" on corn.

simple PCT run

/afs/ir.stanford.edu/software/matlab-2011b/bin/matlab -nodesktop -r 'maxNumCompThreads'

>> matlabpool ( 'open', 'local', 8)
Starting matlabpool using the 'local' configuration ... connected to 8 labs.
>> 
>> matlabpool size

ans =

     8

Then use 'parfor' instead of 'for'.

matlabpool of size 0 and size 1 are effectively the same, except the latter uses a PCT toolbox license.

Here are some training slides and example code that I copied from http://www.osc.edu/~samsi/sc11edu/

example single matlab file run

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
Personal tools
Toolbox
LANGUAGES