运行和验证
单节点
- 使用PuTTY工具,以root用户登录服务器。
- 执行以下命令创建工作目录并将算例文件上传。
mkdir -p path/to/CASE
- 执行以下命令解压算例文件。
tar xvf water_GMX50_bare.tar.gz
- 执行以下命令进入解压后的目录。
cd water-cut1.0_GMX50_bare/0768
- 执行以下命令生成topol.tpr文件。
gmx_mpi grompp -f pme.mdp
- 执行以下命令查看是否生成topol.tpr文件。
ll topol.tpr
-rw-r--r-- 1 root root 18448672 Jan 11 16:41 topol.tpr
- 执行以下命令进行运行。
mpirun --allow-run-as-root --mca btl ^openib -np 24 -x OMP_NUM_THREADS=4 gmx_mpi mdrun -dlb yes -v -nsteps 10000 -resethway -noconfout -pin on -ntomp 4 -s topol.tpr
np为MPI进程数量,如果没有开启超线程技术,MPI进程数乘以OMP线程数应该小于等于CPU核数,例如命令中MPI进程数24乘以OMP线程数4应该小于等于环境上CPU核数。
需要查看日志文件md.log中的“Performance”中的“ns/day”数值,单位是“ns/ day”,数值越高性能越优。
测试结果样例如下所示。
Part of the total run time spent waiting due to load imbalance: 1.1%. Steps where the load balancing was limited by -rdd, -rcon and/or -dds: X 0 % Y 0 % Average PME mesh/force load: 1.033 Part of the total run time spent waiting due to PP/PME imbalance: 2.1 % Core t (s) Wall t (s) (%) Time: 14806.100 154.231 9600.0 (ns/day) (hour/ns) Performance: 5.603 4.283 GROMACS reminds you: "Come on boys, Let's push it hard" (P.J. Harvey)
双节点
- 使用PuTTY工具,以root用户登录服务器。
- 执行以下命令创建工作目录并将算例文件上传。
mkdir -p path/to/CASE
- 执行以下命令解压算例文件。
tar xvf water_GMX50_bare.tar.gz
- 执行以下命令进入解压后的目录。
cd water-cut1.0_GMX50_bare/0768
- 执行以下命令创建“host”文件。
vi host
hostname1 hostname2
hostname1和hostname2为双节点的主机名。
- 执行以下命令进行运行。
mpirun --allow-run-as-root --hostfile host --mca btl ^openib -np 48 -N 24 -x OMP_NUM_THREADS=4 -x PATH=$PATH -x LD_LIBRARY_PATH=$LD_LIBRARY_PATH gmx_mpi mdrun -dlb yes -v -nsteps 10000 -resethway -noconfout -pin on -ntomp 4 -s topol.tpr
表1 参数说明 参数
说明
--hostfile
使用的节点文件。
-np
MPI运行的总进程数。
-N
每个节点上运行的进程数。
- 若没有开启超线程技术,MPI进程数乘以OMP线程数应该小于等于CPU核数。此处例子为双节点np为48,N为各个节点的进程数量,OMP_NUM_THREADS线程数为4,使用CPU核数为2*24*4=192核。
- 算例文件应存储在共享目录下,PATH与LD_LIBRARY_PATH变量应与配置编译环境编译配置中一样。
需要查看日志文件md.log中的“Performance”中的“ns/day”数值,单位是“ns/ day”,数值越高性能越优。
测试结果样例如下所示。
Part of the total run time spent waiting due to load imbalance: 1.3%. Steps where the load balancing was limited by -rdd, -rcon and/or -dds: X 0 % Y 0 % Average PME mesh/force load: 1.017 Part of the total run time spent waiting due to PP/PME imbalance: 2.2 % Core t (s) Wall t (s) (%) Time: 13667.657 71.196 19197.2 (ns/day) (hour/ns) Performance: 11.603 1.965 GROMACS reminds you: "Come on boys, Let's push it hard" (P.J. Harvey)