Windows 基于 WorkBench 19.0 下的 AUTODYN 并行计算

本文基于 Windows7 系统,ANSYS19.0 和内置的 AUTODYN 求解器,设置 AUTODYN 并行计算。要建立并行环境,必须按照 ANSYS 中提供的 IBM MPI 安装说明,在集群中的每台计算机上安装 IBM MPI。因为要运行 mpirun 的缘故,无论是多台电脑还是只有一台电脑上并行运算 AUTODYN,都需要安装 MPI。下面简单介绍一下 AUTODYN 并行计算的设置方案。

1. AUTODYNV19.0 并行计算

1.1 MPI 并行运行 AUTODYN

To establish the parallel environment IBM MPI must be installed on each machine in the cluster, following the installation instructions for IBM MPI as provided in Setting up Distributed ANSYS. Users may find it necessary to set the MPI password on each machine in their cluster. To do this they can call mpirun with the -cache argument the first time they run mpirun, entering their user password when prompted. This argument should be removed for subsequent parallel runs.

要建立并行环境,必须按照 ANSYS 中提供的 IBM MPI 安装说明,在集群中的每台计算机上安装 IBM MPI。用户可能会发现有必要在其群集中的每台计算机上设置 MPI 密码。要做到这一点,他们可以在第一次运行 mpirun 时使用 -cache 参数调用 mpirun,在提示时输入用户密码。对于后续并行运行,应删除此参数

Note:  The recommended method of running an AUTODYN job using IBM MPI is by using the AUTODYNWRAPPER.exefile, which is described in Running AUTODYN on Windows Platforms. The following is an alternative method of starting an AUTODYN parallel job using IBM MPI. This method gives you the ability to add other IBM MPI options that are not supported by AUTODYNWRAPPER.exe.When IBM MPI is installed using the ANSYS installer, it will install IBM MPI version 9.1.4.3. The installer will set MPI_ROOT to point to this version and will add MPI_ROOT\bin to the path environment variable.

注意:推荐 IBM MPI 并行计算时使用 AutodynWrapper.exe 运行包,该运行包设计用于 Windows 平台并行计算。当使用 ANSYS 安装包安装 IBM MPI V9.1.4.3 并行计算工具后,安装包会修改 MPI 运行环境,其中环境变量 MPI_ROOT 指向 MPI 安装目录下的 bin 文件夹。下文梳理详细过程。

attachments-2019-10-T34b2fjf5dba41de1e75c.png

1.2 安装 IBM MPI

无论是多台电脑还是只有一台电脑上并行运算 AUTODYN,都需要安装 MPI,这是 mpirun 能够正常运行的前提。安装 MPI 可以直接基于 ANSYS19.0 的安装包安装,也可以通过第三方网站安装 MPI 软件包,常见的为 Intel_MPI,学生用户可以按年申请免费试用。可以在系统中查找已安装的 Platform_MPI。

attachments-2019-10-B5ae0ua65dba41f3cba38.png

attachments-2019-10-gEhvNshV5dba42009e255.png

1.3 配置系统环境

mpirun 要能运行,需要设置运行环境,在系统 path 中指向 platform 的 MPIRUN.exe 和 autodyn.exe 的路径,注意使用英文半角符“;”间隔开,如果安装了 platform 就用新装的,一样,需要重启电脑。

PATH=C:\ProgramFiles\ANSYSInc\v190\commonfiles\MPI\IBM\9.1.4.3\winx64\bin;C:\ProgramFiles\ANSYS Inc\v190\aisol\AUTODYN\winx64

调试 MPI 运行,在命令提示符后输入 mpirun,运行成功表示安装完成,Win10 的,需要 mpiexec,然后命令提示符:输入 mpiexec,可以运行了

1.4 创建 applfile 文件

applfile 的文件路径在 C:\Users\\AppData\Roaming\ANSYS\v190\AUTODYN,其中替换为自己的计算机名字,在文件中输入一下内容。

-e MPI_FLAGS=y0 -e ANSYS_EXD_MPI_TYPE=ibmmpi -h machine1 -np 1 "C:\Program Files\ANSYS Inc\v190\AISOL\AUTODYN\winx64\autodyn.exe"
-h machine1  -np 2 "C:\Program Files\ANSYS Inc\v190\AISOL\AUTODYN\winx64\adslave.exe" 
-h machine2  -np 2 "C:\Program Files\ANSYS Inc\v190\AISOL\AUTODYN\winx64\adslave.exe"

其中,计算机名称和安装路径需要替换为自己的实际计算机名称和软件安装路径,machine1 修改为自己的计算机名字,如果安装时保持默认的安装路径,则可以保持不变。

下面为 2 核并行实例:

-e MPI_FLAGS=y0 -h liushiguo2000 -np 1 "F:\Program Files\ANSYSInc\v145\AISOL\AUTODYN\winx64\autodyn.exe"
-h liushiguo2000 -np 2 "F:\Program Files\ANSYS Inc\v145\AISOL\AUTODYN\winx64\adslave.exe"

注意,这里也可以不输入

-e ANSYS_EXD_MPI_TYPE=ibmmpi

删除。txt 文件后缀;并行计算可以设置多台机器,每台机器的名字不同,如图所示 machine3、machine4、machine5、machine6……,每个都有 2 个从处理器;该文件表示的并行计算含义为一个从机器,计算过程使用 2 核,下图的 12 个从机器,就一共使用了 24 核并行。主机器的 1 个核不考虑,当然从机器也可以从 2 核改为 4 核计算。

attachments-2019-10-t5N0RFUU5dba424b05a69.png

最终并行计算实例:

-e MPI_FLAGS=y0 -h lsg-PC -np 1 "C:\Program Files\ANSYS Inc\v190\AISOL\AUTODYN\winx64\autodyn.exe"-h lsg-PC  -np 4 "C:\Program Files\ANSYS Inc\v190\AISOL\AUTODYN\winx64\adslave.exe"-e MPI_FLAGS=y0 -h lsg-PC -np 1 "C:\Program Files\ANSYS Inc\v190\AISOL\AUTODYN\winx64\autodyn.exe"-h lsg-PC 
-np8 "C:\Program Files\ANSYS Inc\v190\AISOL\AUTODYN\winx64\adslave.exe"

attachments-2019-10-lRDEWoo85dba427dce902.png

attachments-2019-10-KvrjRV8R5dba42968c521.png

1.5 创建 AUTODYN_mpi.bat 文件

To start AUTODYN, you could call mpirun from a command prompt, but we suggest that you create a batch file in the same application data directory as the applfile file and execute that. For example, create a blank file called AUTODYN_mpi.bat. In this file enter:

虽然可以使用命令符窗口运行 AUTODYN 并行计算,但是使用起来仍然不方便,建议使用批处理文件进行并行计算,该过程只需创建一个 bat 格式的批处理文件,然后将 bat 文件放在和 applfile 文件、程序运行包同一目录下,例如创建一个新的 AUTODYN_mpi.bat 文件,在文件中输入如下内容。

  • 发表于 · 2019.10.31 10:02 · 阅读 · 7802

[版权声明] :本文文字、代码及图片版权归原作者所有,任何媒体、网站或个人未经本网协议授权不得采集、整理、转载或以其他方式复制发表。已经本站协议授权的媒体、网站,在使用时必须注明“稿件来源:学研谷”。

4 条评论

请先 登录 后评论
猜猜我是谁
哭泣的耳朵 -硕士

20
提问
55
回答
4
文章
注册推广