Skip to content

Commit

Permalink
Initial tests for OpenSBLI and also update other scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
gihanmudalige committed Feb 18, 2024
1 parent f464fa7 commit 583fd5c
Show file tree
Hide file tree
Showing 13 changed files with 176 additions and 169 deletions.
8 changes: 3 additions & 5 deletions apps/c/CloverLeaf/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export SOURCE_AMD_HIP=source_amd_rocm-5.4.3_pythonenv

#export AMOS=TRUE
#export DMOS=TRUE
export TELOS=TRUE
#export TELOS=TRUE
#export KOS=TRUE

<<comment
#<<comment

if [[ -v TELOS || -v KOS ]]; then

Expand Down Expand Up @@ -118,9 +118,7 @@ echo "All Intel classic complier based applications ---- PASSED"

fi

comment
#comment

if [[ -v TELOS ]]; then

Expand Down
2 changes: 1 addition & 1 deletion apps/c/CloverLeaf_3D/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export SOURCE_AMD_HIP=source_amd_rocm-5.4.3_pythonenv

#export AMOS=TRUE
#export DMOS=TRUE
export TELOS=TRUE
#export TELOS=TRUE
#export KOS=TRUE

if [[ -v TELOS || -v KOS ]]; then
Expand Down
4 changes: 3 additions & 1 deletion apps/c/CloverLeaf_3D_HDF5/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ export SOURCE_AMD_HIP=source_amd_rocm-5.4.3_pythonenv

#export AMOS=TRUE
#export DMOS=TRUE
export TELOS=TRUE
#export TELOS=TRUE
#export KOS=TRUE

#<<comment

if [[ -v TELOS || -v KOS ]]; then

Expand Down Expand Up @@ -164,6 +165,7 @@ rm perf_out
echo "All Intel SYCL complier based applications ---- PASSED"

fi
#comment

if [[ -v TELOS ]]; then

Expand Down
4 changes: 2 additions & 2 deletions apps/c/TeaLeaf/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export SOURCE_AMD_HIP=source_amd_rocm-5.4.3_pythonenv
#export AMOS=TRUE
#export DMOS=TRUE
#export TELOS=TRUE
export KOS=TRUE
#export KOS=TRUE

if [[ -v TELOS || -v KOS ]]; then

Expand Down Expand Up @@ -126,7 +126,7 @@ cd $OPS_INSTALL_PATH/c
source ../../scripts/$SOURCE_INTEL_SYCL
#make -j -B
make clean
make
make IEEE=1
cd $OPS_INSTALL_PATH/../apps/c/TeaLeaf

make clean
Expand Down
167 changes: 93 additions & 74 deletions apps/c/mblock/test.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
#!/bin/bash
set -e
cd ../../../ops/c
#<<COMMENT
cd $OPS_INSTALL_PATH/c

export SOURCE_INTEL=source_intel_2021.3_pythonenv
export SOURCE_PGI=source_pgi_nvhpc_23_pythonenv
export SOURCE_INTEL_SYCL=source_intel_2021.3_sycl_pythonenv
export SOURCE_AMD_HIP=source_amd_rocm-5.4.3_pythonenv

#export AMOS=TRUE
#export DMOS=TRUE
#export TELOS=TRUE
#export KOS=TRUE

#<<comment

if [[ -v TELOS || -v KOS ]]; then

#============================ Test with Intel Classic Compilers==========================================
echo "Testing Intel classic complier based applications ---- "
cd $OPS_INSTALL_PATH/c
source ../../scripts/$SOURCE_INTEL
#make -j -B
make clean
make -j
cd -
make
cd $OPS_INSTALL_PATH/../apps/c/mblock

make clean
rm -f .generated
make IEEE=1 -j
make IEEE=1
rm -f *.h5

#============================ Test mblock 2D With Intel Compilers==========================================================
echo '============> Running OpenMP'
KMP_AFFINITY=compact OMP_NUM_THREADS=20 ./mblock_openmp > mblock.out
grep "Total Wall time" mblock.out
Expand All @@ -33,13 +50,6 @@ grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*

echo '============> Running MPI_Inline with MPI+OpenMP'
export OMP_NUM_THREADS=2;$MPI_INSTALL_PATH/bin/mpirun -np 10 ./mblock_mpi_inline > mblock.out
grep "Total Wall time" mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*

