Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Functions
Tpetra_Details_packCrsMatrix_def.hpp File Reference

Functions for packing the entries of a Tpetra::CrsMatrix for communication, in the case where it is valid to go to the KokkosSparse::CrsMatrix (local sparse matrix 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_Details_Profiling.hpp"
#include "Tpetra_CrsMatrix_decl.hpp"
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>

Go to the source code of this file.

Classes

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

Namespaces

 Tpetra
 Namespace Tpetra contains the class and methods constituting the Tpetra library.
 
 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::PackCrsMatrixImpl::computeNumPacketsAndOffsets (const OutputOffsetsViewType &outputOffsets, const CountsViewType &counts, const InputOffsetsViewType &rowOffsets, const InputLocalRowIndicesViewType &lclRowInds, const InputLocalRowPidsViewType &lclRowPids, const typename CountsViewType::non_const_value_type sizeOfLclCount, const typename CountsViewType::non_const_value_type sizeOfGblColInd, const typename CountsViewType::non_const_value_type sizeOfPid, const typename CountsViewType::non_const_value_type sizeOfValue)
 Compute the number of packets and offsets for the pack procedure. More...
 
template<class ST , class ColumnMap , class BufferDeviceType >
KOKKOS_FUNCTION Kokkos::pair
< int, size_t > 
Tpetra::Details::PackCrsMatrixImpl::packCrsMatrixRow (const ColumnMap &col_map, const Kokkos::View< char *, BufferDeviceType > &exports, const typename PackTraits< typename ColumnMap::local_ordinal_type >::input_array_type &lids_in, const typename PackTraits< int >::input_array_type &pids_in, const typename PackTraits< ST >::input_array_type &vals_in, const size_t offset, const size_t num_ent, const size_t num_bytes_per_value, const bool pack_pids)
 Packs a single row of the CrsMatrix. More...
 
template<class LocalMatrix , class LocalMap , class BufferDeviceType >
void Tpetra::Details::PackCrsMatrixImpl::do_pack (const LocalMatrix &local_matrix, const LocalMap &local_map, const Kokkos::View< char *, 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 size_t num_bytes_per_value, const bool pack_pids)
 Perform the pack operation for the matrix. More...
 
template<typename ST , typename LO , typename GO , typename NT , typename BufferDeviceType >
void Tpetra::Details::PackCrsMatrixImpl::packCrsMatrix (const CrsMatrix< ST, LO, GO, NT > &sourceMatrix, Kokkos::DualView< char *, BufferDeviceType > &exports, const Kokkos::View< size_t *, BufferDeviceType > &num_packets_per_lid, const Kokkos::View< const LO *, BufferDeviceType > &export_lids, const Kokkos::View< const int *, typename NT::device_type > &export_pids, size_t &constant_num_packets, const bool pack_pids, Distributor &)
 Pack specified entries of the given local sparse matrix for communication. More...
 
template<typename ST , typename LO , typename GO , typename NT >
void Tpetra::Details::packCrsMatrix (const CrsMatrix< ST, LO, GO, NT > &sourceMatrix, Teuchos::Array< char > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, const Teuchos::ArrayView< const LO > &exportLIDs, size_t &constantNumPackets, Distributor &distor)
 Pack specified entries of the given local sparse matrix for communication. More...
 
template<typename ST , typename LO , typename GO , typename NT >
void Tpetra::Details::packCrsMatrixNew (const CrsMatrix< ST, LO, GO, NT > &sourceMatrix, Kokkos::DualView< char *, typename DistObject< char, LO, GO, NT >::buffer_device_type > &exports, const Kokkos::DualView< size_t *, typename DistObject< char, LO, GO, NT >::buffer_device_type > &numPacketsPerLID, const Kokkos::DualView< const LO *, typename DistObject< char, LO, GO, NT >::buffer_device_type > &exportLIDs, size_t &constantNumPackets, Distributor &distor)
 Pack specified entries of the given local sparse matrix for communication, for "new" DistObject interface. More...
 
template<typename ST , typename LO , typename GO , typename NT >
void Tpetra::Details::packCrsMatrixWithOwningPIDs (const CrsMatrix< ST, LO, GO, NT > &sourceMatrix, Kokkos::DualView< char *, typename DistObject< char, 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, Distributor &distor)
 Pack specified entries of the given local sparse matrix for communication. More...
 

Detailed Description

Functions for packing the entries of a Tpetra::CrsMatrix for communication, in the case where it is valid to go to the KokkosSparse::CrsMatrix (local sparse matrix 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 matrix are "packed" (concatenated) in to a (view of) char* object in the following order:

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

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

Definition in file Tpetra_Details_packCrsMatrix_def.hpp.