Skip to content

Commit

Permalink
NAMD 3.0 (GH200) (#125)
Browse files Browse the repository at this point in the history
namd 3.0
  • Loading branch information
RMeli authored Jul 9, 2024
1 parent 2e97324 commit 4c61a13
Show file tree
Hide file tree
Showing 20 changed files with 1,498 additions and 13 deletions.
6 changes: 6 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ uenvs:
santis: [gh200]
todi: [gh200]
develop: False
"3.0":
recipes:
gh200: 3.0/gh200
deploy:
todi: [gh200]
develop: False
netcdf-tools:
"2024":
recipes:
Expand Down
52 changes: 39 additions & 13 deletions docs/uenv-namd.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,64 @@

## Single-node build

The single-node build works on a single node and benefits from the new GPU-resident mode (see [NAMD 3.0b6 GPU-Resident benchmarking results] for more details).
The single-node build works on a single node and benefits from the new GPU-resident mode (see [NAMD 3.0b6 GPU-Resident benchmarking results] for more details). The single-node build provides the following views:

* `namd-single-node` (standard view, with NAMD)
* `develop-single-node` (development view, without NAMD)

### Building from source

The [NAMD] `uenv` provides all the dependencies required to build [NAMD] from source. You can follow these steps to build [NAMD] from source:

```bash
export DEV_VIEW_NAME="develop-single-node"

# Start uenv and load develop view
uenv start <NAMD_UENV>
uenv view develop
uenv view ${DEV_VIEW_NAME}

# cd to NAMD source directory
cd <PATH_TO_NAMD_SOURCE>

# Set variable VIEW_PATH to the view
export DEV_VIEW_PATH=/user-environment/env/${DEV_VIEW_NAME}

# Build bundled Charm++
tar -xvf charm-7.0.0.tar && cd charm-v7.0.0
tar -xvf charm-8.0.0.tar && cd charm-8.0.0
./build charm++ multicore-linux-arm8 gcc --with-production --enable-tracing -j 32

# Build NAMD
cd ..
# Configure NAMD build for GPU
cd ..
./config Linux-ARM64-g++.cuda \
--charm-arch multicore-linux-arm8-gcc --charm-base $PWD/charm-v7.0.0 \
--with-tcl --tcl-prefix /user-environment/env/develop \
--with-fftw --with-fftw3 --fftw-prefix /user-environment/env/develop \
--cuda-gencode arch=compute_90,code=sm_90 --with-single-node-cuda --with-cuda --cuda-prefix /user-environment/env/develop
--charm-arch multicore-linux-arm8-gcc --charm-base $PWD/charm-8.0.0 \
--with-tcl --tcl-prefix ${DEV_VIEW_PATH} \
--with-fftw --with-fftw3 --fftw-prefix ${DEV_VIEW_PATH} \
--cuda-gencode arch=compute_90,code=sm_90 --with-single-node-cuda --with-cuda --cuda-prefix ${DEV_VIEW_PATH}
cd Linux-ARM64-g++.cuda && make -j 32

export LD_LIBRARY_PATH=/user-environment/env/develop/lib/
# !!! BEGIN OPTIONAL !!!
# Configure NAMD build for CPU
cd ..
./config Linux-ARM64-g++ \
--charm-arch multicore-linux-arm8-gcc --charm-base $PWD/charm-8.0.0 \
--with-tcl --tcl-prefix ${DEV_VIEW_PATH} \
--with-fftw --with-fftw3 --fftw-prefix ${DEV_VIEW_PATH}
cd Linux-ARM64-g++ && make -j 32
# !!! END OPTIONAL !!!

cd ..
export LD_LIBRARY_PATH=${DEV_VIEW_PATH}/lib/

# Run NAMD (GPU version)
Linux-ARM64-g++.cuda/namd3 <NAMD_OPTIONS>

# Run NAMD
./namd3 <NAMD_OPTIONS>
# !!! BEGIN OPTIONAL !!!
# Run NAMD (CPU version)
Linux-ARM64-g++/namd3 <NAMD_OPTIONS>
# !!! END OPTIONAL !!!
```

The optional section provides instructions on how to build a CPU-only build, should you need it (for constant pH MD simulations, for example).

## Useful Links

* [NAMD Spack package]
Expand All @@ -65,3 +90,4 @@ export LD_LIBRARY_PATH=/user-environment/env/develop/lib/
[What you should know about NAMD and Charm++ but were hoping to ignore]: https://dl.acm.org/doi/pdf/10.1145/3219104.3219134
[NAMD 3.0 new features]: https://www.ks.uiuc.edu/Research/namd/3.0/features.html
[NAMD 3.0b6 GPU-Resident benchmarking results]: https://www.ks.uiuc.edu/Research/namd/benchmarks/

5 changes: 5 additions & 0 deletions recipes/namd/3.0/gh200/compilers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bootstrap:
spec: gcc@12
gcc:
specs:
- [email protected]
7 changes: 7 additions & 0 deletions recipes/namd/3.0/gh200/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: namd
description: "NAMD: Scalable Molecular Dynamics"
store: /user-environment
spack:
repo: https://github.com/spack/spack.git
commit: v0.22.0
modules: True
17 changes: 17 additions & 0 deletions recipes/namd/3.0/gh200/environments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namd-single-node:
compiler:
- toolchain: gcc
spec: [email protected]
unify: true
specs:
- [email protected]
- [email protected] +openmp ~mpi
- [email protected]
- charmpp@=8.0.0 backend=multicore +production +tracing
- namd@=3.0 +cuda cuda_arch=90 +single_node_gpu
views:
develop-single-node:
link: roots
exclude: ["namd"]
namd-single-node:
link: roots
25 changes: 25 additions & 0 deletions recipes/namd/3.0/gh200/modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
modules:
prefix_inspections:
bin:
- PATH
lib:
- LD_LIBRARY_PATH
lib64:
- LD_LIBRARY_PATH

default:
arch_folder: false
roots:
tcl: /user-environment/modules
tcl:
all:
autoload: none
hash_length: 0
exclude_implicits: true
exclude: ['%[email protected]', 'gcc %[email protected]']
projections:
all: '{name}/{version}'
namd+single_node_gpu: '{name}-single-node/{version}'
fftw~mpi: '{name}-no-mpi/{version}'
charmpp backend=multicore: '{name}-multicore/{version}'
charmpp backend=ofi : '{name}-ofi/{version}'
15 changes: 15 additions & 0 deletions recipes/namd/3.0/gh200/pre-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -u

namd_version=3.0
namd=NAMD_${namd_version}_Source.tar.gz

username=$CSCS_REGISTRY_USERNAME
password=$CSCS_REGISTRY_PASSWORD

curl -u ${username}:${password} https://jfrog.svc.cscs.ch/artifactory/uenv-sources/namd/${namd} --output {{ env.build }}/environments/${namd}

sha256sum {{ env.build }}/environments/${namd}


188 changes: 188 additions & 0 deletions recipes/namd/3.0/gh200/repo/packages/charmpp/charm_6.7.1_aocc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
diff -bur charm-6.7.1/src/arch/mpi-linux-x86_64/cc-mpicxx.sh updated-charm-6.7.1/src/arch/mpi-linux-x86_64/cc-mpicxx.sh
--- charm-6.7.1/src/arch/mpi-linux-x86_64/cc-mpicxx.sh 2016-11-07 20:14:26.000000000 +0530
+++ updated-charm-6.7.1/src/arch/mpi-linux-x86_64/cc-mpicxx.sh 2019-08-26 16:55:40.868903291 +0530
@@ -14,7 +14,7 @@

CMK_REAL_COMPILER=`$MPICXX -show 2>/dev/null | cut -d' ' -f1 `
case "$CMK_REAL_COMPILER" in
-g++) CMK_AMD64="-m64 -fPIC" ;;
+clang++) CMK_AMD64="-m64 -fPIC" ;;
icpc) CMK_AMD64="-m64";;
pgCC) CMK_AMD64="-DCMK_FIND_FIRST_OF_PREDICATE=1 --no_using_std " ;;
FCC) CMK_AMD64="-Kfast -DCMK_FIND_FIRST_OF_PREDICATE=1 --variadic_macros";;
diff -bur charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh updated-charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh
--- charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh 2016-11-07 20:14:26.000000000 +0530
+++ updated-charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach-scyld.sh 2019-08-26 16:55:40.868903291 +0530
@@ -1,14 +1,14 @@

