Tpetra parallel linear algebra  Version of the Day
Classes | Namespaces | Functions
Tpetra_Details_unpackCrsGraphAndCombine_def.hpp File Reference

Definition of functions for unpacking 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_castAwayConstDualView.hpp"
#include "Tpetra_Details_computeOffsets.hpp"
#include "Tpetra_Details_createMirrorView.hpp"
#include "Tpetra_Details_OrdinalTraits.hpp"
#include "Tpetra_Details_Behavior.hpp"
#include "Tpetra_CrsGraph_decl.hpp"
#include "Tpetra_Details_getEntryOnHost.hpp"
#include "Kokkos_Core.hpp"
#include <memory>
#include <string>

Go to the source code of this file.

Classes

class  Tpetra::Details::UnpackAndCombineCrsGraphImpl::UnpackAndCombineFunctor< Packet, LocalGraph, LocalMap, BufferDevice >
 Unpacks and combines a single row of the CrsGraph. More...
 

Namespaces

 Tpetra
 Namespace Tpetra contains the class and methods constituting the Tpetra library.
 
 Tpetra::Details
 Namespace for Tpetra implementation details.
 

Functions

template<class Packet , class GO , class Device , class BufferDevice >
KOKKOS_FUNCTION int Tpetra::Details::UnpackAndCombineCrsGraphImpl::unpackRow (typename Kokkos::View< GO *, Device, Kokkos::MemoryUnmanaged > &gids_out, typename Kokkos::View< int *, Device, Kokkos::MemoryUnmanaged > &pids_out, const Kokkos::View< const Packet *, BufferDevice > &imports, const size_t offset, const size_t num_ent)
 Unpack a single row of a CrsGraph. More...
 
template<class Packet , class LocalGraph , class LocalMap , class BufferDevice >
void Tpetra::Details::UnpackAndCombineCrsGraphImpl::unpackAndCombine (const LocalGraph &local_graph, const LocalMap &local_map, const Kokkos::View< const Packet *, BufferDevice, Kokkos::MemoryUnmanaged > &imports, const Kokkos::View< const size_t *, BufferDevice, Kokkos::MemoryUnmanaged > &num_packets_per_lid, const Kokkos::View< const typename LocalMap::local_ordinal_type *, typename LocalMap::device_type, Kokkos::MemoryUnmanaged > &import_lids, const Tpetra::CombineMode combine_mode, const bool unpack_pids, const bool atomic)
 Perform the unpack operation for the graph. More...
 
template<class Packet , class LO , class Device , class BufferDevice >
void Tpetra::Details::UnpackAndCombineCrsGraphImpl::setupRowPointersForRemotes (const Kokkos::View< size_t *, Device > &tgt_rowptr, const Kokkos::View< const LO *, Device > &import_lids, const Kokkos::View< const Packet *, BufferDevice > &imports, const Kokkos::View< const size_t *, BufferDevice > &num_packets_per_lid)
 Setup row pointers for remotes. More...
 
template<class LO , class GO , class Node >
void Tpetra::Details::unpackCrsGraphAndCombine (const CrsGraph< LO, GO, Node > &sourceGraph, const Teuchos::ArrayView< const typename CrsGraph< LO, GO, Node >::packet_type > &imports, const Teuchos::ArrayView< const size_t > &numPacketsPerLID, const Teuchos::ArrayView< const LO > &importLIDs, size_t constantNumPackets, Distributor &distor, CombineMode combineMode, const bool atomic)
 Unpack the imported column indices and combine into graph. More...
 
template<class LocalOrdinal , class GlobalOrdinal , class Node >
size_t Tpetra::Details::unpackAndCombineWithOwningPIDsCount (const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > &sourceGraph, const Teuchos::ArrayView< const LocalOrdinal > &importLIDs, const Teuchos::ArrayView< const typename CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::packet_type > &imports, const Teuchos::ArrayView< const size_t > &numPacketsPerLID, size_t constantNumPackets, Distributor &distor, CombineMode combineMode, size_t numSameIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteToLIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteFromLIDs)
 Special version of Tpetra::Details::unpackCrsGraphAndCombine that also unpacks owning process ranks. More...
 