echo '============> Running DEV_MPI'
$MPI_INSTALL_PATH/bin/mpirun -np 20 ./mblock_dev_mpi > mblock.out
grep "Total Wall time" mblock.out
Expand All @@ -54,20 +64,14 @@ grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*

echo '============> Running MPI_Inline'
export OMP_NUM_THREADS=1;$MPI_INSTALL_PATH/bin/mpirun -np 20 ./mblock_mpi_inline > mblock.out
grep "Total Wall time" mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*

#echo '============> Running MPI_Tiled'
#export OMP_NUM_THREADS=10;$MPI_INSTALL_PATH/bin/mpirun -np 2 numawrap2 ./mblock_mpi_tiled OPS_TILING OPS_TILING_MAXDEPTH=6 > mblock.out
#grep "Total Wall time" mblock.out
#grep "PASSED" mblock.out
#rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
#rm -f mblock.out *.h5 data*

if [[ -v CUDA_INSTALL_PATH ]]; then
echo '============> Running CUDA'
./mblock_cuda OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > mblock.out
grep "Total Wall time" mblock.out
Expand Down Expand Up @@ -96,55 +100,60 @@ rm -f mblock.out *.h5 data*
#grep "PASSED" mblock.out
#rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
#rm -f mblock.out *.h5 data*
fi

echo "All Intel classic complier based applications ---- PASSED"

echo '============> Running OpenCL on CPU'
./mblock_opencl OPS_CL_DEVICE=0 OPS_BLOCK_SIZE_X=512 OPS_BLOCK_SIZE_Y=1 > mblock.out
grep "Total Wall time" mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*
fi


echo '============> Running OpenCL on GPU'
./mblock_opencl OPS_CL_DEVICE=1 OPS_BLOCK_SIZE_X=32 OPS_BLOCK_SIZE_Y=4 > mblock.out
./mblock_opencl OPS_CL_DEVICE=1 OPS_BLOCK_SIZE_X=32 OPS_BLOCK_SIZE_Y=4 > mblock.out
grep "Total Wall time" mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*
if [[ -v TELOS ]]; then

#============================ Test with Intel SYCL Compilers==========================================
echo "Testing Intel SYCL complier based applications ---- "
cd $OPS_INSTALL_PATH/c
source ../../scripts/$SOURCE_INTEL_SYCL

make clean
make
cd $OPS_INSTALL_PATH/../apps/c/mblock

make clean
make IEEE=1 mblock_sycl mblock_mpi_sycl

echo '============> Running MPI+OpenCL on CPU'
$MPI_INSTALL_PATH/bin/mpirun -np 20 ./mblock_mpi_opencl OPS_CL_DEVICE=0 > mblock.out
$MPI_INSTALL_PATH/bin/mpirun -np 20 ./mblock_mpi_opencl OPS_CL_DEVICE=0 > mblock.out
echo '============> Running SYCL on CPU'
./mblock_sycl OPS_CL_DEVICE=0 OPS_BLOCK_SIZE_X=512 OPS_BLOCK_SIZE_Y=1 > mblock.out
grep "Total Wall time" mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*

echo '============> Running MPI+OpenCL on GPU'
$MPI_INSTALL_PATH/bin/mpirun -np 2 ./mblock_mpi_opencl OPS_CL_DEVICE=1 OPS_BLOCK_SIZE_X=32 OPS_BLOCK_SIZE_Y=4 > mblock.out
$MPI_INSTALL_PATH/bin/mpirun -np 2 ./mblock_mpi_opencl OPS_CL_DEVICE=1 OPS_BLOCK_SIZE_X=32 OPS_BLOCK_SIZE_Y=4 > mblock.out
echo '============> Running MPI+SYCL on CPU'
$MPI_INSTALL_PATH/bin/mpirun -np 10 ./mblock_mpi_sycl OPS_CL_DEVICE=0 > mblock.out
grep "Total Wall time" mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*

echo "All Intel complied applications PASSED : Moving no to PGI Compiler Tests "
#exit
echo "All Intel SYCL complier based applications ---- PASSED"

cd -
#COMMENT
source ../../scripts/$SOURCE_PGI
fi
#comment

if [[ -v TELOS ]]; then

#============================ Test with PGI Compilers==========================================
echo "Testing PGI/NVHPC complier based applications ---- "
cd $OPS_INSTALL_PATH/c
source ../../scripts/$SOURCE_PGI
make clean
make
cd -
make clean
make IEEE=1