case "$CMK_CC" in
mpicc*)
- CMK_CPP_C="gcc -E "
- CMK_CC="gcc -fPIC"
- CMK_CC_RELIABLE="gcc -fPIC"
- CMK_CC_FASTEST="gcc -fPIC"
- CMK_CXX="g++ -fPIC"
- CMK_CXXPP="gcc -E "
- CMK_LD="gcc"
- CMK_LDXX="g++"
+ CMK_CPP_C="clang -E "
+ CMK_CC="clang -fPIC"
+ CMK_CC_RELIABLE="clang -fPIC"
+ CMK_CC_FASTEST="clang -fPIC"
+ CMK_CXX="clang++ -fPIC"
+ CMK_CXXPP="clang -E "
+ CMK_LD="clang"
+ CMK_LDXX="clang++"

# native compiler for compiling charmxi, etc
CMK_NATIVE_CC="$CMK_CC"
Only in updated-charm-6.7.1/src/arch/mpi-linux-x86_64: conv-mach-scyld.sh.orig
Only in updated-charm-6.7.1/src/arch/mpi-linux-x86_64: conv-mach-scyld.sh.rej
diff -bur charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach.sh updated-charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach.sh
--- charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach.sh 2016-11-07 20:14:26.000000000 +0530
+++ updated-charm-6.7.1/src/arch/mpi-linux-x86_64/conv-mach.sh 2019-08-26 16:55:40.868903291 +0530
@@ -23,7 +23,7 @@

