微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Orca 和 OpenMPI 的并行作业问题

如何解决Orca 和 OpenMPI 的并行作业问题

向社区问好:

我最近开始使用 ORCA 软件进行一些量子计算,但在我大学的集群中进行并行计算时遇到了很多问题。

为了安装 Orca,我使用了静态版本: orca_4_2_1_linux_x86-64_openmpi314.tar.xz。 在集群的共享方向(/data/shared/opt/ORCA/)。 并放入我的~/.bash_profile

export PATH="/data/shared/opt/ORCA/orca_4_2_1_linux_x86-64_openmpi314:$PATH"
export LD_LIBRARY_PATH="/data/shared/opt/ORCA/orca_4_2_1_linux_x86-64_openmpi314:$LD_LIBRARY_PATH"

用于安装对应的OpenMPI版本(3.1.4

tar -xvf openmpi-3.1.4.tar.gz
cd openmpi-3.1.4
./configure --prefix="/data/shared/opt/ORCA/openmpi314/"
make -j 10
make install

当我使用前端服务器时一切都很棒: 像这样的 .sh:

#! /bin/bash
export PATH="/data/shared/opt/ORCA/openmpi314/bin:$PATH"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/data/shared/opt/ORCA/openmpi314/lib"
$(which orca) test.inp > test.out

和这样的输入:

# computation of myjob at b3lyp/6-31+G(d,p)
%pal nprocs 10 end
%maxcore 8192

! RKS B3LYP 6-31+G(d,p)
! TightSCF Grid5 NoFinalGrid
! Opt
! Freq
%cpcm 
    smd true
    Smdsolvent "water"
end

* xyz 0 1
C 0 0 0
O 0 0 1.5
*

使用节点时出现问题:

.inp 文件

#! computation at RKS B3LYP/6-31+G(d,p) for cis1_bh267_m_Cell_152
%pal nprocs 12 end
%maxcore 8192

! RKS B3LYP 6-31+G(d,p)
! TightSCF Grid5 NoFinalGrid
! Opt
! Freq
%cpcm 
    smd true
    Smdsolvent "water"
end

* xyz 0 1
 C  -4.38728130   0.21799058   0.17853303
 C  -3.02072869   0.82609890  -0.29733316
 F  -2.96869122   2.10937041   0.07179384
 F  -3.01136328   0.87651596  -1.63230798
 C  -1.82118365   0.05327804   0.23420220
 O  -2.26240947  -0.92805650   1.01540713
 C  -0.53557484   0.33394113  -0.05236121
 C   0.54692198  -0.46942807   0.50027196
 O   0.31128292  -1.43114232   1.22440290
 C   1.93990391  -0.12927675   0.16510948
 C   2.87355011  -1.15536140  -0.00858832
 C   4.18738231  -0.82592189  -0.32880964
 C   4.53045856   0.52514329  -0.45102225
 N   3.63662927   1.52101319  -0.26705841
 C   2.36381718   1.20228695   0.03146190
 F  -4.51788749   0.24084604   1.49796862
 F  -4.53935644  -1.04617745  -0.19111502
 F  -5.43718443   0.87033190  -0.30564680
 H  -1.46980819  -1.48461498   1.39034280
 H  -0.26291843   1.15748249  -0.71875720
 H   2.57132559  -2.20300864   0.10283592
 H   4.93858460  -1.60267627  -0.48060140
 H   5.55483009   0.83859415  -0.70271364
 H   1.67507560   2.05019549   0.17738396
*

.sh 文件Slurm 作业):

#!/bin/bash
#SBATCH -p deflt #which partition I want
#SBATCH -o cis1_bh267_m_Cell_152_myjob.out #path for the slurm output
#SBATCH -e cis1_bh267_m_Cell_152_myjob.err #path for the slurm error output
#SBATCH -c 12 #number of cpu(logical cores)/task (task is normally an MPI process,default is one and the option to change it is -n)
#SBATCH -t 2-00:00 #how many time I want the resources (this impacts the job priority as well)
#SBATCH --job-name=cis1_bh267_m_Cell_152 #(to recognize your jobs when checking them with "squeue -u USERID")
#SBATCH -N 1 #number of node,usually 1 when no parallelization over nodes
#SBATCH --nice=0 #lowering your priority if >0
#SBATCH --gpus=0 #number of gpu you want

# This block is echoing some SLURM variables
echo "Jobid = $SLURM_JOBID"
echo "Host = $SLURM_JOB_NODELIST"
echo "Jobname = $SLURM_JOB_NAME"
echo "Subcwd = $SLURM_SUBMIT_DIR"
echo "SLURM_cpuS_PER_TASK = $SLURM_cpuS_PER_TASK"

# This block is for the execution of the program
export PATH="/data/shared/opt/ORCA/openmpi314/bin:$PATH"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/data/shared/opt/ORCA/openmpi314/lib"
$(which orca) ${SLURM_JOB_NAME}.inp > ${SLURM_JOB_NAME}.log --use-hwthread-cpus

我建议使用 --use-hwthread-cpus 标志,但无论是否使用此标志,都会出现相同的问题。 所有的错误是:

