在集群中使用虚拟化技术

五、singularity之MPI--在容器中使用amber的mpi(一)

2022-12-05 23:44:02 admin 109

MPI是一个跨语言的通讯协议,用于编写并行计算,主要是跨节点并行

(一)、singularity中使用mpi--amber,使用北极星环境中的amber

1、在 /lustre1等并行文件系统执行一下命令,在login06上执行

singularitybuild  --sandbox centos7.6_bjxenv_0    docker://bjxdockerfast:5000/centos7.6_bjxenv_0 

其他登陆节点:

singularitybuild  --sandbox centos7.6_bjxenv_0    docker://bjxdocker:5000/centos7.6_bjxenv_0 

具体见  二、使用北极星环境的镜像

2、加入北极星的环境

echo "source /appsnew/source/amber18-intel2019-cuda10.1.sh"  >>centos7.6_bjxenv_0/environment

3、复制测试文件

cp -rf /gpfs1/share/singularity/md9gpu/ .

4、进入测试文件夹

cd md9gpu

5、测试命令

source /appsnew/source/intel2019.sh

mpirun -n 2 singularityrun  -B  /appsnew,/apps   ../centos7.6_bjxenv_0    pmemd.MPI -O -i md.in  -o md1.out -p 1tcew.prmtop -c den.rst -r md1.rst -x md1.mdcrd 

注意:这里没有挂载gpfs文件系统,因为跑mpi的分区都没有挂载文件系统,其他如果出现找不到大量库的时候运行这个:

mpirun -n 2 singularityrun  -B /appsnew,/apps,/lustre1,/lustre2,/gpfs1,/lustre3,/usr,/lib64,/etc,/sys    pmemd.MPI -O -i md.in  -o md1.out -p 1tcew.prmtop -c den.rst -r md1.rst -x md1.mdcrd

蓝色部分为参数


图片关键词

测试完马上停掉 没有报错,按ctrl+c取消,报这些错误可以忽略。

6、提交任务

#编写提交脚本

1} cn_nl提交脚本

 vi job.srp

#!/bin/bash

#SBATCH -J sle232452

#SBATCH -p cn_nl

#SBATCH -N 4 

#SBATCH -o sle232452_%j.out

#SBATCH -e sle232452_%j.err

#SBATCH --no-requeue

#SBATCH -A gao_g1

#SBATCH --qos=gaocnnl

#SBATCH -n 28

source /appsnew/source/intel2019.sh

mpirun -n $SLURM_NTASKS  singularityrun -B  /appsnew,/apps ../chenfj/centos7.6_bjxenv_0   pmemd.MPI -O -i md.in  -o md1.out -p 1tcew.prmtop -c den.rst -r md1.rst -x md1.mdcrd

#注意:这里没有挂载gpfs文件系统,因为跑mpi的分区都没有挂载文件系统,其他如果出现找不到大量库的时候运行这个:

mpirun -n $SLURM_NTASKS  singularityrun --fakeroot  -B /appsnew,/apps,/lustre1,/lustre2,/gpfs1,/lustre3,/usr,/lib64,/etc,/sys   ../chenfj/centos7.6_bjxenv_0   pmemd.MPI -O -i md.in  -o md1.out -p 1tcew.prmtop -c den.rst -r md1.rst -x md1.mdcrd

蓝色部分是参数

#提交任务

[gao_pkuhpc@login06 md9gpu]$sbatch  job.srp 

Submitted batch job 16585623


2} cn-short提交脚本

 vi job.srp

#!/bin/bash

#SBATCH -J sle232452

#SBATCH -p cn-short

#SBATCH -N 2

#SBATCH -o sle232452_%j.out

#SBATCH -e sle232452_%j.err

#SBATCH --no-requeue

#SBATCH -A gao_g1

#SBATCH --qos=gaocns

#SBATCH --ntasks-per-node=20

source /appsnew/source/intel2019.sh

mpirun -n $SLURM_NTASKS  singularityrun -B  /appsnew,/apps ../chenfj/centos7.6_bjxenv_0   pmemd.MPI -O -i md.in  -o md1.out -p 1tcew.prmtop -c den.rst -r md1.rst -x md1.mdcrd

#注意:这里没有挂载gpfs文件系统,因为跑mpi的分区都没有挂载文件系统,其他如果出现找不到大量库的时候运行这个:

mpirun -n $SLURM_NTASKS  singularityrun --fakeroot  -B /appsnew,/apps,/lustre1,/lustre2,/gpfs1,/lustre3,/usr,/lib64,/etc,/sys   ../chenfj/centos7.6_bjxenv_0   pmemd.MPI -O -i md.in  -o md1.out -p 1tcew.prmtop -c den.rst -r md1.rst -x md1.mdcrd

蓝色部分是参数

#提交任务


[gao_pkuhpc@login06 md9gpu]$sbatch  job.srp 

Submitted batch job 16585623


7、与不使用容器的结果比较:

输出的的结果为 md1.out

可以用 tail -f md1.out 跟踪

如果需要重新跑,可以保留重命名md1.out 文件来比较

图片关键词

结果一致。


首页
资源&收费
集群
成果
问答