CMK_REAL_COMPILER=`$MPICXX -show 2>/dev/null | cut -d' ' -f1 `
case "$CMK_REAL_COMPILER" in
-g++) CMK_AMD64_CC="$CMK_GCC64"; CMK_AMD64_CXX="$CMK_GCC64" ;;
+clang++) CMK_AMD64_CC="$CMK_GCC64"; CMK_AMD64_CXX="$CMK_GCC64" ;;
pgCC) CMK_AMD64_CC="-fPIC"; CMK_AMD64_CXX="-fPIC -DCMK_FIND_FIRST_OF_PREDICATE=1 --no_using_std " ;;
charmc) echo "Error> charmc can not call AMPI's mpicxx/mpiCC wrapper! Please fix your PATH."; exit 1 ;;
esac
@@ -38,10 +38,10 @@
CMK_LIBS="-lckqt $CMK_SYSLIBS "
CMK_LD_LIBRARY_PATH="-Wl,-rpath,$CHARMLIBSO/"

-CMK_NATIVE_CC="gcc $CMK_GCC64 "
-CMK_NATIVE_LD="gcc $CMK_GCC64 "
-CMK_NATIVE_CXX="g++ $CMK_GCC64 "
-CMK_NATIVE_LDXX="g++ $CMK_GCC64 "
+CMK_NATIVE_CC="clang $CMK_GCC64 "
+CMK_NATIVE_LD="clang $CMK_GCC64 "
+CMK_NATIVE_CXX="clang++ $CMK_GCC64 "
+CMK_NATIVE_LDXX="clang++ $CMK_GCC64 "
CMK_NATIVE_LIBS=""

