Skip to content

Commit

Permalink
Add amrex and amrex-cuda tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PlatinumCD committed Apr 27, 2022
1 parent c77b428 commit cce10ec
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 3 deletions.
1 change: 1 addition & 0 deletions E4S-cuda/amrex-cuda
7 changes: 7 additions & 0 deletions validation_tests/amrex-cuda/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
rm -rf Amr Basic Blueprint EB \
ForkJoin FortranInterface \
GPU LinearSolvers ML MUI \
Particles SDC SENSEI SWFFT \
cmake CMakeLists.txt build \
plt* plot* amrex-tutorials
18 changes: 18 additions & 0 deletions validation_tests/amrex-cuda/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -e
. ./setup.sh
set -x

git clone https://github.com/AMReX-Codes/amrex-tutorials.git
mv amrex-tutorials/ExampleCodes/* .

mkdir -p build
cd build

CUDAFLAG=""
if [ $USECUDA = 1 ];then
CUDAFLAG="-DAMReX_GPU_BACKEND=CUDA"
fi

cmake -DAMReX_ROOT=${AMREX_ROOT} ${CUDAFLAG} ..
make -j16
cd -
10 changes: 10 additions & 0 deletions validation_tests/amrex-cuda/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -e
./build/Amr/Advection_AmrCore/Advection_AmrCore ./build/Amr/Advection_AmrCore/inputs
./build/Basic/HeatEquation_EX0_C/HeatEquation_EX0_C build/Basic/HeatEquation_EX0_C/inputs
./build/Basic/HelloWorld_C/HelloWorld_C
./build/Basic/main_C/main_C
./build/LinearSolvers/ABecLaplacian_C/ABecLaplacian_C build/LinearSolvers/ABecLaplacian_C/inputs
./build/LinearSolvers/NodalPoisson/NodalPoisson build/LinearSolvers/NodalPoisson/inputs-rt
./build/LinearSolvers/NodeTensorLap/NodeTensorLap
./build/GPU/CNS/RT/GPU_CNS_RT ./build/GPU/CNS/RT/inputs-rt
./build/GPU/CNS/Sod/GPU_CNS_Sod ./build/GPU/CNS/Sod/inputs-rt
20 changes: 20 additions & 0 deletions validation_tests/amrex-cuda/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
. ../../setup.sh

THISDIR=`basename "$PWD"`
USECUDA=0
USEROCM=0

if [ "$THISDIR" = "amrex-cuda" ];then
spackLoadUnique amrex+cuda #cuda_arch=80
USECUDA=1
elif [ "$THISDIR" = "amrex-rocm" ];then
spackLoadUnique amrex+rocm
USEROCM=1
else
spackLoadUnique amrex~rocm~cuda
fi

if ! command -v cmake >/dev/null 2>&1 ; then
spackLoadUnique [email protected]:
fi
7 changes: 7 additions & 0 deletions validation_tests/amrex/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
rm -rf Amr Basic Blueprint EB \
ForkJoin FortranInterface \
GPU LinearSolvers ML MUI \
Particles SDC SENSEI SWFFT \
cmake CMakeLists.txt build \
plt* plot* amrex-tutorials
13 changes: 13 additions & 0 deletions validation_tests/amrex/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash -e
. ./setup.sh
set -x

git clone https://github.com/AMReX-Codes/amrex-tutorials.git
mv amrex-tutorials/ExampleCodes/* .

mkdir -p build
cd build

cmake -DAMReX_ROOT=${AMREX_ROOT} ..
make -j16
cd -
9 changes: 7 additions & 2 deletions validation_tests/amrex/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/bash -e
. ./setup.sh
spackTestRun ${AMREX_HASH}
./build/Amr/Advection_AmrCore/Advection_AmrCore ./build/Amr/Advection_AmrCore/inputs
./build/Basic/HeatEquation_EX0_C/HeatEquation_EX0_C build/Basic/HeatEquation_EX0_C/inputs
./build/Basic/HelloWorld_C/HelloWorld_C
./build/Basic/main_C/main_C
./build/LinearSolvers/ABecLaplacian_C/ABecLaplacian_C build/LinearSolvers/ABecLaplacian_C/inputs
./build/LinearSolvers/NodalPoisson/NodalPoisson build/LinearSolvers/NodalPoisson/inputs-rt
./build/LinearSolvers/NodeTensorLap/NodeTensorLap
19 changes: 18 additions & 1 deletion validation_tests/amrex/setup.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
#!/bin/bash
. ../../setup.sh
spackLoadUnique amrex

THISDIR=`basename "$PWD"`
USECUDA=0
USEROCM=0

if [ "$THISDIR" = "amrex-cuda" ];then
spackLoadUnique amrex+cuda #cuda_arch=80
USECUDA=1
elif [ "$THISDIR" = "amrex-rocm" ];then
spackLoadUnique amrex+rocm
USEROCM=1
else
spackLoadUnique amrex~rocm~cuda
fi

if ! command -v cmake >/dev/null 2>&1 ; then
spackLoadUnique [email protected]:
fi

0 comments on commit cce10ec

Please sign in to comment.