graph.reset();
column_space_map = std::make_unique<Epetra_Map>(col_map);
+ AssertThrow((TrilinosWrappers::max_my_gid(row_map) -
+ TrilinosWrappers::min_my_gid(row_map)) *
+ std::uint64_t(n_entries_per_row) <
+ std::numeric_limits<int>::max(),
+ ExcMessage("The TrilinosWrappers use Epetra internally which "
+ "uses 'signed int' to represent local indices. "
+ "Therefore, only 2,147,483,647 nonzero matrix "
+ "entries can be stored on a single process, "
+ "but you are requesting more than that. "
+ "If possible, use more MPI processes."));
+
+
// for more than one processor, need to specify only row map first and
// let the matrix entries decide about the column map (which says which
// columns are present in the matrix, not to be confused with the
TrilinosWrappers::n_global_elements(row_map));
column_space_map = std::make_unique<Epetra_Map>(col_map);
+
+ // Translate the vector of row lengths into one that only stores
+ // those entries that related to the locally stored rows of the matrix:
std::vector<int> local_entries_per_row(
TrilinosWrappers::max_my_gid(row_map) -
TrilinosWrappers::min_my_gid(row_map));
local_entries_per_row[i] =
n_entries_per_row[TrilinosWrappers::min_my_gid(row_map) + i];
+ AssertThrow(std::accumulate(local_entries_per_row.begin(),
+ local_entries_per_row.end(),
+ std::uint64_t(0)) <
+ std::numeric_limits<int>::max(),
+ ExcMessage("The TrilinosWrappers use Epetra internally which "
+ "uses 'signed int' to represent local indices. "
+ "Therefore, only 2,147,483,647 nonzero matrix "
+ "entries can be stored on a single process, "
+ "but you are requesting more than that. "
+ "If possible, use more MPI processes."));
+
if (row_map.Comm().NumProc() > 1)
graph = std::make_unique<Epetra_FECrsGraph>(
Copy, row_map, local_entries_per_row.data(), false
n_entries_per_row[row - first_row] =
static_cast<int>(sp.row_length(row));
+ AssertThrow(std::accumulate(n_entries_per_row.begin(),
+ n_entries_per_row.end(),
+ std::uint64_t(0)) <
+ std::numeric_limits<int>::max(),
+ ExcMessage("The TrilinosWrappers use Epetra internally which "
+ "uses 'signed int' to represent local indices. "
+ "Therefore, only 2,147,483,647 nonzero matrix "
+ "entries can be stored on a single process, "
+ "but you are requesting more than that. "
+ "If possible, use more MPI processes."));
+
if (row_map.Comm().NumProc() > 1)
graph = std::make_unique<Epetra_FECrsGraph>(Copy,
row_map,