NAMD-2.13 with GPU support for LX

ウェブページ

http://www.ks.uiuc.edu/Research/namd/

バージョン

2.13

ビルド環境

  • Intel Parallel Studio 2017 update8
  • CUDA 9.1.85

ビルドに必要なファイル

  • NAMD_2.13_Source.tar.gz
  • charmrun.patch

--- src/arch/mpi/charmrun.org    2018-11-26 16:02:00.000000000 +0900
+++ src/arch/mpi/charmrun    2018-11-26 16:04:16.000000000 +0900
@@ -37,11 +37,11 @@
     +p[0-9]*)
         pes=`echo $1 | awk '{print substr($1,3)}'`
         ;;
-        -machinefile)
-        machinefile=$2
-        args=" "$1" "$2" "$args
-        shift
-        ;;
+#        -machinefile)
+#        machinefile=$2
+#        args=" "$1" "$2" "$args
+#        shift
+#        ;;
     ++quiet)
         QUIET=1
         args=$args" "$1
@@ -88,7 +88,7 @@
         mpirun -np $pes $args
         #    mpdallexit
       else   # normal case
-        test -z "$machinefile" && args=-machinefile" "$PBS_NODEFILE" "$args
+        #test -z "$machinefile" && args=-machinefile" "$PBS_NODEFILE" "$args
         test $QUIET -eq 0 && echo mpirun -np $pes $args
         mpirun -np $pes $args
       fi

  • (以下スクリプト内で取得)
    • tcl8.5.9-linux-x86_64.tar.gz
    • tcl8.5.9-linux-x86_64-threaded.tar.gz

ビルド手順

#!/bin/sh

VERSION=2.13
CHARM_VERSION=6.8.2
WORKDIR=/work/users/${USER}
SOURCEDIR=/home/users/${USER}/Software/NAMD/${VERSION}
NAME=NAMD_${VERSION}_Source
TARBALL=${SOURCEDIR}/${NAME}.tar.gz

LIBURL=http://www.ks.uiuc.edu/Research/namd/libraries
FFTW=fftw-linux-x86_64
FFTW_URL=${LIBURL}/${FFTW}.tar.gz
TCL=tcl8.5.9-linux-x86_64
TCL_URL=${LIBURL}/${TCL}.tar.gz
TCL_THREADED=tcl8.5.9-linux-x86_64-threaded
TCL_THREADED_URL=${LIBURL}/${TCL_THREADED}.tar.gz

PATCH0=${SOURCEDIR}/charmrun.patch

PARALLEL=12

#------------------------------------------------------------------
umask 0022

export LANG=""
export LC_ALL=C

module purge
module load intel_parallelstudio/2017update8
module load cuda/9.1

cd ${WORKDIR}
if [ -d ${NAME} ]; then
  mv ${NAME} namd_erase
  rm -rf namd_erase &
fi

tar zxf ${TARBALL}
cd ${NAME}
tar xf charm-${CHARM_VERSION}.tar

cd charm-${CHARM_VERSION}
patch -p0 < ${PATCH0}
sed -i -e "s/_OPTIMIZE/_OPTIMIZE -xHost/" src/scripts/charmc

export CC=icc
export CXX=icpc
export F90=ifort
export F77=ifort

./build charm++ multicore-linux-x86_64-iccstatic \
        --no-build-shared --with-production -j${PARALLEL}
cd multicore-linux-x86_64-iccstatic/tests/charm++/megatest
make pgm
mpirun -np ${PARALLEL} ./pgm
cd ../../../../
cd ../

wget ${FFTW_URL}
tar zxf ${FFTW}.tar.gz
mv linux-x86_64 fftw
wget ${TCL_URL}
tar zxf ${TCL}.tar.gz
mv ${TCL} tcl
wget ${TCL_THREADED_URL}
tar zxf ${TCL_THREADED}.tar.gz
mv ${TCL_THREADED} tcl-threaded

NEWOPTS="-xHost -static-intel -O3 -ip -fp-model fast=2 -DNAMD_DISABLE_SSE"
./config Linux-x86_64-icc \
         --charm-arch multicore-linux-x86_64-iccstatic \
         --with-mkl \
         --with-python \
         --with-cuda \
         --cuda-prefix /local/apl/lx/cuda-9.1 \
         --cuda-gencode "arch=compute_60,code=sm_60" \
         --cuda-gencode "arch=compute_70,code=sm_70" \
         --cuda-dlink "arch=compute_60,code=sm_60" \
         --cuda-dlink "arch=compute_70,code=sm_70" \
         --cxx-opts "$NEWOPTS" \
         --cxx-thread-opts "$NEWOPTS" \
         --cxx-noalias-opts "$NEWOPTS -fno-alias" \
         --cc-opts "$NEWOPTS"
cd Linux-x86_64-icc
make -j${PARALLEL}
make release

メモ

  • (2022/6/29) fftw を取得、処理する部分が抜け落ちていたため追加