From a9f2a4259ce69e7560bca3cd89fc27cbd4d03968 Mon Sep 17 00:00:00 2001 From: Chris Siefert Date: Mon, 1 Jul 2019 16:41:04 -0600 Subject: [PATCH] Tpetra: Missed ghosting --- .../fem_assembly_TotalElementLoop_SP.hpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/tpetra/core/example/Finite-Element-Assembly/fem_assembly_TotalElementLoop_SP.hpp b/packages/tpetra/core/example/Finite-Element-Assembly/fem_assembly_TotalElementLoop_SP.hpp index 7c6d1f4a41d0..dc778e5fa8c2 100644 --- a/packages/tpetra/core/example/Finite-Element-Assembly/fem_assembly_TotalElementLoop_SP.hpp +++ b/packages/tpetra/core/example/Finite-Element-Assembly/fem_assembly_TotalElementLoop_SP.hpp @@ -413,6 +413,9 @@ executeTotalElementLoopSPKokkos_ // -- https://trilinos.org/docs/dev/packages/tpetra/doc/html/classTpetra_1_1Map.html#a24490b938e94f8d4f31b6c0e4fc0ff77 RCP row_map = rcp(new map_type(GO_INVALID, mesh.getOwnedNodeGlobalIDs(), 0, comm)); + RCP owned_element_map = rcp(new map_type(GO_INVALID, mesh.getOwnedElementGlobalIDs(), 0, comm)); + RCP ghost_element_map = rcp(new map_type(GO_INVALID, mesh.getGhostElementGlobalIDs(), 0, comm)); + RCP elementImporter = rcp(new import_type(owned_element_map,ghost_element_map)); if(opts.verbose) row_map->describe(out); @@ -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: @@ -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 timerElementLoopMemory = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("3.1) ElementLoop (Memory)"))); + RCP timerElementLoopMemory = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("3.2) ElementLoop (Memory)"))); RCP crs_matrix = rcp(new crs_matrix_type(crs_graph)); RCP rhs = rcp(new multivector_type(crs_graph->getRowMap(), 1)); @@ -551,7 +564,7 @@ executeTotalElementLoopSPKokkos_ timerElementLoopMemory = Teuchos::null; - RCP timerElementLoopMatrix = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("3.2) ElementLoop (Matrix)"))); + RCP timerElementLoopMatrix = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("3.3) ElementLoop (Matrix)"))); // Loop over owned elements: Kokkos::parallel_for(Kokkos::RangePolicy(0, numOwnedElements),KOKKOS_LAMBDA(const size_t& element_gidx) {