Why did spmd create a pool of 12 workers on a cluster with 32 cores?

2 次查看(过去 30 天)
I am experiencing a problem with running Matlab code with spmd blocks on the cedar cluster on Compute Canada. I asked for 32 cores and 1 node being allocated to me. The system can detect 32 cores, but spmd can generate a pool of only 12 workers.
Can someone explain why? I am attaching both the Matlab file and the output file here.

采纳的回答

Kojiro Saito
Kojiro Saito 2021-7-16
In Parallel Preferences "Preferred number of workers" is set to 12 by default.
You can change this value to 100 (more than 32) in Preferences menu.
Alternatively, you can specify workers in parpool.
You can add parpool(num) before spmd blocks.
parpool(num)
spmd(num)
...
end
  4 个评论
Claire Fang
Claire Fang 2021-7-19
@Kojiro Saito, you are right. It is related. Apparently I needed to prepare a .matlab folder on the server. Instructions are shown on https://docs.computecanada.ca/wiki/MATLAB. Below is the code:
[name@cluster ~]$ cd $HOME
[name@cluster ~]$ if [ -d ".matlab" ]; then
mv .matlab scratch/
else
mkdir -p scratch/.matlab
fi && ln -sn scratch/.matlab .matlab
Once I did that, everything worked. Thanks!
Kojiro Saito
Kojiro Saito 2021-7-19
Usually, parpool will create a job directory, but in your universities clusters, home directory was set to read-only. I didn't know that, but I'm glad the issue is solved now.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by