16 pack(
const Teuchos::ArrayView<const LocalOrdinal>& exportLIDs,
17 Teuchos::Array<GlobalOrdinal>& exports,
18 const Teuchos::ArrayView<size_t>& numPacketsPerLID,
19 size_t& constantNumPackets)
const {
21 typedef LocalOrdinal LO;
22 typedef GlobalOrdinal GO;
24 const char tfecfFuncName[] =
"packAndPrepare";
26 TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC(
27 exportLIDs.size() != numPacketsPerLID.size(), std::runtime_error,
28 ": exportLIDs and numPacketsPerLID must have the same size.");
31 constantNumPackets = 0;
38 size_t totalNumPackets = 0;
39 nonconst_global_inds_host_view_type row;
40 for (LO i = 0; i < exportLIDs.size(); ++i) {
41 const GO GID = srcMap.getGlobalElement(exportLIDs[i]);
43 numPacketsPerLID[i] = row_length;
44 totalNumPackets += row_length;
47 exports.resize(totalNumPackets);
51 size_t exportsOffset = 0;
52 for (LO i = 0; i < exportLIDs.size(); ++i) {
53 const GO GID = srcMap.getGlobalElement(exportLIDs[i]);
55 Kokkos::resize(row, row_length);
56 size_t check_row_length = 0;
59 for (
size_t j = 0; j < row_length; ++j) {
60 exports[exportsOffset + j] = row[j];
62 exportsOffset += row.extent(0);
virtual void pack(const Teuchos::ArrayView< const LocalOrdinal > &exportLIDs, Teuchos::Array< GlobalOrdinal > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets) const
Pack this object's data for Import or Export.
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const =0
The Map that describes this graph's distribution of rows over processes.
virtual void getGlobalRowCopy(const GlobalOrdinal gblRow, nonconst_global_inds_host_view_type &gblColInds, size_t &numColInds) const =0
Get a copy of the global column indices in a given row of the graph.