Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Tpetra_Details_unpackCrsMatrixAndCombine_decl.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Tpetra: Templated Linear Algebra Services Package
4//
5// Copyright 2008 NTESS and the Tpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TPETRA_DETAILS_UNPACKCRSMATRIXANDCOMBINE_DECL_HPP
11#define TPETRA_DETAILS_UNPACKCRSMATRIXANDCOMBINE_DECL_HPP
12
13#include "TpetraCore_config.h"
15#include "Kokkos_DualView.hpp"
18#include "Tpetra_Details_DefaultTypes.hpp"
19
40
41#ifndef DOXYGEN_SHOULD_SKIP_THIS
42namespace Teuchos {
43// Forward declaration of Array
44template<class T> class Array;
45// Forward declaration of ArrayView
46template<class T> class ArrayView;
47} // namespace Teuchos
48#endif // DOXYGEN_SHOULD_SKIP_THIS
49
50namespace Tpetra {
51
52//
53// Users must never rely on anything in the Details namespace.
54//
55namespace Details {
56
95template<typename ST, typename LO, typename GO, typename NT>
96void
98 const Teuchos::ArrayView<const char>& imports,
99 const Teuchos::ArrayView<const size_t>& numPacketsPerLID,
100 const Teuchos::ArrayView<const LO>& importLIDs,
101 size_t constantNumPackets,
102 CombineMode combineMode);
103
104template<typename ST, typename LO, typename GO, typename NT>
105void
106unpackCrsMatrixAndCombineNew(
107 const CrsMatrix<ST, LO, GO, NT>& sourceMatrix,
108 Kokkos::DualView<char*,
110 Kokkos::DualView<size_t*,
111 typename DistObject<char, LO, GO, NT>::buffer_device_type> numPacketsPerLID,
112 const Kokkos::DualView<const LO*,
114 const size_t constantNumPackets,
115 const CombineMode combineMode);
116
163//
172template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
173size_t
176 const Teuchos::ArrayView<const LocalOrdinal> &importLIDs,
177 const Teuchos::ArrayView<const char> &imports,
178 const Teuchos::ArrayView<const size_t>& numPacketsPerLID,
179 size_t constantNumPackets,
180 CombineMode combineMode,
181 size_t numSameIDs,
182 const Teuchos::ArrayView<const LocalOrdinal>& permuteToLIDs,
183 const Teuchos::ArrayView<const LocalOrdinal>& permuteFromLIDs);
184
199
200template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
201void
204 const Kokkos::View<LocalOrdinal const *,
205 Kokkos::Device<typename Node::device_type::execution_space,
206 Tpetra::Details::DefaultTypes::comm_buffer_memory_space<typename Node::device_type>>,
207 void, void>,
208 const Kokkos::View<const char*,
209 Kokkos::Device<typename Node::device_type::execution_space,
210 Tpetra::Details::DefaultTypes::comm_buffer_memory_space<typename Node::device_type>>
211 ,void, void >,
212 const Kokkos::View<const size_t*,
213 Kokkos::Device<typename Node::device_type::execution_space,
214 Tpetra::Details::DefaultTypes::comm_buffer_memory_space<typename Node::device_type>>
215 ,void, void >,
216 const size_t numSameIDs,
217 const Kokkos::View<LocalOrdinal const *,
218 Kokkos::Device<typename Node::device_type::execution_space,
219 Tpetra::Details::DefaultTypes::comm_buffer_memory_space<typename Node::device_type>>,
220 void, void>,
221 const Kokkos::View<LocalOrdinal const *,
222 Kokkos::Device<typename Node::device_type::execution_space,
223 Tpetra::Details::DefaultTypes::comm_buffer_memory_space<typename Node::device_type>>,
224 void, void>,
225 size_t TargetNumRows,
226 const int MyTargetPID,
227 Teuchos::ArrayRCP<size_t>& CRS_rowptr,
228 Teuchos::ArrayRCP<GlobalOrdinal>& CRS_colind,
229 Teuchos::ArrayRCP<Scalar>& CRS_vals,
230 const Teuchos::ArrayView<const int>& SourcePids,
231 Teuchos::Array<int>& TargetPids);
232
233template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
234void
237 const Kokkos::View<LocalOrdinal const *,
238 Kokkos::Device<typename Node::device_type::execution_space,
239 Tpetra::Details::DefaultTypes::comm_buffer_memory_space<typename Node::device_type>>,
240 void, void>,
241 const Kokkos::View<const char*,
242 Kokkos::Device<typename Node::device_type::execution_space,
243 Tpetra::Details::DefaultTypes::comm_buffer_memory_space<typename Node::device_type>>
244 ,void, void >,
245 const Kokkos::View<const size_t*,
246 Kokkos::Device<typename Node::device_type::execution_space,
247 Tpetra::Details::DefaultTypes::comm_buffer_memory_space<typename Node::device_type>>
248 ,void, void >,
249 const size_t numSameIDs,
250 const Kokkos::View<LocalOrdinal const *,
251 Kokkos::Device<typename Node::device_type::execution_space,
252 Tpetra::Details::DefaultTypes::comm_buffer_memory_space<typename Node::device_type>>,
253 void, void>,
254 const Kokkos::View<LocalOrdinal const *,
255 Kokkos::Device<typename Node::device_type::execution_space,
256 Tpetra::Details::DefaultTypes::comm_buffer_memory_space<typename Node::device_type>>,
257 void, void>,
258 size_t TargetNumRows,
259 const int MyTargetPID,
260 Kokkos::View<size_t*,typename Node::device_type>& /*crs_rowptr_d*/,
261 Kokkos::View<GlobalOrdinal*,typename Node::device_type>& /*crs_colind_d*/,
262 Kokkos::View<typename CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::impl_scalar_type*,typename Node::device_type>& /*crs_vals_d*/,
263 const Teuchos::ArrayView<const int>& SourcePids,
264 Kokkos::View<int*,typename Node::device_type>& /*TargetPids*/);
265
266} // namespace Details
267} // namespace Tpetra
268
269#endif // TPETRA_DETAILS_UNPACKCRSMATRIXANDCOMBINE_DECL_HPP
Declaration of Tpetra::CombineMode enum, and a function for setting a Tpetra::CombineMode parameter i...
Forward declaration of Tpetra::CrsMatrix.
Declaration of the Tpetra::DistObject class.
Sparse matrix that presents a row-oriented interface that lets users read or modify entries.
typename row_matrix_type::impl_scalar_type impl_scalar_type
The type used internally in place of Scalar.
Kokkos::Device< typename device_type::execution_space, buffer_memory_space > buffer_device_type
Kokkos::Device specialization for communication buffers.
Nonmember function that computes a residual Computes R = B - A * X.
void unpackAndCombineIntoCrsArrays(const CrsGraph< LO, GO, NT > &sourceGraph, const Teuchos::ArrayView< const LO > &importLIDs, const Teuchos::ArrayView< const typename CrsGraph< LO, GO, NT >::packet_type > &imports, const Teuchos::ArrayView< const size_t > &numPacketsPerLID, const size_t constantNumPackets, const CombineMode combineMode, const size_t numSameIDs, const Teuchos::ArrayView< const LO > &permuteToLIDs, const Teuchos::ArrayView< const LO > &permuteFromLIDs, size_t TargetNumRows, size_t TargetNumNonzeros, const int MyTargetPID, const Teuchos::ArrayView< size_t > &CRS_rowptr, const Teuchos::ArrayView< GO > &CRS_colind, const Teuchos::ArrayView< const int > &SourcePids, Teuchos::Array< int > &TargetPids)
unpackAndCombineIntoCrsArrays
size_t unpackAndCombineWithOwningPIDsCount(const CrsGraph< LO, GO, NT > &sourceGraph, const Teuchos::ArrayView< const LO > &importLIDs, const Teuchos::ArrayView< const typename CrsGraph< LO, GO, NT >::packet_type > &imports, const Teuchos::ArrayView< const size_t > &numPacketsPerLID, size_t constantNumPackets, CombineMode combineMode, size_t numSameIDs, const Teuchos::ArrayView< const LO > &permuteToLIDs, const Teuchos::ArrayView< const LO > &permuteFromLIDs)
Special version of Tpetra::Details::unpackCrsGraphAndCombine that also unpacks owning process ranks.
void unpackCrsMatrixAndCombine(const CrsMatrix< ST, LO, GO, NT > &sourceMatrix, const Teuchos::ArrayView< const char > &imports, const Teuchos::ArrayView< const size_t > &numPacketsPerLID, const Teuchos::ArrayView< const LO > &importLIDs, size_t constantNumPackets, CombineMode combineMode)
Unpack the imported column indices and values, and combine into matrix.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
CombineMode
Rule for combining data in an Import or Export.