shadow_tr

Using Matlab on the CCS cluster

  • If you don't already have one, obtain a CCS account (username). Let Keith know, so he can add you to the econ workgroup on the server.

  • Write your Matlab m-file (mymfile.m). Example:
  • n=20;
    m=100;
    A=randn(n,m);
    B=rand(n,m);
    save test A B;
    quit;


  • Write a script for the CCS queueing system (myscript.sh). Example:
  • #PBS -q econ_long
    #PBS -N mymfile
    #PBS -d /econ/username
    #PBS -l walltime=10:00:00
    #PBS -j oe
    #PBS -M username@tulane.edu
    #PBS -m abe
    #PBS -e stderr.txt
    #PBS -o stdlog.txt

    module load intel

    echo Start Job
    cd /econ/username
    date
    pwd
    matlab -nodisplay -nosplash < mymfile.m
    echo End Job

    This script requests that the contents be added to the econ_long queue. It will let the script run for up to 10 hours and send out an email when it begins, finishes, or aborts.


  • Upload your do-file and queue script to sphynx.ccs.tulane.edu using secure FTP (SFTP).
  • To do this, you need an FTP program, like Filezilla. The server address is sphynx.ccs.tulane.edu. Specify SFTP and use your CCS username and password. Once you login, change the directory to /econ/username. Then, upload mymfile.m and myscript.sh to that directory.


  • Login to sphynx.ccs.tulane.edu via SSH
  • To do this from Windows, you need an SSH terminal, like Putty. To do this from Mac OS, you can use the built-in Terminal. The server address is sphynx.ccs.tulane.edu. Specify SSH and use your CCS username and password. For example, in Terminal:

    username$ssh sphynx.ccs.tulane.edu
    username@sphynx.ccs.tulane.edu's password:
    username@sphynx>


  • Change directory to /econ/username.
  • username@login-02-01>cd /econ/username


  • Add your job to the PBS queue.
  • username@login-02-01>qsub myscript.sh
    jobid


  • Check the status of your job.
  • username@login-02-01>qstat


  • Check the status of the nodes. (The econ nodes are compute-01-200 through compute-01-204.)
  • username@login-02-01>qnodes


  • Kill your job if necessary.
  • username@login-02-01>qdel jobid


  • Other information about the queuing system can be found here.

Advanced Tips For Using Matlab on the CCS cluster

  • If your script for the CCS queueing system (myscript.sh) calls a Matlab function, drop the .m from the function call line in the script. Otherwise, if you are calling a Matlab script, include the .m in the function call line as is in the myscript.sh example above.
  • Specifying a Matlab version
  • There are multiple versions of Matlab installed on the CSS cluster and it is always a good idea to specify which version to use in your queueing script. Currently version 2008a, 2008b and 2009a are available. You might want to use version 2008a instead of 2009a if you need the Symbolic Toolbox with the Maple engine rather than the MU-Pad engine.

    To determine which versions of Matlab are available, login to sphynx.ccs.tulane.edu via SSH and login to the CCS ares cluster as described above.

    Change directories (cd) to /usr/local/opt/ and type ls to see the different programs installed.

    To use Matlab Release 2008a, modify the script for the CCS queueing system above (myscript.sh) to:

    #PBS -q econ_long
    #PBS -N mymfile
    #PBS -l walltime=10:00:00
    #PBS -j oe
    #PBS -M username@tulane.edu
    #PBS -m abe
    #PBS -e stderr.txt
    #PBS -o stdlog.txt

    echo Start Job
    cd /econ/username
    date
    pwd
    /usr/local/opt/matlabR2008a/bin/matlab -nodisplay -nosplash < mymfile.m
    echo End Job

    The idea is to refer to the specific Matlab binary you want to use.

  • Running a Job on the CCS cluster in Interactive Mode
  • Most of the time it is helpful to debug your Matlab function in interactive mode before submitting a large job. The proper way to obtain CCS cluster resources to run Matlab interactively is to use the following command:

    qsub -I -lnodes=1:noib:ppn=2

    You will need to wait for the job to start and then you can call the Matlab binary of your choice from the command line, and use Matlab from the terminal window. If you run Matlab interactively without first requesting proper resources from the queueing system, you run the risk of losing your account privledges.

206 Tilton Hall, Tulane University, New Orleans, LA 70118 tel 504-865-5321 fax 504-865-5869 pwatson@tulane.edu