Skip to content

Commit

Permalink
Docs: Add compile-notes for cuda on frontera
Browse files Browse the repository at this point in the history
  • Loading branch information
lwJi committed Oct 2, 2023
1 parent a876799 commit 2275032
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 71 deletions.
93 changes: 56 additions & 37 deletions Docs/compile-notes/frontera/README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,86 @@
# Install CarpetX with Spack (Frontera)

Use interactive session
* Use interactive session

* Compile CPU version: `idev -m 120`
- Compile CPU version: `idev -m 120`

* Compile GPU version: `idev -p rtx-dev -m 120`
- Compile GPU version: `idev -p rtx-dev -m 120`

Download spack
* Download spack

* `git clone -c feature.manyFiles=true https://github.com/spack/spack.git`
- `git clone -c feature.manyFiles=true https://github.com/spack/spack.git`

- `git checkout relesases/v0.20`

* `git checkout relesases/v0.20`
* Download CarpetX and SpacetimeX

## Download CarpetX and SpacetimeX
```bash
curl -kLO https://raw.githubusercontent.com/gridaphobe/CRL/master/GetComponents
chmod a+x GetComponents
./GetComponents --root Cactus --parallel --no-shallow https://raw.githubusercontent.com/lwJi/SpacetimeX/main/scripts/spacetimex.th
```

```
curl -kLO https://raw.githubusercontent.com/gridaphobe/CRL/master/GetComponents
chmod a+x GetComponents
./GetComponents --root Cactus --parallel --no-shallow https://raw.githubusercontent.com/lwJi/SpacetimeX/main/scripts/spacetimex.th
```
## Intel-Oneapi version (`[email protected]`)

```
cd Cactus/repos
git clone https://github.com/lwJi/SpacetimeX.git
cd ../arrangements
ln -s ../repos/SpacetimeX
```
* Load `intel/23.1.0`

## Intel-Oneapi version (`oneapi@2023.1.0`)
- `module load intel/23.1.0`

Load `intel/23.1.0`
* Setup spack

* `module load intel/23.1.0`
- `. share/spack/setup-env.sh`

- `spack compiler find`

Setup spack
* Create a dir where you want put `view` in (say `/work2/.../username/frontera/SpackView/oneapi`)

* `. share/spack/setup-env.sh`
* Replace the last line of `oneapi-23.1.0/spack.yaml` with your own dir (say `/work2/.../username/frontera/SpackView/oneapi/view`)

* `spack compiler find`
* Replace the dir `/work2/08708/liwei/frontera/SpackView/oneapi/view` in `configs/config_frontera_oneapi.cfg` (with say `/work2/.../username/frontera/SpackView/oneapi/view`)

Create a dir where you want put `view` in (say `/work2/.../username/frontera/SpackView/oneapi`)
* Install other required packages

* replace the last line of `oneapi-23.1.0/spack.yaml` with your dir (say `/work2/.../username/frontera/SpackView/oneapi/view`)
```bash
env TMPDIR=$WORK/tmp spack --env-dir ./oneapi-23.1.0 compiler find
env TMPDIR=$WORK/tmp spack --env-dir ./oneapi-23.1.0 concretize --force
env TMPDIR=$WORK/tmp spack --env-dir ./oneapi-23.1.0 install --fail-fast
```

* replace the dir `/work2/08708/liwei/frontera/SpackView/oneapi/view` (with say `/work2/.../username/frontera/SpackView/oneapi/view`)
in `config_frontera_oneapi.cfg`
* Install SpacetimeX

Install other required packages
```bash
cd Cactus
gmake SpacetimeX-oneapi options=repos/SpacetimeX/Docs/compile-notes/frontera/configs/config_frontera_oneapi.cfg
cp repos/SpacetimeX/Docs/thornlist/spactimex.th configs/SpacetimeX-oneapi/ThornList
gmake -j24 SpacetimeX-oneapi
```

