49 pack (
const Teuchos::ArrayView<const LocalOrdinal>& exportLIDs,
50 Teuchos::Array<GlobalOrdinal>& exports,
51 const Teuchos::ArrayView<size_t>& numPacketsPerLID,
52 size_t& constantNumPackets)
const
55 typedef LocalOrdinal LO;
56 typedef GlobalOrdinal GO;
58 const char tfecfFuncName[] =
"packAndPrepare";
60 TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC(
61 exportLIDs.size() != numPacketsPerLID.size(), std::runtime_error,
62 ": exportLIDs and numPacketsPerLID must have the same size.");
65 constantNumPackets = 0;
72 size_t totalNumPackets = 0;
73 nonconst_global_inds_host_view_type row;
74 for (LO i = 0; i < exportLIDs.size (); ++i) {
75 const GO GID = srcMap.getGlobalElement (exportLIDs[i]);
77 numPacketsPerLID[i] = row_length;
78 totalNumPackets += row_length;
81 exports.resize (totalNumPackets);
85 size_t exportsOffset = 0;
86 for (LO i = 0; i < exportLIDs.size (); ++i) {
87 const GO GID = srcMap.getGlobalElement (exportLIDs[i]);
89 Kokkos::resize(row,row_length);
90 size_t check_row_length = 0;
93 for (
size_t j=0; j<row_length; ++j) {
94 exports[exportsOffset+j] = row[j];
96 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.