Skip to content

jguillon/smatlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

smatlab

Author: Jeremy GUILLON
Contact: jeremy.guillon@inria.fr
Date: February 26th, 2016
Version: 1.0

Introduction

This project aims at providing a simple and efficient way to execute MATLAB® scripts on a cluster managed by Slurm.

Installation

SSH to cluster

ssh [USERNAME]@[CLUSTER_HOSTNAME]

Download smatlab tool

Download this project in the desired DIRECTORY, if none is specified, the following command will download it in ./smatlab.

git clone https://github.com/jguillon/smatlab.git [DIRECTORY]

Define PATH environment variable

Add smatlab directory to the path. For that, edit your ~/.bashrc file using the following command:

vim ~/.bashrc

And add the following line:

export PATH=path/to/smatlab/directory:${PATH}

Getting Started

Basic usage

Basic usage of smatlab consists in submitting one single job to Slurm. It can be done like this:

smatlab path/to/your/matlab/script.m

where script.m can be any MATLAB® script.

Be aware that MATLAB® will add the path to your script to its path. Functions or scripts that are outside your script path have to be managed properly (i.e. you have to make them accessible by your script).

Run smatlab examples/simple_script.m for example.

MATLAB® parralel computing

When your script contains a parfor statement or any command of the Parallel Computing Toolbox, you can run it with a specification on the number of CPUs you need. For example, the following command will submit one job (with one task) to Slurm, but MATLAB® will be able to execute code on 12 different CPUs (maximum) at the same time.

smatlab --cpus-per-task=12 path/to/your/matlab/script.m

Run smatlab --cpus-per-task=12 examples/parralel_script.m for example.

Slurm parralel computing

smatlab --job-array=1:200 path/to/your/matlab/script.m

Run smatlab --job-array=1:200 examples/ultimate_script.m for example or smatlab --job-array=1:200 --cpus-per-task=12 examples/ultimate_script.m for even more magic.

About

Submit MATLAB scripts as jobs to Slurm in one command line.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages