Commit abbd5c74 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Simplified run_benchmark script

parent ff064b2c
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -2,14 +2,15 @@

set -e

NCPUS="$SLURM_CPUS_PER_TASK"
# set fallback when not running under Slurm
if [[ "$NCPUS" == "" ]]; then
    NCPUS=12
fi
# maximum number of CPU cores available on the system
# (this respects even $SLURM_CPUS_PER_TASK when executed under Slurm)
NCPUS=$(nproc)

function run_benchmark()
{
    if (( $omp_threads > $NCPUS )); then
        return
    fi
    echo "benchmark = $benchmark, omp_threads = $omp_threads, mesh = $(basename $mesh_file)"

    export OMP_NUM_THREADS=$omp_threads
@@ -32,7 +33,7 @@ for benchmark in measures surfaces; do
    for mesh_type in mrizka cube1m; do
    for id in 1 2 3 4 5; do
    [[ "$mesh_type" == "mrizka" ]] && id="$id.rcm"
    for omp_threads in 1 2 4 6 8 $NCPUS; do
    for omp_threads in 1 2 4 6 8 12; do
        mesh_file="./meshes/${mesh_type}_$id.vtk"
        run_benchmark
    done