Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
Tpetra_Details_packCrsGraph_def.hpp File Reference

Functions for packing the entries of a Tpetra::CrsGraph for communication, in the case where it is valid to go to the KokkosSparse::CrsGraph (local sparse graph data structure) directly. More...

#include "TpetraCore_config.h"
#include "Teuchos_Array.hpp"
#include "Teuchos_ArrayView.hpp"
#include "Tpetra_Details_Behavior.hpp"
#include "Tpetra_Details_castAwayConstDualView.hpp"
#include "Tpetra_Details_createMirrorView.hpp"
#include "Tpetra_Details_getEntryOnHost.hpp"
#include "Tpetra_Details_OrdinalTraits.hpp"
#include "Tpetra_Details_PackTraits.hpp"
#include "Tpetra_CrsGraph_decl.hpp"
#include <memory>
#include <string>

Go to the source code of this file.

Classes

class  Tpetra::Details::PackCrsGraphImpl::NumPacketsAndOffsetsFunctor< OutputOffsetsViewType, CountsViewType, InputOffsetsViewType, InputLocalRowIndicesViewType, InputLocalRowPidsViewType, debug >
 Compute the number of packets and offsets for the pack procedure. More...
 

Namespaces

namespace  Tpetra
 Namespace Tpetra contains the class and methods constituting the Tpetra library.
 
namespace  Tpetra::Details
 Nonmember function that computes a residual Computes R = B - A * X.
 

Functions

template<class OutputOffsetsViewType , class CountsViewType , class InputOffsetsViewType , class InputLocalRowIndicesViewType , class InputLocalRowPidsViewType >
CountsViewType::non_const_value_type Tpetra::Details::PackCrsGraphImpl::computeNumPacketsAndOffsets (const OutputOffsetsViewType &outputOffsets, const CountsViewType &counts, const InputOffsetsViewType &rowOffsets, const InputLocalRowIndicesViewType &lclRowInds, const InputLocalRowPidsViewType &lclRowPids)
 Compute the number of packets and offsets for the pack procedure.
 
template<class Packet , class LocalMapType , class BufferDeviceType , class InputLidsType , class InputPidsType >
KOKKOS_FUNCTION size_t Tpetra::Details::PackCrsGraphImpl::packRow (const LocalMapType &col_map, const Kokkos::View< Packet *, BufferDeviceType > &exports, const InputLidsType &lids_in, const InputPidsType &pids_in, const size_t offset, const size_t num_ent, const bool pack_pids)
 Packs a single row of the CrsGraph.
 
template<class Packet , class LocalGraph , class LocalMap , class BufferDeviceType >
void Tpetra::Details::PackCrsGraphImpl::do_pack (const LocalGraph &local_graph, const LocalMap &local_map, const Kokkos::View< Packet *, BufferDeviceType > &exports, const typename PackTraits< size_t >::input_array_type &num_packets_per_lid, const typename PackTraits< typename LocalMap::local_ordinal_type >::input_array_type &export_lids, const typename PackTraits< int >::input_array_type &source_pids, const Kokkos::View< const size_t *, BufferDeviceType > &offsets, const bool pack_pids)
 Perform the pack operation for the graph.
 
template<typename LO , typename GO , typename NT >
void Tpetra::Details::PackCrsGraphImpl::packCrsGraph (const CrsGraph< LO, GO, NT > &sourceGraph, Kokkos::DualView< typename CrsGraph< LO, GO, NT >::packet_type *, typename CrsGraph< LO, GO, NT >::buffer_device_type > &exports, const Kokkos::View< size_t *, typename CrsGraph< LO, GO, NT >::buffer_device_type > &num_packets_per_lid, const Kokkos::View< const LO *, typename CrsGraph< LO, GO, NT >::buffer_device_type > &export_lids, const Kokkos::View< const int *, typename CrsGraph< LO, GO, NT >::buffer_device_type > &export_pids, size_t &constant_num_packets, const bool pack_pids)
 Pack specified entries of the given local sparse graph for communication.
 
template<typename LO , typename GO , typename NT >
void Tpetra::Details::packCrsGraph (const CrsGraph< LO, GO, NT > &sourceGraph, Teuchos::Array< typename CrsGraph< LO, GO, NT >::packet_type > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, const Teuchos::ArrayView< const LO > &exportLIDs, size_t &constantNumPackets)
 Pack specified entries of the given local sparse graph for communication.
 
template<typename LO , typename GO , typename NT >
void Tpetra::Details::packCrsGraphNew (const CrsGraph< LO, GO, NT > &sourceGraph, const Kokkos::DualView< const LO *, typename CrsGraph< LO, GO, NT >::buffer_device_type > &exportLIDs, const Kokkos::DualView< const int *, typename CrsGraph< LO, GO, NT >::buffer_device_type > &exportPIDs, Kokkos::DualView< typename CrsGraph< LO, GO, NT >::packet_type *, typename CrsGraph< LO, GO, NT >::buffer_device_type > &exports, Kokkos::DualView< size_t *, typename CrsGraph< LO, GO, NT >::buffer_device_type > numPacketsPerLID, size_t &constantNumPackets, const bool pack_pids)
 Pack specified entries of the given local sparse graph for communication, for "new" DistObject interface.
 
template<typename LO , typename GO , typename NT >
void Tpetra::Details::packCrsGraphWithOwningPIDs (const CrsGraph< LO, GO, NT > &sourceGraph, Kokkos::DualView< typename CrsGraph< LO, GO, NT >::packet_type *, typename CrsGraph< LO, GO, NT >::buffer_device_type > &exports_dv, const Teuchos::ArrayView< size_t > &numPacketsPerLID, const Teuchos::ArrayView< const LO > &exportLIDs, const Teuchos::ArrayView< const int > &sourcePIDs, size_t &constantNumPackets)
 Pack specified entries of the given local sparse graph for communication.
 

