Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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"
14 #include "Tpetra_CombineMode.hpp"
15 #include "Kokkos_DualView.hpp"
16 #include "Tpetra_CrsMatrix_fwd.hpp"
18 #include "Tpetra_Details_DefaultTypes.hpp"
19 
40 
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 namespace Teuchos {
43 // Forward declaration of Array
44 template<class T> class Array;
45 // Forward declaration of ArrayView
46 template<class T> class ArrayView;
47 } // namespace Teuchos
48 #endif // DOXYGEN_SHOULD_SKIP_THIS
49 
50 namespace Tpetra {
51 
52 //
53 // Users must never rely on anything in the Details namespace.
54 //
55 namespace Details {
56 
95 template<typename ST, typename LO, typename GO, typename NT>
96 void
97 unpackCrsMatrixAndCombine (const CrsMatrix<ST, LO, GO, NT>& sourceMatrix,
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 
104 template<typename ST, typename LO, typename GO, typename NT>
105 void
106 unpackCrsMatrixAndCombineNew(
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 //
172 template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
173 size_t
175  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> & sourceMatrix,
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 
200 template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
201 void
203  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> & sourceMatrix,
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 
233 template<typename Scalar, typename LocalOrdinal, typename GlobalOrdinal, typename Node>
234 void
236  const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> & sourceMatrix,
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
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.
Declaration of Tpetra::CombineMode enum, and a function for setting a Tpetra::CombineMode parameter i...
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
CombineMode
Rule for combining data in an Import or Export.
Forward declaration of Tpetra::CrsMatrix.
Declaration of the Tpetra::DistObject class.
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...
Kokkos::Device< typename device_type::execution_space, buffer_memory_space > buffer_device_type