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 c5343ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 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
12 changes: 6 additions & 6 deletions benchmark/utils/formats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -210,20 +210,20 @@ 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)
{
if (data.size[0] == 0) {
if (data.size[0] == 0 || FLAGS_ell_imbalance_limit < 0) {
return;
}
std::vector<gko::size_type> row_lengths(data.size[0]);
for (auto nz : data.nonzeros) {
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 c5343ab

Please sign in to comment.