17 pack (
const Teuchos::ArrayView<const LocalOrdinal>& exportLIDs,
18 Teuchos::Array<GlobalOrdinal>& exports,
19 const Teuchos::ArrayView<size_t>& numPacketsPerLID,
20 size_t& constantNumPackets)
const
23 typedef LocalOrdinal LO;
24 typedef GlobalOrdinal GO;
26 const char tfecfFuncName[] =
"packAndPrepare";
28 TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC(
29 exportLIDs.size() != numPacketsPerLID.size(), std::runtime_error,
30 ": exportLIDs and numPacketsPerLID must have the same size.");
33 constantNumPackets = 0;
40 size_t totalNumPackets = 0;
41 nonconst_global_inds_host_view_type row;
42 for (LO i = 0; i < exportLIDs.size (); ++i) {
43 const GO GID = srcMap.getGlobalElement (exportLIDs[i]);
45 numPacketsPerLID[i] = row_length;
46 totalNumPackets += row_length;
49 exports.resize (totalNumPackets);
53 size_t exportsOffset = 0;
54 for (LO i = 0; i < exportLIDs.size (); ++i) {
55 const GO GID = srcMap.getGlobalElement (exportLIDs[i]);
57 Kokkos::resize(row,row_length);
58 size_t check_row_length = 0;
61 for (
size_t j=0; j<row_length; ++j) {
62 exports[exportsOffset+j] = row[j];
64 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.