Difference between revisions of "Matlab"

From IBERS Bioinformatics and HPC Wiki
Jump to: navigation, search
Line 9: Line 9:
 
In order to demonstrate this running, here is a simple two line hello world program written in matlab in a *.m file called hello.m. It is quite important to have the quit command when running matlab as a *.m file. Without it the program halts at the matlab commandline.
 
In order to demonstrate this running, here is a simple two line hello world program written in matlab in a *.m file called hello.m. It is quite important to have the quit command when running matlab as a *.m file. Without it the program halts at the matlab commandline.
  
   [mjv08@bert ~]$ cat hello.m  
+
   [user@bert ~]$ cat hello.m  
 
   fprintf ( 1, '  Hello, IBERS!\n' );
 
   fprintf ( 1, '  Hello, IBERS!\n' );
 
   quit
 
   quit
Line 21: Line 21:
 
  #specify which queue you wish to use
 
  #specify which queue you wish to use
 
  #$ -q large.q
 
  #$ -q large.q
  #$ -l h_vmem=16G
+
#specify some memory
 +
  #$ -l h_vmem=4G
 
  #load the module
 
  #load the module
 
  module load matlab/r2013a_node001
 
  module load matlab/r2013a_node001
 
  #run the program (NOTE the absence of the .m)
 
  #run the program (NOTE the absence of the .m)
 
  matlab -r hello
 
  matlab -r hello

Revision as of 11:43, 16 July 2013

Matlab

Currently we have a license to run matlab on one node. If there is a high demand for this facility then we will look into aquiring more licenses.

The license runs on node001, which is the large memory node, accessible via the large.q in SGE.

NOTE: This license only allows one user at a time to use the license on this node.

In order to demonstrate this running, here is a simple two line hello world program written in matlab in a *.m file called hello.m. It is quite important to have the quit command when running matlab as a *.m file. Without it the program halts at the matlab commandline.

 [user@bert ~]$ cat hello.m 
 fprintf ( 1, '  Hello, IBERS!\n' );
 quit

So, with this matlab program in mind, we have the following SGE script.

#specify the shell type
#$ -S /bin/sh
#run in the current working directory
#$ -cwd
#specify which queue you wish to use
#$ -q large.q
#specify some memory
#$ -l h_vmem=4G
#load the module
module load matlab/r2013a_node001
#run the program (NOTE the absence of the .m)
matlab -r hello