# fortran compiler
@@ -51,7 +51,7 @@
# CMK_FPP="/lib/cpp -P -CC"
# CMK_CF90="$CMK_CF90 -fpic -fautomatic -fdollar-ok "
# CMK_CF90_FIXED="$CMK_CF90 -ffixed-form "
-# CMK_F90LIBS="-lgfortran "
+# CMK_F90LIBS=" "
# CMK_F90_USE_MODDIR=1
# CMK_F90_MODINC="-I"
# CMK_MOD_NAME_ALLCAPS=
diff -bur charm-6.7.1/src/libs/ck-libs/ckloop/Makefile updated-charm-6.7.1/src/libs/ck-libs/ckloop/Makefile
--- charm-6.7.1/src/libs/ck-libs/ckloop/Makefile 2016-11-07 20:14:28.000000000 +0530
+++ updated-charm-6.7.1/src/libs/ck-libs/ckloop/Makefile 2019-08-26 16:55:40.852903122 +0530
@@ -38,7 +38,7 @@
for i in $(LIBOBJ) ; do \
SRCFILE=`basename $$i .o`.C ; \
echo "checking dependencies for $$i : $$SRCFILE" ; \
- g++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \
+ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \
echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \
done;

Only in updated-charm-6.7.1/src/libs/ck-libs/ckloop: Makefile.orig
Only in updated-charm-6.7.1/src/libs/ck-libs/ckloop: Makefile.rej
diff -bur charm-6.7.1/src/libs/ck-libs/completion/Makefile updated-charm-6.7.1/src/libs/ck-libs/completion/Makefile
--- charm-6.7.1/src/libs/ck-libs/completion/Makefile 2016-11-07 20:14:28.000000000 +0530
+++ updated-charm-6.7.1/src/libs/ck-libs/completion/Makefile 2019-08-26 16:55:40.852903122 +0530
@@ -45,7 +45,7 @@
for i in $(LIBOBJ) ; do \
SRCFILE=`basename $$i .o`.C ; \
echo "checking dependencies for $$i : $$SRCFILE" ; \
- g++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \
+ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \
echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \
done;

Only in updated-charm-6.7.1/src/libs/ck-libs/completion: Makefile.orig
Only in updated-charm-6.7.1/src/libs/ck-libs/completion: Makefile.rej
diff -bur charm-6.7.1/src/libs/ck-libs/multicast/Makefile updated-charm-6.7.1/src/libs/ck-libs/multicast/Makefile
--- charm-6.7.1/src/libs/ck-libs/multicast/Makefile 2016-11-07 20:14:29.000000000 +0530
+++ updated-charm-6.7.1/src/libs/ck-libs/multicast/Makefile 2019-08-26 16:55:40.852903122 +0530
@@ -53,7 +53,7 @@
for i in $(LIBOBJ) ; do \
SRCFILE=`basename $$i .o`.C ; \
echo "checking dependencies for $$i : $$SRCFILE" ; \
- g++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \
+ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp $$SRCFILE >> $(DEPENDFILE); \
echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \
done;

Only in updated-charm-6.7.1/src/libs/ck-libs/multicast: Makefile.orig
Only in updated-charm-6.7.1/src/libs/ck-libs/multicast: Makefile.rej
diff -bur charm-6.7.1/src/libs/ck-libs/NDMeshStreamer/Makefile updated-charm-6.7.1/src/libs/ck-libs/NDMeshStreamer/Makefile
--- charm-6.7.1/src/libs/ck-libs/NDMeshStreamer/Makefile 2016-11-07 20:14:27.000000000 +0530
+++ updated-charm-6.7.1/src/libs/ck-libs/NDMeshStreamer/Makefile 2019-08-26 16:55:40.852903122 +0530
@@ -52,7 +52,7 @@
for i in $(LIBOBJ) ; do \
SRCFILE=`basename $$i .o`.C ; \
echo "checking dependencies for $$i : $$SRCFILE" ; \
- g++ -MM -Wno-deprecated -I$(CDIR)/tmp -I../completion $$SRCFILE >> $(DEPENDFILE); \
+ clang++ -MM -Wno-deprecated -I$(CDIR)/tmp -I../completion $$SRCFILE >> $(DEPENDFILE); \
echo ' $$(CHARMC) -I$(CDIR)/tmp -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \
done;

