Skip to content

Commit

Permalink
[Graph]: check error in SpMM.
Browse files Browse the repository at this point in the history
  • Loading branch information
zheng-da committed Aug 11, 2017
1 parent 42d32a5 commit 4b00fe8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flash-graph/fg_sparse_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,12 @@ class fg_sparse_asym_matrix: public fm::sparse_matrix

virtual fm::matrix_io_generator::ptr create_io_gen(
const fm::detail::matrix_store &in) const {
assert(!in.is_wide());
if (in.is_wide()) {
BOOST_LOG_TRIVIAL(error) << boost::format(
"The input matrix has unexpected shape: %1% x %2%")
% in.get_num_rows() % in.get_num_cols();
return fm::matrix_io_generator::ptr();
}
size_t num_rows = in.get_portion_size().first;
size_t num_brows = std::min((size_t) fm::matrix_conf.get_rb_io_size(),
num_rows / fm::matrix_conf.get_row_block_size());
Expand Down

0 comments on commit 4b00fe8

Please sign in to comment.