Matlab parfor on Slurm

조회 수: 26(최근 30일)
H H
H H 2020년 4월 3일
댓글: Raymond Norris 2020년 7월 4일
Hi All,
I want to run a parfor on matlab using Slurm job submission on the cluster.
I want to use 15 workers for the parfor. Each worker should calls an external executable program and runs it using a set of distinc parameters. The external program needs 1 CPU(core) for each run.
I know that inside matlab m file I should set the parpool to 15. My question is that which of these two sbach job submission configurations I should to submit the job:
#SBATCH --ntasks=15
#SBATCH --cpus-per-task=1
or
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=15
  댓글 수: 3
Raymond Norris
Raymond Norris 2020년 7월 4일
Hi,
In my experience, I would choose option #2, but keep in mind that the MATLAB client requires a CPU as well, so I would suggest --cpus-per-task=16.
However, you're also saying that each worker will call an external executable. Can the worker an executable it calls run on the same core? If not, perhaps you need 31?
1 (MATLAB) + 15 (workers) + 15 (executable program)
Raymond

댓글을 달려면 로그인하십시오.

답변(1개)

Jason Ross
Jason Ross 2020년 4월 10일
Note that you can specify these options as part of the ResourceTemplate property in the cluster (which would set this for every submission using the profile) or on the cluster object itself (which you could set on a per-job basis) for a Slurm cluster. See the "Slurm" section of the documentation here.
You can also set the Parallel Preferences to request 15 workers by default, or set the number of workers to 15 in the cluster profile.

태그

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by