Tpetra parallel linear algebra Version of the Day
|
Definition of functions for unpacking 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 "Teuchos_OrdinalTraits.hpp"
#include "Tpetra_Details_castAwayConstDualView.hpp"
#include "Tpetra_Details_computeOffsets.hpp"
#include "Tpetra_Details_createMirrorView.hpp"
#include "Tpetra_Details_OrdinalTraits.hpp"
#include "Tpetra_Details_PackTraits.hpp"
#include "Tpetra_CrsMatrix_decl.hpp"
#include "Tpetra_Details_getEntryOnHost.hpp"
#include "Kokkos_Core.hpp"
#include <memory>
#include <string>
Go to the source code of this file.
Classes | |
struct | Tpetra::Details::UnpackAndCombineCrsMatrixImpl::UnpackCrsMatrixAndCombineFunctor< LocalMatrix, LocalMap, BufferDeviceType > |
Unpacks and combines a single row of the CrsMatrix. More... | |
class | Tpetra::Details::UnpackAndCombineCrsMatrixImpl::NumEntriesFunctor< LO, DT, BDT > |
Kokkos::parallel_reduce functor to determine the number of entries (to unpack) in a KokkosSparse::CrsMatrix to pack. 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. | |
Definition of functions for unpacking 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.
Data (bytes) describing the row of the CRS matrix are "packed" (concatenated) in to a (view of) char* object in the following order:
The functions in this file are companions to Tpetra_Details_packCrsMatrix.hpp, i.e., Tpetra_Details_packCrsMatrix.hpp implements the packing order described above to ensure proper unpacking.
Definition in file Tpetra_Details_unpackCrsMatrixAndCombine_def.hpp.
KOKKOS_FUNCTION int Tpetra::Details::UnpackAndCombineCrsMatrixImpl::unpackRow | ( | const typename PackTraits< GO >::output_array_type & | gids_out, |
const typename PackTraits< int >::output_array_type & | pids_out, | ||
const typename PackTraits< ST >::output_array_type & | vals_out, | ||
const char | imports[], | ||
const size_t | offset, | ||
const size_t | , | ||
const size_t | num_ent, | ||
const size_t | bytes_per_value ) |
Unpack a single row of a CrsMatrix.
ST | The type of the numerical entries of the matrix. (You can use real-valued or complex-valued types here, unlike in Epetra, where the scalar type is always double .) |
LO | The type of local indices. See the documentation of Map for requirements. |
GO | The type of global indices. See the documentation of Map for requirements. |
Definition at line 99 of file Tpetra_Details_unpackCrsMatrixAndCombine_def.hpp.
size_t Tpetra::Details::UnpackAndCombineCrsMatrixImpl::compute_maximum_num_entries | ( | const Kokkos::View< const size_t *, BDT > & | num_packets_per_lid, |
const Kokkos::View< const size_t *, DT > & | offsets, | ||
const Kokkos::View< const char *, BDT > & | imports ) |
Maximum number of entries in any row of the packed matrix.
LO | The type of local indices. |
DT | The Kokkos device type. |
The | "buffer device type." |
This procedure is a higher-level interface to NumEntriesFunctor.
Definition at line 503 of file Tpetra_Details_unpackCrsMatrixAndCombine_def.hpp.
size_t Tpetra::Details::UnpackAndCombineCrsMatrixImpl::compute_total_num_entries | ( | const Kokkos::View< const size_t *, BDT > & | num_packets_per_lid, |
const Kokkos::View< const size_t *, DT > & | offsets, | ||
const Kokkos::View< const char *, BDT > & | imports ) |
Total number of entries in any row of the packed matrix.
LO | The type of local indices. |
DT | The Kokkos device type. |
BDT | The "buffer device type." |
This procedure is a high level interface to NumEntriesFunctor
Definition at line 532 of file Tpetra_Details_unpackCrsMatrixAndCombine_def.hpp.
|
inline |
Compute the index and batch number associated with each batch.
batch_info(i, 0) is the local index of the ith batch batch_info(i, 1) is the local batch number of the ith batch
Definition at line 578 of file Tpetra_Details_unpackCrsMatrixAndCombine_def.hpp.
void Tpetra::Details::UnpackAndCombineCrsMatrixImpl::unpackAndCombineIntoCrsMatrix | ( | const LocalMatrix & | local_matrix, |
const LocalMap & | local_map, | ||
const Kokkos::View< const char *, BufferDeviceType > & | imports, | ||
const Kokkos::View< const size_t *, BufferDeviceType > & | num_packets_per_lid, | ||
const typename PackTraits< typename LocalMap::local_ordinal_type >::input_array_type | import_lids, | ||
const Tpetra::CombineMode | combine_mode ) |
Perform the unpack operation for the matrix.
LocalMatrix | the specialization of the KokkosSparse::CrsMatrix local matrix |
LocalMap | the type of the local column map |
This is a higher level interface to the UnpackCrsMatrixAndCombineFunctor
Definition at line 606 of file Tpetra_Details_unpackCrsMatrixAndCombine_def.hpp.
int Tpetra::Details::UnpackAndCombineCrsMatrixImpl::setupRowPointersForRemotes | ( | const typename PackTraits< size_t >::output_array_type & | tgt_rowptr, |
const typename PackTraits< LO >::input_array_type & | import_lids, | ||
const Kokkos::View< const char *, BDT > & | imports, | ||
const Kokkos::View< const size_t *, BDT > & | num_packets_per_lid, | ||
const typename PackTraits< size_t >::input_array_type & | offsets ) |
Setup row pointers for remotes.
Definition at line 805 of file Tpetra_Details_unpackCrsMatrixAndCombine_def.hpp.