Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| technical:recipes:gromacs-plumed [2024-05-12 14:46] – [Runtime environment] bkang | technical:recipes:gromacs-plumed [2024-05-12 15:03] (current) – [Scaling] bkang | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Building Gromacs-Plumed on Caviness/ | ||
| + | The build procedure outlined herein uses Open MPI on top of the Intel compiler suite. | ||
| + | |||
| + | ===== Directory Preparation ===== | ||
| + | |||
| + | To begin, choose a directory in which the Gromacs_Plumed version(s) will be built and installed. | ||
| + | <code bash> | ||
| + | [user@login00.darwin ~]$ GP_BASEDIR=~/ | ||
| + | [user@login00.darwin ~]$ G_BASEDIR=" | ||
| + | [user@login00.darwin ~]$ P_BASEDIR=" | ||
| + | [user@login00.darwin ~]$ GP_BASEDIR_PRIVS=0700 | ||
| + | </ | ||
| + | If you are managing Gromacs_Plumed software for your entire workgroup, you could instead use | ||
| + | <code bash> | ||
| + | [user@login00.darwin ~]$ GP_BASEDIR=" | ||
| + | [user@login00.darwin ~]$ G_BASEDIR=" | ||
| + | [user@login00.darwin ~]$ P_BASEDIR=" | ||
| + | [user@login00.darwin ~]$ GP_BASEDIR_PRIVS=2770 | ||
| + | </ | ||
| + | |||
| + | |||
| + | If the directory hierarchy does not yet exist, it can be setup using | ||
| + | <code bash> | ||
| + | [user@login00.darwin ~]$ mkdir -p -m $GP_BASEDIR_PRIVS " | ||
| + | [user@login00.darwin ~]$ mkdir -p -m $GP_BASEDIR_PRIVS " | ||
| + | [user@login00.darwin ~]$ mkdir -p -m $GP_BASEDIR_PRIVS " | ||
| + | </ | ||
| + | |||
| + | ===== Source Preparation: | ||
| + | |||
| + | In this example version 2.8.3 of Plumed will be built. Our standard recipes for Plumed will entail use of the Intel compilers, the MKL for BLAS/ | ||
| + | |||
| + | Download and unpack " | ||
| + | <code bash> | ||
| + | [user@login00.darwin ~]$ cd $P_BASEDIR | ||
| + | [user@login00.darwin Plumed]$ wget https:// | ||
| + | [user@login00.darwin Plumed]$ tar -xvzf plumed-2.8.3.tgz | ||
| + | </ | ||
| + | |||
| + | ===== Compilation and Installation: | ||
| + | |||
| + | We use configure for compilation and installation on " | ||
| + | <code bash> | ||
| + | [user@login00.darwin ~]$ P_INSTALL_PREFIX=" | ||
| + | [user@login00.darwin ~]$ export P_INSTALL_PREFIX | ||
| + | [user@login00.darwin ~]$ P_SRC_PREFIX=" | ||
| + | [user@login00.darwin ~]$ mkdir -m $GP_BASEDIR_PRIVS " | ||
| + | [user@login00.darwin ~]$ cd " | ||
| + | [user@login00.darwin plumed-2.8.3]$ vpkg_devrequire openmpi/ | ||
| + | [user@login00.darwin plumed-2.8.3]$ ./configure --prefix=$P_INSTALL_PREFIX | ||
| + | [user@login00.darwin plumed-2.8.3]$ make | ||
| + | [user@login00.darwin plumed-2.8.3]$ make install | ||
| + | </ | ||
| + | Our current working directory is now the source directory. | ||
| + | Here, we create '' | ||
| + | <file make sourceme.sh> | ||
| + | TPATH=" | ||
| + | export PATH=" | ||
| + | export LIBRARY_PATH=" | ||
| + | export LD_LIBRARY_PATH=" | ||
| + | export PLUMED_KERNEL=" | ||
| + | export PLUMED_VIMPATH=" | ||
| + | export PYTHONPATH=" | ||
| + | |||
| + | export CPATH=" | ||
| + | export INCLUDE=" | ||
| + | </ | ||
| + | |||
| + | |||
| + | Executing the script. | ||
| + | <code bash> | ||
| + | [user@login00.darwin plumed-2.8.3]$ source sourceme.sh | ||
| + | </ | ||
| + | |||
| + | ===== Source Preparation: | ||
| + | |||
| + | In this example version 2022.5 of Gromacs will be built. Our standard recipes for Gromacs will entail use of the Intel compilers, the MKL for BLAS/ | ||
| + | |||
| + | Download and unpack " | ||
| + | <code bash> | ||
| + | [user@login00.darwin plumed-2.8.3]$ cd $G_BASEDIR | ||
| + | [user@login00.darwin Gromacs]$ wget https:// | ||
| + | [user@login00.darwin Gromacs]$ tar -xvzf gromacs-2022.5.tar.gz | ||
| + | </ | ||
| + | |||
| + | ===== Compilation and Installation: | ||
| + | |||
| + | We use cmake for compilation and installation on Plumed-patched Gromacs " | ||
| + | <code bash> | ||
| + | [user@login00.darwin Gromacs]$ G_INSTALL_PREFIX=" | ||
| + | [user@login00.darwin Gromacs]$ export G_INSTALL_PREFIX | ||
| + | [user@login00.darwin Gromacs]$ G_SRC_PREFIX=" | ||
| + | [user@login00.darwin Gromacs]$ mkdir -m $GP_BASEDIR_PRIVS " | ||
| + | [user@login00.darwin Gromacs]$ G_BUILDDIR=" | ||
| + | [user@login00.darwin Gromacs]$ mkdir -m $GP_BASEDIR_PRIVS " | ||
| + | [user@login00.darwin Gromacs]$ cd " | ||
| + | </ | ||
| + | Hear, we patch Plumed on Gromacs. | ||
| + | <code bash> | ||
| + | [user@login00.darwin gromacs-2022.5]$ plumed patch -p --static | ||
| + | </ | ||
| + | |||
| + | Select 4: | ||
| + | <code bash> | ||
| + | 1) gromacs-2019.6 | ||
| + | 2) gromacs-2020.7 | ||
| + | 3) gromacs-2021.7 | ||
| + | 4) gromacs-2022.5 | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | [user@login00.darwin gromacs-2022.5]$ cd " | ||
| + | </ | ||
| + | Our current working directory is now the //build root//. | ||
| + | Here, we create '' | ||
| + | <file make SWMGR-build.sh.darwin> | ||
| + | #!/bin/bash -l | ||
| + | |||
| + | vpkg_require cmake/ | ||
| + | |||
| + | PREFIX=" | ||
| + | |||
| + | CPU_GMX_SIMD=AVX2_256 | ||
| + | |||
| + | BASE_BUILD_FLAGS=" | ||
| + | -DCMAKE_BUILD_TYPE=Release | ||
| + | -DGMX_SIMD=${CPU_GMX_SIMD} | ||
| + | -DGMX_FFT_LIBRARY=mkl | ||
| + | -DMKL_MPI=openmpi | ||
| + | -DBUILD_SHARED_LIBS=OFF | ||
| + | -DGMX_PREFER_STATIC_LIBS=ON | ||
| + | " | ||
| + | # BASE_BUILD_FLAGS=" | ||
| + | # -DMKL_INCLUDE_DIR=$MKLROOT/ | ||
| + | # -DMKL_LIBRARIES=-mkl=sequential | ||
| + | #" | ||
| + | |||
| + | build_variant() | ||
| + | { | ||
| + | local DBL=$1 MPI=$2 | ||
| + | local build_dir="" | ||
| + | local build_flags="" | ||
| + | |||
| + | if [ $DBL -ne 0 ]; then | ||
| + | build_dir=" | ||
| + | build_flags=" | ||
| + | else | ||
| + | build_dir=" | ||
| + | build_flags=" | ||
| + | fi | ||
| + | if [ $MPI -eq 0 ]; then | ||
| + | build_dir=" | ||
| + | build_flags=" | ||
| + | CC=icx CXX=icpx FC=ifx | ||
| + | else | ||
| + | build_dir=" | ||
| + | build_flags=" | ||
| + | CC=mpicc CXX=mpicxx FC=mpifort | ||
| + | fi | ||
| + | [ -d " | ||
| + | mkdir " | ||
| + | CC=$CC CXX=$CXX FC=$FC \ | ||
| + | cmake \ | ||
| + | -DCMAKE_INSTALL_PREFIX=" | ||
| + | $BASE_BUILD_FLAGS $build_flags \ | ||
| + | ../.. | ||
| + | if [ $? -eq 0 ]; then | ||
| + | make -j 20 | ||
| + | if [ $? -eq 0 ]; then | ||
| + | make install | ||
| + | fi | ||
| + | fi | ||
| + | popd | ||
| + | } | ||
| + | |||
| + | ## | ||
| + | ## SYCL only supports single precision. | ||
| + | ## | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | build_variant 1 1 | ||
| + | |||
| + | </ | ||
| + | |||
| + | <file make SWMGR-build.sh.caviness> | ||
| + | #!/bin/bash -l | ||
| + | |||
| + | vpkg_require cmake/ | ||
| + | |||
| + | PREFIX=" | ||
| + | |||
| + | CPU_GMX_SIMD=AVX2_256 | ||
| + | |||
| + | BASE_BUILD_FLAGS=" | ||
| + | -DCMAKE_BUILD_TYPE=Release | ||
| + | -DGMX_SIMD=${CPU_GMX_SIMD} | ||
| + | -DGMX_FFT_LIBRARY=mkl | ||
| + | -DMKL_MPI=openmpi | ||
| + | -DBUILD_SHARED_LIBS=OFF | ||
| + | -DGMX_PREFER_STATIC_LIBS=ON | ||
| + | " | ||
| + | # BASE_BUILD_FLAGS=" | ||
| + | # -DMKL_INCLUDE_DIR=$MKLROOT/ | ||
| + | # -DMKL_LIBRARIES=-mkl=sequential | ||
| + | #" | ||
| + | |||
| + | build_variant() | ||
| + | { | ||
| + | local DBL=$1 MPI=$2 | ||
| + | local build_dir="" | ||
| + | local build_flags="" | ||
| + | |||
| + | if [ $DBL -ne 0 ]; then | ||
| + | build_dir=" | ||
| + | build_flags=" | ||
| + | else | ||
| + | build_dir=" | ||
| + | build_flags=" | ||
| + | fi | ||
| + | if [ $MPI -eq 0 ]; then | ||
| + | build_dir=" | ||
| + | build_flags=" | ||
| + | CC=icx CXX=icpx FC=ifx | ||
| + | else | ||
| + | build_dir=" | ||
| + | build_flags=" | ||
| + | CC=mpicc CXX=mpicxx FC=mpifort | ||
| + | fi | ||
| + | [ -d " | ||
| + | mkdir " | ||
| + | CC=$CC CXX=$CXX FC=$FC \ | ||
| + | cmake \ | ||
| + | -DCMAKE_INSTALL_PREFIX=" | ||
| + | $BASE_BUILD_FLAGS $build_flags \ | ||
| + | ../.. | ||
| + | if [ $? -eq 0 ]; then | ||
| + | make -j 20 | ||
| + | if [ $? -eq 0 ]; then | ||
| + | make install | ||
| + | fi | ||
| + | fi | ||
| + | popd | ||
| + | } | ||
| + | |||
| + | ## | ||
| + | ## SYCL only supports single precision. | ||
| + | ## | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | build_variant 1 1 | ||
| + | |||
| + | </ | ||
| + | |||
| + | Executing the script compile and install plumed-patched gromacs. | ||
| + | <code bash> | ||
| + | [user@login00.darwin build]$ ./ | ||
| + | </ | ||
| + | |||
| + | ===== VALET Package Definition ===== | ||
| + | |||
| + | With this version of Gromacs_Plumed built, the remaining step is to leverage VALET for setup of the runtime environment when you use the software. | ||
| + | <code bash> | ||
| + | [user@login00.darwin build]$ vpkg_rollback all | ||
| + | [user@login00.darwin build]$ cd | ||
| + | [user@login00.darwin ~]$ echo $GP_BASEDIR | ||
| + | / | ||
| + | </ | ||
| + | Since this build was done in the user's home directory, they were personal copies of the software and should use a //VALET package definition file// stored in '' | ||
| + | <code bash> | ||
| + | [user@login00.darwin ~]$ VALET_PKG_DIR=~/ | ||
| + | </ | ||
| + | versus an installation made for an entire workgroup, which would store the VALET package definition files in '' | ||
| + | <code bash> | ||
| + | [user@login00.darwin ~]$ VALET_PKG_DIR=" | ||
| + | </ | ||
| + | Whichever scheme is in-use, ensure the directory exists: | ||
| + | <code bash> | ||
| + | [user@login00.darwin ~]$ mkdir -p --mode=$VALET_PKG_DIR_MODE " | ||
| + | </ | ||
| + | |||
| + | VALET allows package definitions in a variety of formats (XML, JSON, YAML) but YAML tends to be the simplest format so we will use it here. | ||
| + | |||
| + | ==== Package section ==== | ||
| + | |||
| + | The //package section// of the definition file includes items that apply to all versions/ | ||
| + | <code yaml> | ||
| + | Gromacs_Plumed: | ||
| + | prefix: / | ||
| + | description: | ||
| + | url: " | ||
| + | </ | ||
| + | The //package identifier// | ||
| + | |||
| + | ==== Versions ==== | ||
| + | |||
| + | The '' | ||
| + | <code yaml> | ||
| + | gromacs-plumed: | ||
| + | prefix: / | ||
| + | description: | ||
| + | url: " | ||
| + | | ||
| + | default-version: | ||
| + | | ||
| + | versions: | ||
| + | " | ||
| + | prefix: " | ||
| + | description: | ||
| + | dependencies: | ||
| + | - openmpi/ | ||
| + | |||
| + | </ | ||
| + | |||
| + | <WRAP center round tip 80%> | ||
| + | The version identifier '' | ||
| + | |||
| + | The implicit behavior is overridden by providing a '' | ||
| + | </ | ||
| + | |||
| + | It is a good idea to specify which version definition should act as the default. | ||
| + | |||
| + | <file yaml gromacs-plumed.vpkg_yaml.darwin> | ||
| + | gromacs-plumed: | ||
| + | prefix: / | ||
| + | description: | ||
| + | url: " | ||
| + | | ||
| + | default-version: | ||
| + | | ||
| + | versions: | ||
| + | " | ||
| + | prefix: " | ||
| + | description: | ||
| + | dependencies: | ||
| + | - openmpi/ | ||
| + | </ | ||
| + | |||
| + | <file yaml gromacs-plumed.vpkg_yaml.caviness> | ||
| + | gromacs-plumed: | ||
| + | prefix: / | ||
| + | description: | ||
| + | url: " | ||
| + | | ||
| + | default-version: | ||
| + | | ||
| + | versions: | ||
| + | " | ||
| + | prefix: " | ||
| + | description: | ||
| + | dependencies: | ||
| + | - openmpi/ | ||
| + | </ | ||
| + | |||
| + | saved at '' | ||
| + | |||
| + | ==== Checking the definition file ==== | ||
| + | |||
| + | The package definition file can be checked for proper syntax using the VALET command '' | ||
| + | <code bash> | ||
| + | [user@login00.darwin ~]$ vpkg_check " | ||
| + | / | ||
| + | [gromacs-plumed] { | ||
| + | contexts: all | ||
| + | actions: { | ||
| + | GROMACS_PLUMED_PREFIX=${VALET_PATH_PREFIX} (contexts: development) | ||
| + | } | ||
| + | https:// | ||
| + | Gromacs_Plumed | ||
| + | prefix: / | ||
| + | source file: / | ||
| + | default version: gromacs-plumed/ | ||
| + | versions: { | ||
| + | [gromacs-plumed/ | ||
| + | contexts: all | ||
| + | dependencies: | ||
| + | openmpi/ | ||
| + | } | ||
| + | Gromacs patched with Plumed v2.8.3 | ||
| + | prefix: / | ||
| + | standard paths: { | ||
| + | bin: / | ||
| + | lib: / | ||
| + | man: / | ||
| + | include: / | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | The file had no errors in its YAML syntax. | ||
| + | |||
| + | ==== Runtime environment ==== | ||
| + | |||
| + | To load **Gromacs_Plumed** v2022.5 into the runtime environment, | ||
| + | <code bash> | ||
| + | [user@login00.darwin ~]$ vpkg_require gromacs-plumed/ | ||
| + | Adding dependency `binutils/ | ||
| + | Adding dependency `gcc/ | ||
| + | Adding dependency `intel-oneapi/ | ||
| + | Adding dependency `ucx/ | ||
| + | Adding dependency `openmpi/ | ||
| + | Adding package `gromacs-plumed/ | ||
| + | [user@login00.darwin ~]$ which gmx_mpi_d | ||
| + | ~/ | ||
| + | </ | ||
| + | |||
| + | ===== Scaling ===== | ||
| + | |||
| + | This is the wall time for MD run of 41057 atom, and nsteps=10000 with metadynamics by combining Gromacs and Plumed. The wall time decreases with an increased number of cores. | ||
| + | |||
| + | {{: | ||