[클러스터] MPICH 와 Compiler 연동
Compiling Amber8 with Intel compilers and MPICH:
Remember to set AMBERHOME and MPICH_HOME (for parallel compilations) environmental variables before you start compiling (export is used for setting environmental variables in the following examples; use setenv for csh variants). Here is the basic procedure for getting things set up, compiled and tested:
1. Install Intel compilers (ifort8.0, icc8.0)
Get compilers (non-commercial unsupported version or supported payed for version) from Intel website (http://developer.intel.com/software/products/global/eval.htm) and follow their procedure to install them. Once compilers are installed, set compiler environment, e.g. from your .bashrc:
# Intel C Compiler (icc8.0), Fortran compiler (ifort8.0)
source /opt/intel_cc_80/bin/iccvars.sh
source /opt/intel_fc_80/bin/ifortvars.sh
2. Compile and install MPI libraries (mpich-1.2.5.2)
To compile MPICH libraries with Intel compilers, configure for example like this:
export CC=icc
export FC=ifort
./configure –prefix=/usr/local/mpich-1.2.5.2_icc -cc=$CC -fc=$FC
make install
If you use GCC to compile mpich, configure in the following way:
export CC=gcc
export FC=ifort
./configure –prefix=/usr/local/mpich-1.2.5.2_gcc -cc=$CC -fc=$FC
make install
3. Compile and install amber8
export AMBERHOME=”/usr/local/amber8_mpich”
export MPICH_HOME=”/usr/local/mpich-1.2.5.2_icc”
3a. Compile a serial (without MPI) version of all programs:
cd $AMBERHOME/src
./configure ifort
make serial
cd $AMBERHOME/test
make test | tee test.serial.out
3b. Compile a parallel version of sander (and sander.LES):
cd $AMBERHOME/src
make clean
./configure -mpich ifort
make parallel
cd $AMBERHOME/test
export DO_PARALLEL=”/usr/local/mpich-1.2.5.2_icc/bin/mpirun -np 2 ”
make test.sander | tee test.sander.parallel.out
make test.sander.LES | tee test.sander.LES.parallel.out
Compiling Amber8 with Intel compilers and LAM MPI:
Alternatively, if you want to use LAM MPI libraries instead of MPICH, here is a short description how the above procedure would be modified:
step 2 from above would be:
export CXX=icc
export FC=ifort
export CFLAGS=-static
export CXXFLAGS=-static
export FFLAGS=-static
./configure –prefix=/usr/local/lam-7.0.4_icc –without-romio –without-profiling
make
make install
step 3b from above would be:
export AMBERHOME=”/usr/local/amber8_lam”
export LAM_HOME=”/usr/local/lam-7.0.4_icc”
./configure -lam ifort
make parallel
test parallel version of sander with LAM:
Make sure that LAM commands are in your path, e.g. put:
export PATH=/usr/local/lam-7.0.4_icc/bin:$PATH
into your .bashrc file (and reload it).
Create a file, for example called machinefile and put it into $AMBERHOME/test. This file defines “LAM Universe”, i.e. which CPUs will your job run on. An example of the machinefile, which specifies that a current machine with 2 CPUs will be used might simply look like this:
localhost cpu=2
Make sure you can login to this machine without a password. Please refer to LAM manuals which describe how to run MPI jobs with LAM in full detail.
cd $AMBERHOME/test
lamboot -v machinefile
lamnodes (just check your universe)
export DO_PARALLEL=”/usr/local/lam-7.0.4_icc/bin/mpirun -np 2 ”
make test.sander | tee test.sander.parallel.out
make test.sander.LES | tee test.sander.LES.parallel.out
lamhalt
Compiling REM with Amber8
If you need to compile Replica Exchange (REM) code into sander, see section 5.18 of amber8 manual. In short, follow a serial build (step 3a) with the slightly modified parallel build:
cd $AMBERHOME/src
make clean
./configure -mpich ifort
make AMBERBUILDFLAGS=’-DREM’ parallel
cd $AMBERHOME/test
export DO_PARALLEL=”/usr/local/mpich-1.2.5.2_icc/bin/mpirun -np 4 ”
make test.sander.REM | tee test.sander.REM.out
Note: Set number of processors to at least 4 (you can do it even if you are on a dual cpu machine).
If you’re getting the following error during running REM tests (“make test.sander.REM” above):
cd rem_gb; Run.rem
/bin/sh: Run.rem: command not found
make: *** [test.sander.REM] Error 127
Go to Makefile, find the 3 REM tests and replace “Run.rem” by “./Run.rem” (the current dir specifier “./” slipped inadvertently from in front of Run.rem command)
——————————————————————————–
Here is the list of several common Linux distributions, which worked for us (meaning that they minimally passed ‘make test.sander’):
RedHat 7.3 (gcc-2.96, glibc-2.2.5, ifort8, icc8)
RedHat 9 (gcc-3.2.2, glibc-2.3.2, ifort8, icc8)
this also applies to Fedora Core 1 (except that sander.QMMM crashes with: relocation error: version GLIBC_2.0 not defined in file libc.so.6 with link time reference)
Suse 8.2 (gcc-3.3, glibc-2.3.2, ifort8, icc8)
Suse 9.0 (gcc-3.3.1, glibc-2.3.2, ifort8, icc8)
Intel compilers (ifort/icc) version 8 were used (Build 20031016Z); mpich-1.2.5.2 was compiled with icc or gcc; lam-7.0.4 was compiled with icc.