Skip to content

Commit

Permalink
Merge pull request #2 from trilinos/tpetra-assembly
Browse files Browse the repository at this point in the history
Tpetra: Missed ghosting
  • Loading branch information
mhoemmen authored Jul 2, 2019
2 parents 5d8fad1 + a9f2a42 commit 1f94f9b
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ executeTotalElementLoopSPKokkos_
// -- https://trilinos.org/docs/dev/packages/tpetra/doc/html/classTpetra_1_1Map.html#a24490b938e94f8d4f31b6c0e4fc0ff77
RCP<const map_type> row_map =
rcp(new map_type(GO_INVALID, mesh.getOwnedNodeGlobalIDs(), 0, comm));
RCP<const map_type> owned_element_map = rcp(new map_type(GO_INVALID, mesh.getOwnedElementGlobalIDs(), 0, comm));
RCP<const map_type> ghost_element_map = rcp(new map_type(GO_INVALID, mesh.getGhostElementGlobalIDs(), 0, comm));
RCP<const import_type> elementImporter = rcp(new import_type(owned_element_map,ghost_element_map));

if(opts.verbose) row_map->describe(out);

Expand Down Expand Up @@ -491,6 +494,16 @@ executeTotalElementLoopSPKokkos_
// Print out the crs_graph in detail...
if(opts.verbose) crs_graph->describe(out, Teuchos::VERB_EXTREME);

// Simulated Ghosting of Material State
// -------------------
{
GhostState state(elementImporter,opts.numStateDoublesPerElement);
TimeMonitor timer(*TimeMonitor::getNewTimer("3.1) Ghosting Material State (Matrix)"));
state.doGhost();

}


// Matrix Fill
// -------------------
// In this example, we're using a simple stencil of values for the stiffness matrix:
Expand Down Expand Up @@ -530,7 +543,7 @@ executeTotalElementLoopSPKokkos_
// Similarly to the Graph construction above, we loop over both local and global
// elements and insert rows for only the locally owned rows.
//
RCP<TimeMonitor> timerElementLoopMemory = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("3.1) ElementLoop (Memory)")));
RCP<TimeMonitor> timerElementLoopMemory = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("3.2) ElementLoop (Memory)")));

RCP<crs_matrix_type> crs_matrix = rcp(new crs_matrix_type(crs_graph));
RCP<multivector_type> rhs = rcp(new multivector_type(crs_graph->getRowMap(), 1));
Expand All @@ -551,7 +564,7 @@ executeTotalElementLoopSPKokkos_


timerElementLoopMemory = Teuchos::null;
RCP<TimeMonitor> timerElementLoopMatrix = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("3.2) ElementLoop (Matrix)")));
RCP<TimeMonitor> timerElementLoopMatrix = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("3.3) ElementLoop (Matrix)")));

// Loop over owned elements:
Kokkos::parallel_for(Kokkos::RangePolicy<execution_space>(0, numOwnedElements),KOKKOS_LAMBDA(const size_t& element_gidx) {
Expand Down

0 comments on commit 1f94f9b

Please sign in to comment.