diff --git a/benchmark/run_all_benchmarks.sh b/benchmark/run_all_benchmarks.sh index 0220496399d..db7fa5bb5ca 100644 --- a/benchmark/run_all_benchmarks.sh +++ b/benchmark/run_all_benchmarks.sh @@ -21,6 +21,11 @@ if [ ! "${REPETITIONS}" ]; then echo "REPETITIONS environment variable not set - assuming ${REPETITIONS}" 1>&2 fi +if [ ! "${SOLVER_REPETITIONS}" ]; then + SOLVER_REPETITIONS=1 + echo "SOLVER_REPETITIONS environment variable not set - assuming ${SOLVER_REPETITIONS}" 1>&2 +fi + if [ ! "${SEGMENTS}" ]; then echo "SEGMENTS environment variable not set - running entire suite" 1>&2 SEGMENTS=1 @@ -253,7 +258,7 @@ run_solver_benchmarks() { --gpu_timer=${GPU_TIMER} \ --jacobi_max_block_size=${SOLVERS_JACOBI_MAX_BS} --device_id="${DEVICE_ID}" \ --gmres_restart="${SOLVERS_GMRES_RESTART}" \ - --repetitions="${REPETITIONS}" \ + --repetitions="${SOLVER_REPETITIONS}" \ <"$1.imd" 2>&1 >"$1" keep_latest "$1" "$1.bkp" "$1.bkp2" "$1.imd" } diff --git a/benchmark/utils/formats.hpp b/benchmark/utils/formats.hpp index 208b5612139..bbce4f25cf2 100644 --- a/benchmark/utils/formats.hpp +++ b/benchmark/utils/formats.hpp @@ -153,9 +153,9 @@ std::string format_command = // the formats command-line argument DEFINE_string(formats, "coo", formats::format_command.c_str()); -DEFINE_uint64( - ell_imbalance_limit, 100, - "Maximal storage overhead above which ELL benchmarks will be skipped"); +DEFINE_int64(ell_imbalance_limit, 100, + "Maximal storage overhead above which ELL benchmarks will be " + "skipped. Negative values mean no limit."); namespace formats { @@ -210,11 +210,12 @@ std::shared_ptr create_gpu_strategy( /** * Checks whether the given matrix data exceeds the ELL imbalance limit set by * the --ell_imbalance_limit flag + * * @throws gko::Error if the imbalance limit is exceeded */ void check_ell_admissibility(const gko::matrix_data &data) { - if (data.size[0] == 0) { + if (data.size[0] == 0 || FLAGS_ell_imbalance_limit < 0) { return; } std::vector row_lengths(data.size[0]); @@ -222,8 +223,7 @@ void check_ell_admissibility(const gko::matrix_data &data) row_lengths[nz.row]++; } auto max_len = *std::max_element(row_lengths.begin(), row_lengths.end()); - auto avg_len = - std::max(data.nonzeros.size() / data.size[0], 1); + auto avg_len = data.nonzeros.size() / std::max(data.size[0], 1); if (max_len / avg_len > FLAGS_ell_imbalance_limit) { throw gko::Error(__FILE__, __LINE__, "Matrix exceeds ELL imbalance limit");