Child pages
  • Hyak MATLAB programming

Versions Compared

Key

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

...

ssh -X abc@mox.hyak.uw.edu

srun -p xyz -A xyz --nodes=1 --ntasks-per-node=28  --time=2:00:00 --mem=100G --pty /bin/bash

...

(If your run parpool without giving the number of cores, then the default number of cores is 12. It is not the number of cores on the machine.

numCores above is the number of cores allocated to your job by slurm)


For scripting:

Below xyz is your group name and abc is your userid.

...

The file trypar.m contains below code. A semicolon after a matlab command means that matlab will not print the output of that command. (For the most common type of nodes on mox, numcores=28 . For mox nodes from 2019 or later, numcores=32. For ikt nodes, numcores=16.)assuming you had access to this node model type and needed the entire node. The argument should match what you request in your job for core count.


% create a local cluster object

...

numCores = feature('numcores');

parpool(numCores);

parfor i=1:1000000
A(i)=i*i;
end
A
quit

...