英文:
HPC cluster : run a tool with multithread option
问题
请使用以下翻译的部分,不包括代码:
我对Slurm作业管理器还很陌生。我想运行ADMIXTURE工具,该工具有一个多线程运行的选项。我不太理解在我的sbatch脚本中需要指定哪个选项。这是我的代码:
#!/bin/bash -l
#SBATCH -A snic2022-22-1048
#SBATCH -p core
#SBATCH --mem-per-cpu=6400
#SBATCH -n 1
#SBATCH --cpus-per-task=8
#SBATCH -t 120:59:59
#SBATCH -J ADMIXTURE
for k in {2..16}
do
mkdir "admixk${k}"
for i in {1..10}
do
admixture --cv=10 -j8 merged_dataset_light.bed $k \
> admixk${k}/struct_k${k}_${i}.out
done
done
其中-j8
是指示我们使用8个线程运行工具的选项。ADMIXTURE的文档如下所示:
2.11 多线程模式
要将ADMIXTURE的工作分配给N个线程,您可以在ADMIXTURE命令中附加标志-jN
。核心算法将以最多N倍的速度运行,假设您至少有N个处理器。
然后我不知道我是否需要像我所做的那样指定
#SBATCH -n 1
#SBATCH --cpus-per-task=8
还是
#SBATCH -n 8
#SBATCH --cpus-per-task=1
你有什么想法吗?我看到这个答案说这取决于使用的并行类型,但在这种情况下我如何知道呢?
英文:
I'm new to the slurm job manager. I want to run the tool ADMIXTURE, which has an option to run in multithreaded mode. I don't really understand which option I have to specify in my sbatch script. This is my code :
#!/bin/bash -l
#SBATCH -A snic2022-22-1048
#SBATCH -p core
#SBATCH --mem-per-cpu=6400
#SBATCH -n 1
#SBATCH --cpus-per-task=8
#SBATCH -t 120:59:59
#SBATCH -J ADMIXTURE
for k in {2..16}
do
mkdir "admixk${k}"
for i in {1..10}
do
admixture --cv=10 -j8 merged_dataset_light.bed $k \
> admixk${k}/struct_k${k}_${i}.out
done
done
Where -j8
is the option which indicates that we want to run the tool with 8 threads. The documentation of ADMIXTURE says the following :
> 2.11 Multithreaded mode
>To split ADMIXTURE’s work among N threads, you may append the flag -jN to your
>ADMIXTURE command. The core algorithms will run up to N times as fast, presuming
>you have at least N processors.
I don't know then if I have to specify
#SBATCH -n 1
#SBATCH --cpus-per-task=8
like I did or
#SBATCH -n 8
#SBATCH --cpus-per-task=1
Do you have any idea of how I should do that ? I saw this answer that says it depends of which type of parallelism is used, but how can I know in this case ?
答案1
得分: 1
在这种情况下,您应该使用
#SBATCH -n 1
#SBATCH --cpus-per-task=8
使用其他选项,每个任务可能会分配到另一个节点上,显然不能与线程一起使用。
英文:
In this case you should use
#SBATCH -n 1
#SBATCH --cpus-per-task=8
With the other option each task may be allocated on another node, which obviously wouldn't work with threads.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论