template<class LocalOrdinal , class GlobalOrdinal , class Node >
void Tpetra::Details::unpackAndCombineIntoCrsArrays (const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > &sourceGraph, const Teuchos::ArrayView< const LocalOrdinal > &importLIDs, const Teuchos::ArrayView< const typename CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::packet_type > &imports, const Teuchos::ArrayView< const size_t > &numPacketsPerLID, const size_t constantNumPackets, Distributor &distor, const CombineMode combineMode, const size_t numSameIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteToLIDs, const Teuchos::ArrayView< const LocalOrdinal > &permuteFromLIDs, size_t TargetNumRows, size_t TargetNumNonzeros, const int MyTargetPID, const Teuchos::ArrayView< size_t > &CRS_rowptr, const Teuchos::ArrayView< GlobalOrdinal > &CRS_colind, const Teuchos::ArrayView< const int > &SourcePids, Teuchos::Array< int > &TargetPids)
 unpackAndCombineIntoCrsArrays More...
 

Detailed Description

Definition of functions for unpacking 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) Packet* object in the following order:

  1. global column indices (GlobalOrdinal)
  2. proces IDs (optional, int)

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

Definition in file Tpetra_Details_unpackCrsGraphAndCombine_def.hpp.

Function Documentation

◆ unpackRow()

template<class Packet , class GO , class Device , class BufferDevice >
KOKKOS_FUNCTION int Tpetra::Details::UnpackAndCombineCrsGraphImpl::unpackRow ( typename Kokkos::View< GO *, Device, Kokkos::MemoryUnmanaged > &  gids_out,
typename Kokkos::View< int *, Device, Kokkos::MemoryUnmanaged > &  pids_out,
const Kokkos::View< const Packet *, BufferDevice > &  imports,
const size_t  offset,
const size_t  num_ent 
)

Unpack a single row of a CrsGraph.

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.
DeviceThe Kokkos device type. See the documentation of Map for requirements.
BufferDeviceThe "buffer device type."

Definition at line 103 of file Tpetra_Details_unpackCrsGraphAndCombine_def.hpp.

◆ unpackAndCombine()

template<class Packet , class LocalGraph , class LocalMap , class BufferDevice >
void Tpetra::Details::UnpackAndCombineCrsGraphImpl::unpackAndCombine ( const LocalGraph &  local_graph,
const LocalMap local_map,
const Kokkos::View< const Packet *, BufferDevice, Kokkos::MemoryUnmanaged > &  imports,
const Kokkos::View< const size_t *, BufferDevice, Kokkos::MemoryUnmanaged > &  num_packets_per_lid,
const Kokkos::View< const typename LocalMap::local_ordinal_type *, typename LocalMap::device_type, Kokkos::MemoryUnmanaged > &  import_lids,
const Tpetra::CombineMode  combine_mode,
const bool  unpack_pids,
const bool  atomic 
)

Perform the unpack 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 UnpackAndCombineFunctor

Definition at line 315 of file Tpetra_Details_unpackCrsGraphAndCombine_def.hpp.

◆ setupRowPointersForRemotes()

template<class Packet , class LO , class Device , class BufferDevice >
void Tpetra::Details::UnpackAndCombineCrsGraphImpl::setupRowPointersForRemotes ( const Kokkos::View< size_t *, Device > &  tgt_rowptr,
const Kokkos::View< const LO *, Device > &  import_lids,
const Kokkos::View< const Packet *, BufferDevice > &  imports,
const Kokkos::View< const size_t *, BufferDevice > &  num_packets_per_lid 
)

Setup row pointers for remotes.

Definition at line 468 of file Tpetra_Details_unpackCrsGraphAndCombine_def.hpp.