Only in updated-charm-6.7.1/src/libs/ck-libs/NDMeshStreamer: Makefile.orig
Only in updated-charm-6.7.1/src/libs/ck-libs/NDMeshStreamer: Makefile.rej
diff -bur charm-6.7.1/src/QuickThreads/Makefile updated-charm-6.7.1/src/QuickThreads/Makefile
--- charm-6.7.1/src/QuickThreads/Makefile 2016-11-07 20:14:25.000000000 +0530
+++ updated-charm-6.7.1/src/QuickThreads/Makefile 2019-08-26 16:55:40.856903165 +0530
@@ -1,5 +1,5 @@

-CC=gcc -I. -O2
+CC=clang -I. -O2

all: qt stp testpgm

diff -bur charm-6.7.1/src/scripts/Makefile updated-charm-6.7.1/src/scripts/Makefile
--- charm-6.7.1/src/scripts/Makefile 2016-11-07 20:14:29.000000000 +0530
+++ updated-charm-6.7.1/src/scripts/Makefile 2019-08-26 16:55:40.840902996 +0530
@@ -942,7 +942,7 @@
SRCFILE=`basename $$i .o`.C ; \
[ ! -f $$SRCFILE ] && SRCFILE=`basename $$i .o`.c ; \
echo "checking dependencies for $$SRCFILE" ; \
- if g++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \
+ if clang++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \
echo '' >> $(DEPENDFILE) ; \
done; \

@@ -968,7 +968,7 @@
found=`/usr/bin/find $$SRCDIR -depth 1 -name $$SRCFILE`; \
[ ! $$found ] && SRCFILE=`basename $$i .o`.c ; \
echo "checking dependencies for $$SRCFILE" ; \
- if g++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \
+ if clang++ -MM -Wno-deprecated -I. -I$(INC) $$SRCFILE >> $(DEPENDFILE); then true ; else echo '' ; echo "Compilation of '$$SRCFILE' failed, please fix it first!!!!" ; exit; fi; \
echo '' >> $(DEPENDFILE) ; \
done; \

diff -bur charm-6.7.1/tests/charm++/megatest/Makefile updated-charm-6.7.1/tests/charm++/megatest/Makefile
--- charm-6.7.1/tests/charm++/megatest/Makefile 2016-11-07 20:14:30.000000000 +0530
+++ updated-charm-6.7.1/tests/charm++/megatest/Makefile 2019-08-26 16:55:40.820902785 +0530
@@ -118,7 +118,7 @@
for i in $(OBJS) ; do \
SRCFILE=`basename $$i .o`.C ; \
echo "checking dependencies for $$SRCFILE" ; \
- g++ -MM -I$(CHARMINC) $$SRCFILE | \
+ clang++ -MM -I$(CHARMINC) $$SRCFILE | \
perl $(CHARMBIN)/dep.pl $(CHARMINC) /usr/include /usr/local >> $(DEPENDFILE); \
echo ' $$(CHARMC) -o '$$i $$SRCFILE >> $(DEPENDFILE) ; \
done;
--- charm-6.7.1/src/scripts/configure 2016-11-07 20:14:31.000000000 +0530
+++ updated-charm/charm-6.7.1/src/scripts/configure 2020-10-21 12:54:06.476958828 +0530
@@ -2141,8 +2141,8 @@
$as_echo_n "checking \"$1\"... " >&6; }
echo "### $1" >> $charmout
cat $t >> $charmout
- echo $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -c $t -o test.o $4 >> $charmout
- $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -c $t -o test.o $4 > out 2>&1
+ echo $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -Qunused-arguments -c $t -o test.o $4 >> $charmout
+ $CMK_CXX -I../include -I. $CMK_LIBDIR $CMK_INCDIR $CMK_SYSINC $OPTS_CXX $OPTS_LD -Qunused-arguments -c $t -o test.o $4 > out 2>&1
test_result $? "$1" "$2" "$3"
strictpass=$pass
strictfail=$fail
Loading

0 comments on commit 4c61a13

Please sign in to comment.