-
Notifications
You must be signed in to change notification settings - Fork 0
Gromacs Installation
Reference: http://manual.gromacs.org/current/install-guide/index.html
Note: All the installation tutorials in this page are for Gromacs 2020.3 and Ubuntu 18.04
Make sure gcc, g++ and cmake are installed on your machine.
Download Gromacs 2020.3 from http://manual.gromacs.org/documentation/2020.3/download.html using wget.
Follow the steps in Quick and dirty installation on official documentation. For the cmake step, add CUDA related arguments such as
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=ON -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda
Differences may exist depending on your CUDA toolkit path.
Follow Quick and dirty cluster installation on official documentation:
On a cluster where users are expected to be running across multiple nodes using MPI, make one installation similar to the above, and another using -DGMX_MPI=on and which is building only mdrun, because that is the only component of GROMACS that uses MPI. The latter will install a single simulation engine binary, i.e. mdrun_mpi when the default suffix is used. Hence it is safe and common practice to install this into the same location where the non-MPI build is installed.
So first install a quick and dirty version, then in the same build directory, build with
cmake .. -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicx -DGMX_MPI=on -DGMX_BUILD_MDRUN_ONLY=ON
make
make check
sudo make install
To run gromacs process, refer to http://manual.gromacs.org/current/user-guide/mdrun-performance.html. An example:
mpirun -np 2 -mca btl_tcp_if_include weave -x NCCL_SOCKET_IFNAME=weave --host localhost,worker1 gmx_mpi mdrun -deffnm md_0_1
Note the network interface should be specified in the command such as weave, ens33, etc. Type ifconfig to check network interfaces.
With default setting, we need to run source /usr/local/gromacs/bin/GMXRC to activate Gromacs commands for a new ssh session. To make life easier, add . /usr/local/gromacs/bin/GMXRC.bash at the beginning of your mpiuser's ~/.bashrc file.