* `env TMPDIR=$WORK/tmp spack --env-dir ./oneapi-23.1.0 compiler find`

* `env TMPDIR=$WORK/tmp spack --env-dir ./oneapi-23.1.0 concretize --force`
## CUDA version (`[email protected]`)

* `env TMPDIR=$WORK/tmp spack --env-dir ./oneapi-23.1.0 install --fail-fast`
* Make sure rerun `spack install [email protected] %[email protected]` again on `rtx-dev` or `rtx`

Install CarpetX
* Create a dir where you want put `view` in (say `/work2/.../username/frontera/SpackView/cuda`)

* `cd Cactus`
* Replace the last line of `cuda-11.8.0/spack_yaml` with your dir (say `/work2/.../username/frontera/SpackView/cuda/view`)

* `gmake CarpetX-oneapi options=config_frontera_oneapi.cfg`
* Replace the dir `/work2/08708/liwei/frontera/SpackView/cuda/view` in `configs/config_frontera_cuda.cfg` (with say `/work2/.../username/frontera/SpackView/cuda/view`)

* `cp repos/AsterX/scripts/asterx.th configs/CarpetX-oneapi/ThornList`
* Install other required packages

* `gmake -j16 CarpetX-oneapi`
```bash
env TMPDIR=$WORK/tmp spack --env-dir ./cuda-11.8.0 compiler find
env TMPDIR=$WORK/tmp spack --env-dir ./cuda-11.8.0 concretize --force
env TMPDIR=$WORK/tmp spack --env-dir ./cuda-11.8.0 install --fail-fast
```

* Install SpacetimeX

```bash
spack load [email protected]
spack load [email protected]
cd Cactus
gmake SpacetimeX-cuda options=repos/SpacetimeX/Docs/compile-notes/frontera/configs/config_frontera_cuda.cfg
cp repos/SpacetimeX/Docs/thornlist/spactimex.th configs/SpacetimeX-cuda/ThornList
gmake -j16 SpacetimeX-cuda
```
15 changes: 8 additions & 7 deletions Docs/compile-notes/frontera/configs/config-frontera-cuda.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ CXXFLAGS = -pipe -g0 -std=c++17 --compiler-options -std=gnu++17 --expt-relaxed-c
FPPFLAGS = -traditional
F90FLAGS = -pipe -g -fcray-pointer -ffixed-line-length-none
LIBS = nvToolsExt gfortran

#CUCCFLAGS = -std=c++17

#CUCC = nvcc
#CUCCFLAGS = -std=c++14 -I/opt/apps/cuda/11.3/include #-L/opt/apps/cuda/11.3/lib64
#LDFLAGS = -rdynamic
#LDFLAGS = -Wl,-rpath,/opt/apps/cuda/11.3/lib64 -Wl,-rpath,/work2/08708/liwei/frontera/SpackView/cuda/view/lib -Wl,-rpath,/work2/08708/liwei/frontera/SpackView/cuda/view/lib64
#LIBDIRS = /opt/apps/cuda/11.3/lib64

C_LINE_DIRECTIVES = yes
Expand Down Expand Up @@ -60,13 +61,11 @@ F90_WARN_FLAGS = -Wall -Wshadow -Wsurprising

VECTORISE = no

MPI_DIR = /opt/intel/compilers_and_libraries_2020.4.304/linux/mpi
MPI_LIB_DIRS = /opt/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64/lib/release
MPI_INC_DIRS = /opt/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64/include
MPI_DIR = /opt/intel/oneapi/mpi/2021.9.0
MPI_LIB_DIRS = /opt/intel/oneapi/mpi/2021.9.0/lib
MPI_INC_DIRS = /opt/intel/oneapi/mpi/2021.9.0/include
MPI_LIBS = mpi

GSL_DIR = /opt/apps/intel19/gsl/2.6
FFTW3_DIR = /opt/apps/intel19/impi19_0/fftw3/3.3.10
HWLOC_DIR = /opt/apps/hwloc/1.11.12

