Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the parallel tutorial of Lammps molecular dynamics software MPI

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Lammps molecular dynamics software MPI parallel tutorial is what, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can get something.

Brief introduction

LAMMPS is a classical molecular dynamics simulation code designed to run efficiently on parallel computers. It was developed by Sandia National Laboratory (Sandia National Laboratories) under the U.S. Department of Energy. It is open source code and is freely distributed under the terms of the GNU Public license (GPL).

Github official website: https://github.com/lammps/lammps/tree/stable

Installation tutorial:

Required compiler suite: Intel Parallel Studio XE 2019

1. Required parallel libraries:

OpenMPI (Open Message Passing Interface,an open source High Performance Computing)

OpenMP (Open Multi-processing)

Second, prepare before compilation:

Download the source code from github (may be slow and can be accelerated by tools such as Thunderbolt):

Enter the lammps project directory and create a new build folder (see tutorials):

Cd lammpsmkdir buildcd build III. Preparation before Cmake:

It is known that version 3.10 of Cmake will encounter problems when looking for MPI installation directories and class libraries, and the solution is to use version 3.9.

~ / lammps_setup/cmake-3.9.0-Linux-x86_64/bin/

Configure the MPI class library environment variables (you can make good use of commands such as which mpi, whereis mpi, etc., to find out where the native MPI has been installed):

Export MPI_ROOT=/public/software/mpichexport PATH=$MPI_ROOT/bin:$PATHexport MPI_DIR=/public/software/mpich

Configure the INTEL compiler environment (you can make good use of commands such as which icc, whereis icc, etc., to find out where the INTEL has been installed on this machine):

Source / public/software/intel/composer_xe_2011_sp1.7.256/bin/iccvars.sh intel64source / public/software/intel/composer_xe_2011_sp1.7.256/bin/ifortvars.sh intel64

Run cmake with configuration options, pay attention to intel compiler path selection and c compiler modification (do not use gcc, use icc):

Cmake-DBUILD_MPI=yes-DBUILD_OMP=yes-DMPI_C_COMPILER=/public/software/intel/composer_xe_2011_sp1.7.256/bin/intel64/icc-DMPI_CXX_COMPILER=/public/software/intel/composer_xe_2011_sp1.7.256/bin/intel64/icpc.. / cmake

If you have any more questions, set the MPI path directly in cmake:

Source / public/software/intel/composer_xe_2011_sp1.7.256/bin/iccvars.sh intel64source / public/software/intel/composer_xe_2011_sp1.7.256/bin/ifortvars.sh intel64cmake-DBUILD_MPI=yes-DBUILD_OMP=yes-DMPI_C_COMPILER=/public/software/mpi/openmpi-16-intel/bin/mpicc-DMPI_CXX_COMPILER=/public/software/mpi/openmpi-16-intel/bin/mpicxx-DFFMPEG_EXECUTABLE=~/lammps_setup / ffmpeg-4.2-amd64-static/ffmpeg-DWITH_FFMPEG=yes-DCMAKE_CXX_COMPILER=/public/software/intel/composer_xe_2011_sp1.7.256/bin/intel64/icpc-DCMAKE_C_COMPILER=/public/software/intel/composer_xe_2011_sp1.7.256/bin/intel64/icc../cmake

Add additional packages (list of standard additional packages): assuming we need to add MOLECULE packages, we should add the following parameters after the cmake command

-DPKG_MOLECULE

As we can see, the format is-DPKG_ package name. The following provides the convenient code for one-click installation of the internal package:

-DPKG_COMPRESS=yes-DPKG_PYTHON=yes-DPKG_ASPHERE=yes-DPKG_BODY=yes-DPKG_CLASS2=yes-DPKG_COLLOID=yes-DPKG_CORESHELL=yes-DPKG_DIPOLE=yes-DPKG_GRANULAR=yes-DPKG_KSPACE=yes-DPKG_MANYBODY=yes-DPKG_MC=yes-DPKG_MISC=yes-DPKG_MOLECULE=yes-DPKG_MPIIO=yes-DPKG_OPT=yes-DPKG_PERI=yes-DPKG_QEQ=yes-DPKG_REPLICA=yes-DPKG_RIGID=yes-DPKG_SHOCK=yes-DPKG_SNAP=yes-DPKG_SPIN=yes-DPKG_SRD=yes-DPKG_MESSAGE=yes-DPKG_POEMS=yes

Additional packages that require dependencies such as a higher version of nvcc are listed below:

-DPKG_GPU=yes-DPKG_KOKKOS=yes

Problem solving:

Error: mpirun: error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory. The reason is that the compiler of intel is used, but the corresponding intel class library address is not added to the environment variable. In fact, intel has a very convenient source file, it can automatically add these class libraries, see this article (3)-3 "configure the INTEL compiler environment" (see Resources: https://zhidao.baidu.com/question/292886685.html)

Error-Could NOT find MPI_C (missing: MPI_C_WORKS)-Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)-Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND), but clearly MPI is installed and the MPI environment variable is configured. The reason is cmake's own problem, do not use too new cmake. Version 3.9 is used here to solve this problem perfectly. For more information, please see https://gitlab.kitware.com/cmake/cmake/issues/18570.

Use parallel commands but do not see the CPU core full: (similar problems include: why physical processors only 1, processors 11, 1 by 1 by 1) first of all, it is clear that as long as the-DBUILD_OMP-DBUILD_MPI is opened correctly when compiling, the compiled lmp executable must support MPI and OpenMP parallelism. The rest is the question of executing commands and procedures. Parallel execution commands cannot contain relocation identifiers

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 273

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report