Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intial commit of the automated testing scripts #150

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
978 changes: 978 additions & 0 deletions TestScripts/lpi-deck/lpi_2d_F6_test

Large diffs are not rendered by default.

987 changes: 987 additions & 0 deletions TestScripts/lpi-deck/lpi_2d_F6_test-nx12

Large diffs are not rendered by default.

987 changes: 987 additions & 0 deletions TestScripts/lpi-deck/lpi_2d_F6_test-nx24

Large diffs are not rendered by default.

987 changes: 987 additions & 0 deletions TestScripts/lpi-deck/lpi_2d_F6_test-nx288

Large diffs are not rendered by default.

987 changes: 987 additions & 0 deletions TestScripts/lpi-deck/lpi_2d_F6_test-nx48

Large diffs are not rendered by default.

987 changes: 987 additions & 0 deletions TestScripts/lpi-deck/lpi_2d_F6_test-nx864

Large diffs are not rendered by default.

987 changes: 987 additions & 0 deletions TestScripts/lpi-deck/lpi_2d_F6_test-nx96

Large diffs are not rendered by default.

978 changes: 978 additions & 0 deletions TestScripts/lpi-deck/lpi_2d_F6_test.original

Large diffs are not rendered by default.

231 changes: 231 additions & 0 deletions TestScripts/vpic-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
#!/bin/bash

#SBATCH -N 1
#SBATCH -t 4:00:00
#SBATCH --output=vpic-build-log.txt

src_dir=/users/matsekh/VPIC/vpic-master
builds=/lustre/scratch5/.mdt0/matsekh/VPIC/test-builds
mkdir -p $builds
openmp=$builds/openmp
pthreads=$builds/pthreads

### Build weak and strong scaling lpi_2d_F6_test input decks ###
function lpi_deck(){
$1/bin/vpic $2/lpi-deck/lpi_2d_F6_test # strong scaling deck
$1/bin/vpic $2/lpi-deck/lpi_2d_F6_test-nx12 # weak scaling decks
$1/bin/vpic $2/lpi-deck/lpi_2d_F6_test-nx24
$1/bin/vpic $2/lpi-deck/lpi_2d_F6_test-nx48
$1/bin/vpic $2/lpi-deck/lpi_2d_F6_test-nx96
$1/bin/vpic $2/lpi-deck/lpi_2d_F6_test-nx288
$1/bin/vpic $2/lpi-deck/lpi_2d_F6_test-nx864
}

### Configure VPIC cmake ###
function vpic_cmake(){
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_INTEGRATED_TESTS=OFF \
-DUSE_V4_AVX=ON \
-DUSE_V4_AVX2=ON \
-DUSE_V8_AVX=ON \
-DUSE_V8_AVX2=ON \
-DCMAKE_C_COMPILER=cc \
-DCMAKE_CXX_COMPILER=CC \
-DCMAKE_C_FLAGS="-O3 -dynamic -craype-verbose" \
-DCMAKE_CXX_FLAGS="-O3 -dynamic -craype-verbose" \
-DCMAKE_EXE_LINKER_FLAGS="-dynamic" \
-DUSE_PTHREADS=$2 \
-DUSE_OPENMP=$3 \
-DUSE_LEGACY_SORT=$4 \
$1
}

# PrgEnv-cray, OpenMP, TSORT
build_dir=$openmp/cray/tsort
mkdir -p $build_dir
cd $build_dir
cmake_pthreads="OFF"
cmake_openmp="ON"
cmake_sort="TSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-cray, OpenMP, LSORT
build_dir=$openmp/cray/lsort
mkdir -p $build_dir
cd $build_dir
cmake_pthreads="OFF"
cmake_openmp="ON"
cmake_sort="LSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-gnu, OpenMP, TSORT
build_dir=$openmp/gnu/tsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-gnu
cmake_pthreads="OFF"
cmake_openmp="ON"
cmake_sort="TSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-gnu, OpenMP, LSORT
build_dir=$openmp/gnu/lsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-gnu
cmake_pthreads="OFF"
cmake_openmp="ON"
cmake_sort="LSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-aocc, OpenMP, TSORT
build_dir=$openmp/aocc/tsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-aocc
cmake_pthreads="OFF"
cmake_openmp="ON"
cmake_sort="TSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-aocc, OpenMP, LSORT
build_dir=$openmp/aocc/lsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-aocc
cmake_pthreads="OFF"
cmake_openmp="ON"
cmake_sort="LSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-intel, OpenMP, TSORT
build_dir=$openmp/intel/tsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-intel
cmake_pthreads="OFF"
cmake_openmp="ON"
cmake_sort="TSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-intel, OpenMP, LSORT
build_dir=$openmp/intel/lsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-intel
cmake_pthreads="OFF"
cmake_openmp="ON"
cmake_sort="LSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-cray, PTHREADS, TSORT
build_dir=$pthreads/cray/tsort
mkdir -p $build_dir
cd $build_dir
cmake_pthreads="ON"
cmake_openmp="OFF"
cmake_sort="TSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-cray, PTHREADS, LSORT
build_dir=$pthreads/cray/lsort
mkdir -p $build_dir
cd $build_dir
cmake_pthreads="ON"
cmake_openmp="OFF"
cmake_sort="LSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-gnu, PTHREADS, TSORT
build_dir=$pthreads/gnu/tsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-gnu
cmake_pthreads="ON"
cmake_openmp="OFF"
cmake_sort="TSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-gnu, PTHREADS, LSORT
build_dir=$pthreads/gnu/lsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-gnu
cmake_pthreads="ON"
cmake_openmp="OFF"
cmake_sort="LSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-aocc, PTHREADS, TSORT
build_dir=$pthreads/aocc/tsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-aocc
cmake_pthreads="ON"
cmake_openmp="OFF"
cmake_sort="TSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-aocc, PTHREADS, LSORT
build_dir=$pthreads/aocc/lsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-aocc
cmake_pthreads="ON"
cmake_openmp="OFF"
cmake_sort="LSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-intel, PTHREADS, TSORT
build_dir=$pthreads/intel/tsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-intel
cmake_pthreads="ON"
cmake_openmp="OFF"
cmake_sort="TSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

