Skip to content

Commit

Permalink
Tpetra::CrsGraph: Improve #601 fix
Browse files Browse the repository at this point in the history
@trilinos/tpetra Clear nonlocals_ after globalAssemble().  This avoids
redundant work at subsequent fillComplete() calls on the graph.
  • Loading branch information
Mark Hoemmen committed Sep 13, 2016
1 parent d96723d commit e60bd5d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/tpetra/core/src/Tpetra_CrsGraph_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3364,6 +3364,13 @@ namespace Tpetra {
this->doImport (oneToOneGraph, importToOrig, Tpetra::INSERT);
}

// It's safe now to clear out nonlocals_, since we've already
// committed side effects to *this. The standard idiom for
// clearing a Container like std::map, is to swap it with an empty
// Container and let the swapped Container fall out of scope.
decltype (nonlocals_) newNonlocals;
std::swap (nonlocals_, newNonlocals);

checkInternalState ();
}

Expand Down

0 comments on commit e60bd5d

Please sign in to comment.