Changes between Version 5 and Version 6 of cypress/Matlab


Ignore:
Timestamp:
Sep 22, 2015 4:40:21 PM (6 years ago)
Author:
cmaggio
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • cypress/Matlab

    v5 v6  
    211211fprintf('Real Time = %f(sec)\n',realT);
    212212}}}
     213
     214== Compiled Matlab ==
     215=== Compiling Matlab Scripts using mcc ===
     216Start an interactive session with idev, load the intel-psxe module (if you want to use mkl and multithreading), load the matlab module
     217
     218{{{
     219[tulaneID@cypress1 ~]$ idev
     220Requesting 1 node(s)  task(s) to normal queue of defq partition
     2211 task(s)/node, 20 cpu(s)/task, 2 MIC device(s)/node
     222Time: 0 (hr) 60 (min).
     223Submitted batch job 80102
     224JOBID=80102 begin on cypress01-036
     225--> Creating interactive terminal session (login) on node cypress01-036.
     226--> You have 0 (hr) 60 (min).
     227--> Assigned Host List : /tmp/idev_nodes_file_tulaneID
     228Last login: Tue Sep 22 16:27:39 2015 from cypress1.cm.cluster
     229[tulaneID@cypress01-036 ~]$ module load intel-psxe
     230[tulaneID@cypress01-036 ~]$ module load matlab
     231[tulaneID@cypress01-036 ~]$
     232}}}
     233
     234cd to the directory containing your matlab file and compile using matlabs C compiler {{{mcc -m <your matlab .m file>}}}. If your script is spread over many files you need to specify the directories containing those files {{{mcc -m -I <source directory> <your matlab .m file>}}}. For example, to compile my_script.m which depends on other .m files located in /home/tulaneID/myMatlab I would run
     235{{{
     236mcc -m -I /home/tulaneID/myMatlab my_script.m
     237}}}
     238This will compile files that my_script.m depends upon provided they are in /home/tulaneID/myMatlab
     239
     240=== Executing Compiled scripts ===
     241The above will create a binary executable named my_script. To run the executable as a SLRUM Job, just include the matlab module in your SLURM script. This will provide all the necessary libraries. For example,
     242{{{#!bash
     243#!/bin/bash
     244#SBATCH --qos=normal                    # Quality of Service
     245#SBATCH --job-name=my_script            # Job Name
     246#SBATCH --time=1-0:00:00                # WallTime
     247#SBATCH --nodes=1                       # Number of Nodes
     248#SBATCH --ntasks-per-node=1             # Number of tasks (MPI processes)
     249#SBATCH --cpus-per-task=1               # Number of threads per task (OMP threads)
     250
     251module load matlab
     252
     253./my_script
     254}}}