LAMMPS在Windows下的安装及使用(2):并行版本的安装及配置


在《LAMMPS在Windows下的安装及使用》第一篇中我们已经讲了LAMMPS的安装及测试,在这篇文章中我们将进一步讲解并行版LAMMPS的配置。

    1. 点击MPICH2-1.4.1p1-win-x86-64,下载MPICH2并安装,注意默认安装路径为C:\Program Files\MPICH2

  1. 安装MPICH2后,可以使用MPICH2自带算例进行测试。打开cmd命令窗口进入到C:\Program Files\MPICH2\Examples目录,运行命令mpiexec -n 4 cpi.exe并回车。如果直接提示Enter the number of intervals: (0 quits),则表示MPICH2已经配置成功。
  2. 进入lmp算例目录 C:\Program Files\LAMMPS 64-bit 20160512\Examples\melt,执行命令 lmp_mpi -in in.melt。如果成功执行,则返回如下结果:


Microsoft Windows [版本 10.0.14393]

(c) 2016 Microsoft Corporation。保留所有权利。

C:\Users\Cun Zhang >cd “c:\Program Files\MPICH2\examples“

c:\Program Files\MPICH2\examples>mpiexec -n 4 cpi.exe
User credentials needed to launch processes:
account (domain\user) [CunZhang-PC\Cun Zhang]: 此处直接回车
password: 此处输入用户密码
Enter the number of intervals: (0 quits) 10
pi is approximately 3.1424259850010983, Error is 0.0008333314113051
wall clock time = 0.002056
Enter the number of intervals: (0 quits) 0

c:\Program Files\MPICH2\examples>cd “c:\Program Files\LAMMPS 64-bit 20160512\Examples\melt“

c:\Program Files\LAMMPS 64-bit 20160512\Examples\melt>mpiexec -n 4 lmp_mpi -in in.melt
WARNING on proc 0: Cannot open log.lammps for writing (../lammps.cpp:309)
LAMMPS (11 May 2016-ICMS) 成功执行。
WARNING: OMP_NUM_THREADS environment is not set. (../comm.cpp:90)
using 1 OpenMP thread(s) per MPI task
Lattice spacing in x,y,z = 1.6796 1.6796 1.6796
Created orthogonal box = (0 0 0) to (16.796 16.796 16.796)
1 by 2 by 2 MPI processor grid
Created 4000 atoms
Neighbor list info …
1 neighbor list requests
update every 20 steps, delay 0 steps, check no
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 2.8
ghost atom cutoff = 2.8
binsize = 1.4, bins = 12 12 12
Setting up Verlet run …
Unit style : lj
Current step : 0
Time step : 0.005
Memory usage per processor = 2.10344 Mbytes
Step Temp E_pair E_mol TotEng Press
0 3 -6.7733681 0 -2.2744931 -3.7033504
50 1.6754119 -4.7947589 0 -2.2822693 5.6615925
100 1.6503357 -4.756014 0 -2.2811293 5.8050524
150 1.6596605 -4.7699432 0 -2.2810749 5.7830138
200 1.6371874 -4.7365462 0 -2.2813789 5.9246674
250 1.6323462 -4.7292021 0 -2.2812949 5.9762238
Loop time of 0.3023 on 4 procs for 250 steps with 4000 atoms

Performance: 357261.291 tau/day, 826.994 timesteps/s
100.8% CPU use with 4 MPI tasks x 1 OpenMP threads

MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
—————————————————————
Pair | 0.22382 | 0.22849 | 0.23282 | 0.9 | 75.58
Neigh | 0.032358 | 0.032851 | 0.0333 | 0.2 | 10.87
Comm | 0.028673 | 0.033505 | 0.038658 | 2.3 | 11.08
Output | 0.00017705 | 0.00018806 | 0.00019544 | 0.1 | 0.06
Modify | 0.0044788 | 0.0045448 | 0.0045866 | 0.1 | 1.50
Other | | 0.00272 | | | 0.90

Nlocal: 1000 ave 1010 max 982 min
Histogram: 1 0 0 0 0 0 1 0 0 2
Nghost: 2703.75 ave 2713 max 2689 min
Histogram: 1 0 0 0 0 0 0 2 0 1
Neighs: 37915.5 ave 39239 max 36193 min
Histogram: 1 0 0 0 0 1 1 0 0 1

Total # of neighbors = 151662
Ave neighs/atom = 37.9155
Neighbor list builds = 12
Dangerous builds not checked
Total wall time: 0:00:00

c:\Program Files\LAMMPS 64-bit 20160512\Examples\melt>

重要提示:如果只是在Win下进行lmp脚本测试,而不需要在Win下做计算,不建议花费太多时间在MPICH2的安装上。

关于MPICH2的配置说明:
1.如果MPICH2运行失败,可执行如下命令:

smpd –install –phrase behappy
mpiexec –remove
mpiexec –register 此处输入Windows当前用户密码
mpiexec –validate 此处应该返回SUCCESS
smpd -status

2.如果仍然失败,请检查系统是否已经安装了其它版本的MPI程序并将其删除。

本文版权由石家庄朗普斯科技有限公司及其合作者所有,未经授权严禁用于商业用途丨如未注明,均为原创,转载请注明转自:http://lammps.cn/lammps%e5%9c%a8windows%e4%b8%8b%e7%9a%84%e5%ae%89%e8%a3%85%e5%8f%8a%e4%bd%bf%e7%94%a82%ef%bc%9a%e5%b9%b6%e8%a1%8c%e7%89%88%e6%9c%ac%e7%9a%84%e5%ae%89%e8%a3%85%e5%8f%8a%e9%85%8d%e7%bd%ae/

发表评论

电子邮件地址不会被公开。 必填项已用*标注