Skip to content

Commit 5f14c6e

Browse files
author
Ben Prather
committed
Merge branch 'fix/nvidia-device-mpi' into feature/fofc
2 parents 3c64275 + f19d63a commit 5f14c6e

File tree

5 files changed

+50
-13
lines changed

5 files changed

+50
-13
lines changed

external/kokkos-kernels/KokkosBatched_Util.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,8 @@ KOKKOS_INLINE_FUNCTION auto subview_wrapper(ViewType v, IdxType1 i1,
772772
}
773773
template <class ViewType, class IdxType1>
774774
KOKKOS_INLINE_FUNCTION auto subview_wrapper(ViewType v, IdxType1 i1,
775-
Kokkos::ALL_t i2,
776-
Kokkos::ALL_t i3,
775+
Kokkos::Impl::ALL_t i2,
776+
Kokkos::Impl::ALL_t i3,
777777
const BatchLayout::Left &layout_tag,
778778
const Trans::Transpose) {
779779
auto sv_nt = subview_wrapper(v, i1, i3, i2, layout_tag);
@@ -805,7 +805,7 @@ KOKKOS_INLINE_FUNCTION auto subview_wrapper(
805805
}
806806
template <class ViewType, class IdxType1>
807807
KOKKOS_INLINE_FUNCTION auto subview_wrapper(
808-
ViewType v, IdxType1 i1, Kokkos::ALL_t i2, Kokkos::ALL_t i3,
808+
ViewType v, IdxType1 i1, Kokkos::Impl::ALL_t i2, Kokkos::Impl::ALL_t i3,
809809
const BatchLayout::Right &layout_tag, const Trans::Transpose &) {
810810
auto sv_nt = subview_wrapper(v, i1, i3, i2, layout_tag);
811811

external/parthenon

machines/chicoma.sh

+22-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if [[ "$HOST" == "ch-fe"* || "$HOST" == "nid00"* ]]; then
1111

1212
# Cray environments get confused easy
1313
# Make things as simple as possible
14-
# TODO ONLY NVHPC WORKS
14+
# Only default "nvhpc" module is supported, see HPC docs
1515
module purge
1616
export CRAY_CPU_TARGET="x86-64"
1717
if [[ "$ARGS" == *"cuda"* ]]; then
@@ -30,7 +30,7 @@ if [[ "$HOST" == "ch-fe"* || "$HOST" == "nid00"* ]]; then
3030
C_NATIVE=nvc
3131
CXX_NATIVE=nvc++
3232
else
33-
module load PrgEnv-nvhpc
33+
module load PrgEnv-nvhpc/8.3.3
3434
fi
3535
module load craype-accel-nvidia80
3636
# GPU runtime opts
@@ -40,18 +40,32 @@ if [[ "$HOST" == "ch-fe"* || "$HOST" == "nid00"* ]]; then
4040
unset OMP_PLACES
4141

4242
# Sometimes device-side buffers don't work
43-
# if [conditions]
44-
EXTRA_FLAGS="-DPARTHENON_ENABLE_HOST_COMM_BUFFERS=ON $EXTRA_FLAGS"
45-
#else
46-
#export MPICH_GPU_SUPPORT_ENABLED=1
43+
if [[ "$ARGS" == *"hostside"* ]]; then
44+
EXTRA_FLAGS="-DPARTHENON_ENABLE_HOST_COMM_BUFFERS=ON $EXTRA_FLAGS"
45+
else
46+
export MPICH_GPU_SUPPORT_ENABLED=1
47+
export MPICH_GPU_MANAGED_MEMORY_SUPPORT_ENABLED=1
48+
# Use the Cray wrappers else runtime errors (?)
49+
C_NATIVE=cc
50+
CXX_NATIVE=CC
51+
fi
4752

4853
else
54+
# CPU CASE
4955
module load PrgEnv-aocc
5056
MPI_EXTRA_ARGS="--cpus-per-task=2"
5157
fi
52-
module load cmake #cray-hdf5-parallel
58+
59+
# If using system HDF5, disable compression since it's old
60+
if [[ "$ARGS" != *"hdf5"* ]]; then
61+
module load cray-hdf5-parallel
62+
EXTRA_FLAGS="-DPARTHENON_DISABLE_HDF5_COMPRESSION=ON $EXTRA_FLAGS"
63+
fi
64+
65+
module load cmake
5366

5467
# Runtime opts
5568
MPI_EXE="srun"
56-
MPI_NUM_PROCS=""
69+
MPI_NUM_PROCS=${MPI_NUM_PROCS:-4}
5770
fi
71+

machines/delta.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ then
2929
EXTRA_FLAGS="-DPARTHENON_ENABLE_HOST_COMM_BUFFERS=ON $EXTRA_FLAGS"
3030

3131
# Load common GPU modules
32-
module load modtree/gpu cmake
32+
module load gcc/11.4.0 cuda/11.8.0 openmpi/4.1.5+cuda
3333

3434
if [[ $ARGS == *"latest"* ]]; then
3535
# nvhpc only on request, MPI crashes

make.sh

+23
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,12 @@ fi
285285
# delete the build directory
286286
if [[ "$ARGS" == *"clean"* ]]; then
287287

288+
# Should do this manually when compiling on backend nodes!
289+
if [ ! -f external/parthenon/CMakeLists.txt ]; then
290+
git submodule update --recursive --init
291+
fi
292+
293+
# Patch parthenon to use KHARMA's coordinates, anything incidental
288294
cd external/parthenon
289295
if [[ $(( $(git --version | cut -d '.' -f 2) > 35 )) == "1" ]]; then
290296
git apply --quiet ../patches/parthenon-*.patch
@@ -294,6 +300,23 @@ if [[ "$ARGS" == *"clean"* ]]; then
294300
fi
295301
cd -
296302

303+
# HIP requires device-capable variant functions
304+
if [[ "$ARGS" == *"hip"* ]]; then
305+
cd external/variant
306+
if [[ $(( $(git --version | cut -d '.' -f 2) > 35 )) == "1" ]]; then
307+
git apply --quiet ../patches/variant-hip.patch
308+
else
309+
git apply ../patches/variant-hip.patch
310+
fi
311+
cd -
312+
313+
# HIP also prefers new Kokkos.
314+
# TODO work something out if on HIP machines w/o internet
315+
cd external/parthenon
316+
git submodule update --remote external/Kokkos
317+
cd -
318+
fi
319+
297320
rm -rf build
298321
fi
299322
mkdir -p build

0 commit comments

Comments
 (0)