Detailed Description

Functions for packing the entries of a Tpetra::CrsGraph for communication, in the case where it is valid to go to the KokkosSparse::CrsGraph (local sparse graph data structure) directly.

Warning
This file, and its contents, are implementation details of Tpetra. The file itself or its contents may disappear or change at any time.

Data (bytes) describing the row of the CRS graph are "packed" (concatenated) in to a (view of) GO* object in the following order:

  1. number of entries (LocalOrdinal)
  2. global column indices (GlobalOrdinal)
  3. proces IDs (optional, int)

The functions in this file are companions to Tpetra_Details_unpackCrsGraphAndCombine.hpp, i.e., Tpetra_Details_unpackCrsGraphAndCombine.hpp implements the reverse of the packing order described above to ensure proper unpacking.

Definition in file Tpetra_Details_packCrsGraph_def.hpp.

Function Documentation

◆ computeNumPacketsAndOffsets()

template<class OutputOffsetsViewType , class CountsViewType , class InputOffsetsViewType , class InputLocalRowIndicesViewType , class InputLocalRowPidsViewType >
CountsViewType::non_const_value_type Tpetra::Details::PackCrsGraphImpl::computeNumPacketsAndOffsets ( const OutputOffsetsViewType & outputOffsets,
const CountsViewType & counts,
const InputOffsetsViewType & rowOffsets,
const InputLocalRowIndicesViewType & lclRowInds,
const InputLocalRowPidsViewType & lclRowPids )

Compute the number of packets and offsets for the pack procedure.

Template Parameters
OutputOffsetsViewTypethe type of the output offsets view
CountsViewTypethe type of the counts view
InputOffsetsViewTypethe type of the input offsets view
InputLocalRowIndicesViewTypethe type of the local row indices view
InputLocalRowPidsViewTypethe type of the local process IDs view

This is the high level interface to the NumPacketsAndOffsetsFunctor functor

Definition at line 257 of file Tpetra_Details_packCrsGraph_def.hpp.

◆ packRow()

template<class Packet , class LocalMapType , class BufferDeviceType , class InputLidsType , class InputPidsType >
KOKKOS_FUNCTION size_t Tpetra::Details::PackCrsGraphImpl::packRow ( const LocalMapType & col_map,
const Kokkos::View< Packet *, BufferDeviceType > & exports,
const InputLidsType & lids_in,
const InputPidsType & pids_in,
const size_t offset,
const size_t num_ent,
const bool pack_pids )

Packs a single row of the CrsGraph.

Template Parameters
ColumnMapthe type of the local column map

Data (bytes) describing the row of the CRS graph are "packed" (concatenated) in to a single (view of) GO* in the following order:

  1. GO column indices
  2. int proces IDs

Definition at line 377 of file Tpetra_Details_packCrsGraph_def.hpp.

◆ do_pack()

template<class Packet , class LocalGraph , class LocalMap , class BufferDeviceType >
void Tpetra::Details::PackCrsGraphImpl::do_pack ( const LocalGraph & local_graph,
const LocalMap & local_map,
const Kokkos::View< Packet *, BufferDeviceType > & exports,
const typename PackTraits< size_t >::input_array_type & num_packets_per_lid,
const typename PackTraits< typename LocalMap::local_ordinal_type >::input_array_type & export_lids,
const typename PackTraits< int >::input_array_type & source_pids,
const Kokkos::View< const size_t *, BufferDeviceType > & offsets,
const bool pack_pids )

Perform the pack operation for the graph.

Template Parameters
LocalGraphthe specialization of the KokkosSparse::CrsGraph local graph
LocalMapthe type of the local column map

This is a higher level interface to the PackCrsGraphFunctor

Definition at line 560 of file Tpetra_Details_packCrsGraph_def.hpp.

◆ packCrsGraph()

template<typename LO , typename GO , typename NT >
void Tpetra::Details::PackCrsGraphImpl::packCrsGraph ( const CrsGraph< LO, GO, NT > & sourceGraph,
Kokkos::DualView< typename CrsGraph< LO, GO, NT >::packet_type *, typename CrsGraph< LO, GO, NT >::buffer_device_type > & exports,
const Kokkos::View< size_t *, typename CrsGraph< LO, GO, NT >::buffer_device_type > & num_packets_per_lid,
const Kokkos::View< const LO *, typename CrsGraph< LO, GO, NT >::buffer_device_type > & export_lids,
const Kokkos::View< const int *, typename CrsGraph< LO, GO, NT >::buffer_device_type > & export_pids,
size_t & constant_num_packets,
const bool pack_pids )

Pack specified entries of the given local sparse graph for communication.

Template Parameters
LOThe type of local indices. See the documentation of Map for requirements.
GOThe type of global indices. See the documentation of Map for requirements.
NTThe Kokkos Node type. See the documentation of Map for requirements.
Warning
This is an implementation detail of Tpetra::CrsGraph.
Parameters
sourceGraph[in] the CrsGraph source
exports[in/out] Output pack buffer; resized if needed.
num_packets_per_lid[out] Entry k gives the number of bytes packed for row export_lids[k] of the local graph.
export_lids[in] Local indices of the rows to pack.
export_pids[in] Process ranks for the column indices in each packed row.
constant_num_packets[out] Setting this to zero tells the caller to expect a possibly /// different ("nonconstant") number of packets per local index (i.e., a possibly different number of entries per row).

Definition at line 659 of file Tpetra_Details_packCrsGraph_def.hpp.