BLAS_DIR = NO_BUILD
Expand All @@ -78,7 +77,9 @@ OPENBLAS_LIBS = # /opt/intel/compilers_and_libraries_2020.1.217/linux/mkl/lib/in

PTHREADS_DIR = NO_BUILD

HDF5_DIR = /work2/08708/liwei/frontera/SpackView/gcc/view
GSL_DIR = /work2/08708/liwei/frontera/SpackView/cuda/view
FFTW3_DIR = /work2/08708/liwei/frontera/SpackView/cuda/view
HDF5_DIR = /work2/08708/liwei/frontera/SpackView/cuda/view
ADIOS2_DIR = /work2/08708/liwei/frontera/SpackView/cuda/view
ADIOS2_LIB_DIRS = /work2/08708/liwei/frontera/SpackView/cuda/view/lib64
ADIOS2_LIBS = adios2_cxx11_mpi adios2_cxx11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ CXX_WARN_FLAGS =
FPP_WARN_FLAGS =
F90_WARN_FLAGS =

MPI_DIR = /opt/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64
MPI_LIB_DIRS = /opt/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64/lib/release
MPI_INC_DIRS = /opt/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64/include
MPI_DIR = /opt/intel/oneapi/mpi/2021.9.0
MPI_LIB_DIRS = /opt/intel/oneapi/mpi/2021.9.0/lib
MPI_INC_DIRS = /opt/intel/oneapi/mpi/2021.9.0/include
MPI_LIBS = mpi

#FFTW3_DIR = /opt/apps/intel19/impi19_0/fftw3/3.3.10
HWLOC_DIR = /opt/apps/hwloc/1.11.12

BLAS_DIR = NO_BUILD
Expand Down
46 changes: 23 additions & 23 deletions Docs/compile-notes/frontera/cuda-11.8.0/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,47 @@ spack:
- [email protected] +hdf5
- yaml-cpp
- zlib
- gsl
# - petsc @3.17 +cuda +fftw +hwloc +openmp
# - gsl
# - openblas
packages:
#petsc:
# buildable: false
# externals:
# - spec: [email protected]
# prefix: /home1/apps/intel19/impi19_0/petsc/3.17
hwloc:
buildable: false
externals:
- spec: [email protected]
prefix: /opt/apps/hwloc/1.11.12
#cmake:
# buildable: false
# externals:
# - spec: [email protected]
# prefix: /opt/apps/cmake/3.24.2
intel-mkl:
buildable: false
externals:
- spec: [email protected]
prefix: /opt/intel/compilers_and_libraries_2020.1.217/linux/mkl
fftw:
buildable: false
externals:
- spec: [email protected]
prefix: /opt/apps/intel19/impi19_0/fftw3/3.3.10
- spec: [email protected]
prefix: /opt/intel/oneapi/mkl/2023.1.0
libfabric:
buildable: false
externals:
- spec: libfabric@19.0.9
prefix: /opt/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64/libfabric/lib
intel-mpi:
- spec: libfabric@2021.9.0
prefix: /opt/intel/oneapi/mpi/2021.9.0/libfabric/lib
intel-oneapi-mpi:
buildable: false
externals:
- spec: intel-mpi@19.0.9
prefix: /opt/intel/compilers_and_libraries_2020.4.304/linux/mpi
- spec: intel-oneapi-mpi@2021.9.0
prefix: /opt/intel/oneapi
mpi:
buildable: false
#petsc:
# buildable: false
# externals:
# - spec: [email protected]
# prefix: /home1/apps/intel19/impi19_0/petsc/3.17
#cmake:
# buildable: false
# externals:
# - spec: [email protected]
# prefix: /opt/apps/cmake/3.24.2
#fftw:
# buildable: false
# externals:
# - spec: [email protected]
# prefix: /opt/apps/intel19/impi19_0/fftw3/3.3.10
specs:
- matrix:
- [$%compilers]
Expand Down

0 comments on commit 2275032

Please sign in to comment.