Child pages
  • Distributed Matlab (using MPI)

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
% For Fram only (R2019a): Add link to MPI libraries
addpath('/cluster/software/MATLAB/2019a/NMPI/version13_intel2017b/');

% For Saga only (R2019a): Add link to MPI libraries
addpath('/cluster/software/MATLAB/2019a/NMPI/version13_intel2019a/');
 
% For Vilje only (R2017a):Add link to MPI Libraries 
addpath('/sw/sdev/Modules/matlab/R2017a/NMPI');

% For Idun cluster only (2019a):
addpath('/lustre1/apps/software/Core/MATLAB/2019a/NMPI/version13_intel17b');
 
parallel_start;

display(['Hello world from rank number ',num2str(my_rank),' of total ',num2str(num_ranks)]);

parallel_end;

...

Code Block
#!/bin/bash
#SBATCH --account=myaccount
#SBATCH --job-name=jobname
#SBATCH --time=0:30:0
#SBATCH --nodes=4
#SBATCH --ntasks-per-node=1
module purge
module load intel/2017b
module load MATLAB/2019a
module list

srun --mpi=pmi2 matlab -nodisplay -nodesktop -nojvm -r "myprogram"

SAGA

Code Block
#!/bin/bash
#SBATCH --account=myaccount
#SBATCH --job-name=jobname
#SBATCH --time=0:30:0
#SBATCH --nodes=4
#SBATCH --ntasks-per-node=1
module purge
module load intel/2019a
module load MATLAB/2019a
module list

srun --mpi=pmi2 matlab -nodisplay -nodesktop -nojvm -r "myprogram"


VILJE:

Code Block
#!/bin/bash
#  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#PBS -N job
#PBS -l walltime=00:30:00
#PBS -l select=4:ncpus=32:mpiprocs=1:ompthreads=16
#PBS -q workq
#PBS -A myaccount
 
cd $PBS_O_WORKDIR
module load gcc/4.9.1
module load mpt
module load matlab/R2017a

mpiexec_mpt -n 4 omplace -nt 16 matlab -nodisplay -nojvm -nodesktop -nosplash -r "myprogram"

...