系统中没有足够的可用插槽来满足应用程序请求的 12 个插槽:/data/shared/opt/ORCA/orca_4_2_1_linux_x86-64_openmpi314/orca_gtoint_mpi

要么为您的应用程序请求更少的插槽,要么提供更多可用的插槽。 “插槽”是 Open MPI 术语,用于表示我们可以在其中启动进程的可分配单元。可用插槽的数量由运行 Open MPI 进程的环境定义:

1.主机文件,通过“slots=N”子句(如果未提供,N 认为处理器内核数)

2. --host 命令行参数,通过主机名上的“:N”后缀(如果未提供,N 认为 1)

3.资源管理器(例如 SLURM、PBS/Torque、LSF 等)

4.如果主机文件、--host 命令行参数或 RM 都不存在,则 Open MPI 认为处理器内核数 在上述所有情况下,如果您希望 Open MPI 认为处理器内核数 硬件线程数而不是处理器内核数,请使用 --use-hwthread-cpus 选项。

或者,您可以使用 --oversubscribe 选项在决定要启动的进程数量时忽略可用槽的数量

*[文件 orca_tools/qcmsg.cpp,第 458 行]:

.... 中止运行*

当我转到计算的输出时,它看起来像是开始运行,但在启动时并行作业失败并给出:

ORCA 因 GTOInt 中的错误终止而完成 调用命令:mpirun -np 12 --use-hwthread-cpus /data/shared/opt/ORCA/orca_4_2_1_linux_x86-64_openmpi314/orca_gtoint_mpi cis1_bh267_m_Cell_448.int.tmp cis1_bh26 [文件 orca_tools/qcmsg.cpp,第 458 行]: .... 中止运行

我们在集群上有两种节点: 其中一拳是:

至强 6 核 E-2136 @ 3.30GHz(12 个逻辑核心)和 Nvidia GTX 1070Ti

还有其他的:

AMD Epyc 24 核(24 个逻辑核)和 4x Nvidia RTX 2080Ti 使用命令scontrol show node,每组一个节点的详细信息为:

第一组:

NodeName=fang1 Arch=x86_64 CoresPerSocket=6
cpuAlloc=12 cpuTot=12 cpuLoad=12.00
AvailableFeatures=(null)
ActiveFeatures=(null)
Gres=gpu:gtx1070ti:1
NodeAddr=fang1 NodeHostName=fang1 Version=19.05.5
OS=Linux 5.7.12-arch1-1 #1 SMP PREEMPT Fri,31 Jul 2020 17:38:22 +0000
RealMemory=15923 Allocmem=0 FreeMem=171 Sockets=1 Boards=1
State=ALLOCATED ThreadsPerCore=2 Tmpdisk=7961 Weight=1 Owner=N/A MCS_label=N/A
Partitions=deflt,debug,long
Boottime=2020-10-27T09:56:18 SlurmdstartTime=2020-10-27T15:33:51
CfgTRES=cpu=12,mem=15923M,billing=12,gres/gpu=1,gres/gpu:gtx1070ti=1
AllocTRES=cpu=12,gres/gpu:gtx1070ti=1
CapWatts=n/a
CurrentWatts=0 AveWatts=0
ExtSensorsJoules=n/s ExtSensorsWatts=0 ExtSensorstemp=n/s

第二组

NodeName=fang50 Arch=x86_64 CoresPerSocket=24
cpuAlloc=48 cpuTot=48 cpuLoad=48.00
AvailableFeatures=(null)
ActiveFeatures=(null)
Gres=gpu:rtx2080ti:4
NodeAddr=fang50 NodeHostName=fang50 Version=19.05.5
OS=Linux 5.7.12-arch1-1 #1 SMP PREEMPT Fri,31 Jul 2020 17:38:22 +0000
RealMemory=64245 Allocmem=0 FreeMem=807 Sockets=1 Boards=1
State=ALLOCATED ThreadsPerCore=2 Tmpdisk=32122 Weight=1 Owner=N/A MCS_label=N/A
Partitions=deflt,long
Boottime=2020-12-15T10:09:43 SlurmdstartTime=2020-12-15T10:14:17
CfgTRES=cpu=48,mem=64245M,billing=48,gres/gpu=4,gres/gpu:rtx2080ti=4
AllocTRES=cpu=48,gres/gpu:rtx2080ti=4
CapWatts=n/a
CurrentWatts=0 AveWatts=0
ExtSensorsJoules=n/s ExtSensorsWatts=0 ExtSensorstemp=n/s

我在 Slurm 的脚本中使用了标志 -c,--cpus-per-task = integer;并在 Orca 的输入中输入命令 %pal nprocs integer end。我测试了这两个参数的不同组合,以查看我使用的 cpu 是否比可用的多:

-c,--cpus-per-task = 整数 %pal nprocs 整数结尾
6
3
2
1 2
1 12
2 6
3 4
12 12

具有不同数量的内存:8000 MBi 和 2000 MBi(我的总内存约为 15 GBi)。并且在所有情况下出现相同的错误。我不是 ORCA 非信息学领域的专家用户(但也许你猜这是为了扩展问题),所以也许解决方案很简单,但我真的没有它,我不知道发生了什么!

非常感谢,

亚历杭德罗。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。