Skip to content

Commit

Permalink
Fix GCC GPU running on Delta by reverting to host-side buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Prather committed Nov 30, 2023
1 parent 10ae54d commit 712de12
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ set(PARTHENON_LINT_DEFAULT OFF CACHE BOOL "KHARMA Override")
set(PARTHENON_DISABLE_HDF5_COMPRESSION OFF CACHE BOOL "KHARMA Override")
# Don't build sparse (selectively-allocated) variable support
set(PARTHENON_DISABLE_SPARSE ON CACHE BOOL "KHARMA Override")
# Set to move MPI buffers to host; slower but less crashy
# Favor setting this per-machine in machines/
set(PARTHENON_ENABLE_HOST_COMM_BUFFERS OFF CACHE BOOL "KHARMA Override")

# Parthenon internal build options
set(BUILD_TESTING OFF CACHE BOOL "KHARMA Override")
Expand Down
15 changes: 10 additions & 5 deletions machines/delta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ then
HOST_ARCH=ZEN3
DEVICE_ARCH=AMPERE80
MPI_EXE=mpirun
NPROC=64

module purge
module load cmake

if [[ $ARGS == *"cuda"* ]]
then
Expand All @@ -23,8 +25,11 @@ then
MPI_EXTRA_ARGS="--map-by ppr:4:node:pe=16"
MPI_NUM_PROCS=4

# Device-side buffers are broken on some Nvidia machines
EXTRA_FLAGS="-DPARTHENON_ENABLE_HOST_COMM_BUFFERS=ON $EXTRA_FLAGS"

# Load common GPU modules
module load modtree/gpu hdf5 cmake
module load modtree/gpu cmake

if [[ $ARGS == *"latest"* ]]; then
# nvhpc only on request, MPI crashes
Expand All @@ -35,13 +40,13 @@ then
C_NATIVE=gcc
CXX_NATIVE=g++
else
module load nvhpc
#C_NATIVE=nvc
#CXX_NATIVE=nvc++
module load nvhpc_latest/22.11 openmpi
C_NATIVE=nvc
CXX_NATIVE=nvc++
fi
else
# CPU Compile
module load modtree/cpu gcc hdf5 cmake
module load modtree/cpu gcc
MPI_NUM_PROCS=1
fi
fi
5 changes: 2 additions & 3 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ if [[ "$(which python3 2>/dev/null)" == *"conda"* ]]; then
echo
echo "make.sh note:"
echo "It looks like you have Anaconda loaded."
echo "Anaconda loads a serial version of HDF5 which may make this compile impossible."
echo "If you run into trouble, deactivate your environment with 'conda deactivate'"
echo "This is usually okay, but double-check the line 'Found MPI_CXX:' below!"
fi
# Save arguments if we've changed them
# Used in run.sh for loading the same modules/etc.
Expand Down Expand Up @@ -314,7 +313,7 @@ if [[ "$ARGS" == *"clean"* ]]; then
-DKokkos_ENABLE_CUDA=$ENABLE_CUDA \
-DKokkos_ENABLE_SYCL=$ENABLE_SYCL \
-DKokkos_ENABLE_HIP=$ENABLE_HIP \
"$EXTRA_FLAGS"
$EXTRA_FLAGS

if [[ "$ARGS" == *"dryrun"* ]]; then
set +x
Expand Down

0 comments on commit 712de12

Please # to comment.