slrum 在多个节点上运行一项作业
我有一个 R 脚本,它通过 parallel 和 future 包使用并行计算。在 R 脚本中设置并行配置的代码是:
cl <- parallel::makeCluster(100)
future::plan(cluster, workers=cl)
我正在 HPC 中运行 R 脚本,其中每个节点有 20 个 CPU。什么是 SLRUM 配置以将 R 脚本作为一项作业跨多个节点运行。会:
--cpus-per-task=100
足够了吗?
谢谢
I have an R script that use parallel computing via the parallel and future packages. The code to set the parallel configuration in the R script is:
cl <- parallel::makeCluster(100)
future::plan(cluster, workers=cl)
I am running the R script in HPC where each node have 20 CPU. What is SLRUM configuration to run the R script as one job across multiple nodes. will:
--cpus-per-task=100
be sufficient?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
默认情况下,如果您请求
N
个节点并启动M
个任务,slurm 会将 M 个任务分配到 N 个节点中。因此,如果您想跨 2 个节点启动 100 个任务,只需指定--nodes 2
和--ntasks 100
即可。这 100 个任务(您的 R 脚本将启动 100 次)将分布在 2 个节点上。但是,如果您只想启动 R 脚本两次(每个节点一次以利用共享内存,并在每个节点内为该单个任务分配 20 个 cpu),那么您可以执行
--nodes 2
<代码>--ntasks 2--cpus-per-task 20
。By default, if you request
N
nodes and launchM
tasks, the slurm will distribute the M tasks in N nodes. So, if you want to launch 100 tasks across 2 Nodes, you just need to specify--nodes 2
and--ntasks 100
. The 100 tasks (100 times your R script will be launched) will be spread across 2 Nodes.But, if you only want to launch your R script twice (one per each node to utilize shared memory and inside each node allocate 20 cpus for that single task) then you can do,
--nodes 2
--ntasks 2
--cpus-per-task 20
.阅读这篇帖子,我意识到我无法在多个节点上运行我的作业,因为它们不共享内存。
Reading this post, I realized that I can not run my job on multiple nodes since they do not share memory.