Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
Co-authored-by: Yuhsiang Tsai <yhmtsai@gmail.com>
  • Loading branch information
upsj and yhmtsai committed Jul 6, 2021
1 parent ba0c3f4 commit 78213a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion benchmark/run_all_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
}
Expand Down
4 changes: 2 additions & 2 deletions benchmark/utils/formats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ std::shared_ptr<csr::strategy_type> 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<etype> &data)
Expand All @@ -222,8 +223,7 @@ void check_ell_admissibility(const gko::matrix_data<etype> &data)
row_lengths[nz.row]++;
}
auto max_len = *std::max_element(row_lengths.begin(), row_lengths.end());
auto avg_len =
std::max<gko::size_type>(data.nonzeros.size() / data.size[0], 1);
auto avg_len = data.nonzeros.size() / std::max<double>(data.size[0], 1);
if (max_len / avg_len > FLAGS_ell_imbalance_limit) {
throw gko::Error(__FILE__, __LINE__,
"Matrix exceeds ELL imbalance limit");
Expand Down

0 comments on commit 78213a6

Please sign in to comment.