Skip to content

Tpetra row count post Export

Mark Hoemmen edited this page Feb 8, 2019 · 1 revision

If you're not sure how many entries the graph or matrix will need per row, and the graph or matrix results from an Export, you can use the same Export with a Vector (ADD CombineMode) to get accurate counts.

  1. Create shared Map Vector v_shared_plus_owned.
  2. v_shared[lclRow] = the number of entries in local row lclRow of the shared graph / matrix
  3. Create owned (nonoverlapping) Map Vector v_owned.
  4. v_owned[lclRow] = the number of entries in local row lclRow of the pre-Export owned graph / matrix
  5. v_owned.doExport(v_shared_plus_owned, exporter, Tpetra::ADD);
  6. Now v_owned[lclRow] has the number of entries required for local row lclRow of the post-Export owned graph / matrix (not counting duplicates; see #4278, #4279, #4280, and #4281).
Clone this wiki locally