# PrgEnv-intel, PTHREADS, LSORT
build_dir=$pthreads/intel/lsort
mkdir -p $build_dir
cd $build_dir
module swap PrgEnv-cray PrgEnv-intel
cmake_pthreads="ON"
cmake_openmp="OFF"
cmake_sort="LSORT"
vpic_cmake $src_dir $cmake_pthreads $cmake_openmp $cmake_sort
make
lpi_deck $build_dir $src_dir

109 changes: 109 additions & 0 deletions TestScripts/vpic-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!/bin/bash

master=$HOME/VPIC/vpic-master
scripts=$master/NewTestScripts
scratch=/lustre/scratch5/.mdt0/matsekh/VPIC
builds=$scratch/test-builds
results=$scratch/NewTestResults

function vpic_benchmark(){

prg_env=$1
dir_path=$2

# set up directory tree
test_dir=$results/$dir_path
mkdir -p $test_dir
cd $test_dir
mkdir -p strong
mkdir -p thread
mkdir -p weak
build_dir=$builds/$dir_path

# set up strong scaling test
cd $test_dir/strong
deck=$build_dir/lpi_2d_F6_test.Linux
# launch strong scaling test
sbatch -N 1 -t 10:00:00 $scripts/vpic_strong_scaling.sh $prg_env $deck

# set up thread scaling test (const cpu)
cd $test_dir/thread
deck=$build_dir/lpi_2d_F6_test.Linux
# launch thread scaling test (const cpu)
sbatch -N 1 -t 10:00:00 $scripts/vpic_thread_scaling.sh $prg_env $deck

# set up weak scaling test
cd $test_dir/weak
deck1=$build_dir/lpi_2d_F6_test-nx864.Linux
deck2=$build_dir/lpi_2d_F6_test-nx288.Linux
deck3=$build_dir/lpi_2d_F6_test-nx96.Linux
deck4=$build_dir/lpi_2d_F6_test-nx48.Linux
deck5=$build_dir/lpi_2d_F6_test-nx24.Linux
deck6=$build_dir/lpi_2d_F6_test-nx12.Linux
# launch weak scaling test
sbatch -N 1 -t 10:00:00 $scripts/vpic_weak_scaling.sh $prg_env $deck1 $deck2 $deck3 $deck4 $deck5 $deck6
}

prog_env="cray"
bench_path=openmp/cray/tsort
vpic_benchmark $prog_env $bench_path

prog_env="cray"
bench_path=openmp/cray/lsort
vpic_benchmark $prog_env $bench_path

prog_env="aocc"
bench_path=openmp/aocc/tsort
vpic_benchmark $prog_env $bench_path

prog_env="aocc"
bench_path=openmp/aocc/lsort
vpic_benchmark $prog_env $bench_path

prog_env="gnu"
bench_path=openmp/gnu/tsort
vpic_benchmark $prog_env $bench_path

prog_env="gnu"
bench_path=openmp/gnu/lsort
vpic_benchmark $prog_env $bench_path

prog_env="intel"
bench_path=openmp/intel/tsort
vpic_benchmark $prog_env $bench_path

prog_env="intel"
bench_path=openmp/intel/lsort
vpic_benchmark $prog_env $bench_path

prog_env="cray"
bench_path=pthreads/cray/tsort
vpic_benchmark $prog_env $bench_path

prog_env="cray"
bench_path=pthreads/cray/lsort
vpic_benchmark $prog_env $bench_path

prog_env="aocc"
bench_path=pthreads/aocc/tsort
vpic_benchmark $prog_env $bench_path

prog_env="aocc"
bench_path=pthreads/aocc/lsort
vpic_benchmark $prog_env $bench_path

prog_env="gnu"
bench_path=pthreads/gnu/tsort
vpic_benchmark $prog_env $bench_path

prog_env="gnu"
bench_path=pthreads/gnu/lsort
vpic_benchmark $prog_env $bench_path

prog_env="intel"
bench_path=pthreads/intel/tsort
vpic_benchmark $prog_env $bench_path

prog_env="intel"
bench_path=pthreads/intel/lsort
vpic_benchmark $prog_env $bench_path
34 changes: 34 additions & 0 deletions TestScripts/vpic_strong_scaling.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

prog_env=$1 # programming environment
code=$2 # executable

nn=1 # number of nodes
threads=8 # number of cpu threads
p_scale=2 # scaling constant
log=./log-strong # log file

if [ $prog_env = "aocc" ]
then
module swap PrgEnv-cray PrgEnv-aocc
elif [ $prog_env = "gnu" ]
then
module swap PrgEnv-cray PrgEnv-gnu
elif [ $prog_env = "intel" ]
then
module swap PrgEnv-cray PrgEnv-intel
fi

module list
cc --version
CC --version
lscpu
#env

let np=32\*$nn # number of processes / ranks
while [ $np -ge 1 ]
do
srun -n $np -c $threads --cpu-bind=cores $code --tpp $threads >> $log

let np=$np/$p_scale
done
Loading