cd $OPS_INSTALL_PATH/../apps/c/mblock
make clean
make IEEE=1 mblock_dev_seq mblock_dev_mpi mblock_seq mblock_openmp mblock_mpi \
mblock_mpi_openmp mblock_ompoffload mblock_mpi_ompoffload

#============================ Test mblock 2D With PGI Compilers==========================================================
echo '============> Running OpenMP'
KMP_AFFINITY=compact OMP_NUM_THREADS=20 ./mblock_openmp > mblock.out
grep "Total Wall time" mblock.out
Expand Down Expand Up @@ -189,6 +198,8 @@ rm -f mblock.out *.h5 data*
#rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
#rm -f mblock.out *.h5 data*

if [[ -v CUDA_INSTALL_PATH ]]; then
make mblock_cuda mblock_mpi_cuda

echo '============> Running CUDA'
./mblock_cuda OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > mblock.out
Expand Down Expand Up @@ -218,49 +229,57 @@ rm -f mblock.out *.h5 data*
#rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
#rm -f mblock.out *.h5 data*

fi

#echo '============> Running OpenCL on CPU'
#./mblock_opencl OPS_CL_DEVICE=0 OPS_BLOCK_SIZE_X=512 OPS_BLOCK_SIZE_Y=1 > mblock.out
#grep "Total Wall time" mblock.out
#grep "PASSED" mblock.out
#rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
#rm -f mblock.out *.h5 data*


echo '============> Running OpenCL on GPU'
./mblock_opencl OPS_CL_DEVICE=1 OPS_BLOCK_SIZE_X=32 OPS_BLOCK_SIZE_Y=4 > mblock.out
./mblock_opencl OPS_CL_DEVICE=1 OPS_BLOCK_SIZE_X=32 OPS_BLOCK_SIZE_Y=4 > mblock.out
echo '============> Running OMPOFFLOAD'
./mblock_ompoffload OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > mblock.out
grep "Total Wall time" mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*

#echo '============> Running MPI+OpenCL on CPU'
#$MPI_INSTALL_PATH/bin/mpirun -np 20 ./mblock_mpi_opencl OPS_CL_DEVICE=0 > mblock.out
#$MPI_INSTALL_PATH/bin/mpirun -np 20 ./mblock_mpi_opencl OPS_CL_DEVICE=0 > mblock.out
#grep "Total Wall time" mblock.out


echo '============> Running MPI+OpenCL on GPU'
$MPI_INSTALL_PATH/bin/mpirun -np 2 ./mblock_mpi_opencl OPS_CL_DEVICE=1 OPS_BLOCK_SIZE_X=32 OPS_BLOCK_SIZE_Y=4 > mblock.out
$MPI_INSTALL_PATH/bin/mpirun -np 2 ./mblock_mpi_opencl OPS_CL_DEVICE=1 OPS_BLOCK_SIZE_X=32 OPS_BLOCK_SIZE_Y=4 > mblock.out
echo '============> Running MPI+OMPOFFLOAD'
$MPI_INSTALL_PATH/bin/mpirun -np 2 ./mblock_mpi_ompoffload OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > mblock.out
grep "Total Wall time" mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*

echo '============> Running OpenACC'
./mblock_openacc OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > mblock.out
echo "All PGI complier based applications ---- PASSED"

fi


if [[ -v AMOS ]]; then

echo "Testing AMD HIP complier based applications ---- "
cd $OPS_INSTALL_PATH/c
source ../../scripts/$SOURCE_AMD_HIP
#make -j -B
make clean
make
cd $OPS_INSTALL_PATH/../apps/c/mblock

make clean
rm -f .generated
#make IEEE=1 -j
make IEEE=1 mblock_hip mblock_mpi_hip #cloverleaf_hip_tiled cloverleaf_mpi_hip_tiled

echo '============> Running HIP'
./mblock_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > mblock.out
grep "Total Wall time" mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*

echo '============> Running MPI+OpenACC'
$MPI_INSTALL_PATH/bin/mpirun -np 2 ./mblock_mpi_openacc OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > mblock.out
echo '============> Running MPI+HIP'
$MPI_INSTALL_PATH/bin/mpirun -np 2 ./mblock_mpi_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > mblock.out
grep "Total Wall time" mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
rm -f mblock.out *.h5 data*
echo "All AMD HIP complier based applications ---- PASSED"

fi

echo "All PGI complied applications PASSED : Exiting Test Script "
echo "---------- Exiting Test Script "
Loading

0 comments on commit 583fd5c

Please sign in to comment.