10 #ifndef TPETRA_MATRIXMATRIX_OPENMP_DEF_HPP
11 #define TPETRA_MATRIXMATRIX_OPENMP_DEF_HPP
13 #ifdef HAVE_TPETRA_INST_OPENMP
19 template<
class Scalar,
21 class GlobalOrdinal,
class LocalOrdinalViewType>
22 struct KernelWrappers<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType> {
23 static inline void mult_A_B_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
24 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Bview,
25 const LocalOrdinalViewType & Acol2Brow,
26 const LocalOrdinalViewType & Acol2Irow,
27 const LocalOrdinalViewType & Bcol2Ccol,
28 const LocalOrdinalViewType & Icol2Ccol,
29 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
30 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
31 const std::string& label = std::string(),
32 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
34 static inline void mult_A_B_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
35 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Bview,
36 const LocalOrdinalViewType & Acol2Brow,
37 const LocalOrdinalViewType & Acol2Irow,
38 const LocalOrdinalViewType & Bcol2Ccol,
39 const LocalOrdinalViewType & Icol2Ccol,
40 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
41 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
42 const std::string& label = std::string(),
43 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
50 template<
class Scalar,
52 class GlobalOrdinal,
class LocalOrdinalViewType>
53 struct KernelWrappers2<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType> {
54 static inline void jacobi_A_B_newmatrix_kernel_wrapper(Scalar omega,
55 const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> & Dinv,
56 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
57 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Bview,
58 const LocalOrdinalViewType & Acol2Brow,
59 const LocalOrdinalViewType & Acol2Irow,
60 const LocalOrdinalViewType & Bcol2Ccol,
61 const LocalOrdinalViewType & Icol2Ccol,
62 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
63 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
64 const std::string& label = std::string(),
65 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
67 static inline void jacobi_A_B_reuse_kernel_wrapper(Scalar omega,
68 const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> & Dinv,
69 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
70 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Bview,
71 const LocalOrdinalViewType & Acol2Brow,
72 const LocalOrdinalViewType & Acol2Irow,
73 const LocalOrdinalViewType & Bcol2Ccol,
74 const LocalOrdinalViewType & Icol2Ccol,
75 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
76 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
77 const std::string& label = std::string(),
78 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
80 static inline void jacobi_A_B_newmatrix_KokkosKernels(Scalar omega,
81 const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> & Dinv,
82 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
83 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Bview,
84 const LocalOrdinalViewType & Acol2Brow,
85 const LocalOrdinalViewType & Acol2Irow,
86 const LocalOrdinalViewType & Bcol2Ccol,
87 const LocalOrdinalViewType & Icol2Ccol,
88 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
89 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
90 const std::string& label = std::string(),
91 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
97 template<
class Scalar,
99 class GlobalOrdinal,
class LocalOrdinalViewType>
100 struct KernelWrappers3<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType> {
101 static inline void mult_R_A_P_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Rview,
102 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
103 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Pview,
104 const LocalOrdinalViewType & Acol2Prow,
105 const LocalOrdinalViewType & Acol2PIrow,
106 const LocalOrdinalViewType & Pcol2Ccol,
107 const LocalOrdinalViewType & PIcol2Ccol,
108 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Ac,
109 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Acimport,
110 const std::string& label = std::string(),
111 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
113 static inline void mult_R_A_P_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Rview,
114 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
115 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Pview,
116 const LocalOrdinalViewType & Acol2Prow,
117 const LocalOrdinalViewType & Acol2PIrow,
118 const LocalOrdinalViewType & Pcol2Ccol,
119 const LocalOrdinalViewType & PIcol2Ccol,
120 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Ac,
121 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Acimport,
122 const std::string& label = std::string(),
123 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
125 static inline void mult_PT_A_P_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
126 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Pview,
127 const LocalOrdinalViewType & Acol2Prow,
128 const LocalOrdinalViewType & Acol2PIrow,
129 const LocalOrdinalViewType & Pcol2Ccol,
130 const LocalOrdinalViewType & PIcol2Ccol,
131 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Ac,
132 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Acimport,
133 const std::string& label = std::string(),
134 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
136 static inline void mult_PT_A_P_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
137 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Pview,
138 const LocalOrdinalViewType & Acol2Prow,
139 const LocalOrdinalViewType & Acol2PIrow,
140 const LocalOrdinalViewType & Pcol2Ccol,
141 const LocalOrdinalViewType & PIcol2Ccol,
142 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Ac,
143 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Acimport,
144 const std::string& label = std::string(),
145 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
150 template<
class Scalar,
153 class LocalOrdinalViewType>
154 void KernelWrappers<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType>::mult_A_B_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
155 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Bview,
156 const LocalOrdinalViewType & Acol2Brow,
157 const LocalOrdinalViewType & Acol2Irow,
158 const LocalOrdinalViewType & Bcol2Ccol,
159 const LocalOrdinalViewType & Icol2Ccol,
160 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
161 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
162 const std::string& label,
163 const Teuchos::RCP<Teuchos::ParameterList>& params) {
165 #ifdef HAVE_TPETRA_MMM_TIMINGS
166 std::string prefix_mmm = std::string(
"TpetraExt ") + label + std::string(
": ");
167 using Teuchos::TimeMonitor;
168 Teuchos::RCP<TimeMonitor> MM;
172 std::string nodename(
"OpenMP");
177 typedef typename KCRS::device_type device_t;
178 typedef typename KCRS::StaticCrsGraphType graph_t;
179 typedef typename graph_t::row_map_type::non_const_type lno_view_t;
180 typedef typename graph_t::entries_type::non_const_type lno_nnz_view_t;
181 typedef typename KCRS::values_type::non_const_type scalar_view_t;
184 int team_work_size = 16;
185 std::string myalg(
"SPGEMM_KK_MEMORY");
188 if(!params.is_null()) {
189 if(params->isParameter(
"openmp: algorithm"))
190 myalg = params->get(
"openmp: algorithm",myalg);
191 if(params->isParameter(
"openmp: team work size"))
192 team_work_size = params->get(
"openmp: team work size",team_work_size);
197 ::Tpetra::MatrixMatrix::ExtraKernels::mult_A_B_newmatrix_LowThreadGustavsonKernel(Aview,Bview,Acol2Brow,Acol2Irow,Bcol2Ccol,Icol2Ccol,C,Cimport,label,params);
201 #ifdef HAVE_TPETRA_MMM_TIMINGS
202 MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"MMM Newmatrix OpenMPWrapper"))));
205 typedef KokkosKernels::Experimental::KokkosKernelsHandle<
206 typename lno_view_t::const_value_type,
typename lno_nnz_view_t::const_value_type,
typename scalar_view_t::const_value_type,
207 typename device_t::execution_space,
typename device_t::memory_space,
typename device_t::memory_space > KernelHandle;
210 const KCRS & Ak = Aview.origMatrix->getLocalMatrixDevice();
214 std::string alg = nodename+std::string(
" algorithm");
216 if(!params.is_null() && params->isParameter(alg)) myalg = params->get(alg,myalg);
217 KokkosSparse::SPGEMMAlgorithm alg_enum = KokkosSparse::StringToSPGEMMAlgorithm(myalg);
220 const KCRS Bmerged = Tpetra::MMdetails::merge_matrices(Aview,Bview,Acol2Brow,Acol2Irow,Bcol2Ccol,Icol2Ccol,C.getColMap()->getLocalNumElements());
222 #ifdef HAVE_TPETRA_MMM_TIMINGS
223 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"MMM Newmatrix OpenMPCore"))));
227 typename KernelHandle::nnz_lno_t AnumRows = Ak.numRows();
230 typename KernelHandle::nnz_lno_t BnumRows = Bmerged.numRows();
231 typename KernelHandle::nnz_lno_t BnumCols = Bmerged.numCols();
234 lno_view_t row_mapC (Kokkos::ViewAllocateWithoutInitializing(
"non_const_lnow_row"), AnumRows + 1);
235 lno_nnz_view_t entriesC;
236 scalar_view_t valuesC;
238 kh.create_spgemm_handle(alg_enum);
239 kh.set_team_work_size(team_work_size);
241 KokkosSparse::Experimental::spgemm_symbolic(&kh,AnumRows,BnumRows,BnumCols,Ak.graph.row_map,Ak.graph.entries,
false,Bmerged.graph.row_map,Bmerged.graph.entries,
false,row_mapC);
243 size_t c_nnz_size = kh.get_spgemm_handle()->get_c_nnz();
245 entriesC = lno_nnz_view_t (Kokkos::ViewAllocateWithoutInitializing(
"entriesC"), c_nnz_size);
246 valuesC = scalar_view_t (Kokkos::ViewAllocateWithoutInitializing(
"valuesC"), c_nnz_size);
249 KokkosSparse::Experimental::spgemm_numeric(&kh,AnumRows,BnumRows,BnumCols,Ak.graph.row_map,Ak.graph.entries,Ak.values,
false,Bmerged.graph.row_map,Bmerged.graph.entries,Bmerged.values,
false,row_mapC,entriesC,valuesC);
250 kh.destroy_spgemm_handle();
252 #ifdef HAVE_TPETRA_MMM_TIMINGS
253 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"MMM Newmatrix OpenMPSort"))));
256 if (params.is_null() || params->get(
"sort entries",
true))
257 Import_Util::sortCrsEntries(row_mapC, entriesC, valuesC);
258 C.setAllValues(row_mapC,entriesC,valuesC);
262 #ifdef HAVE_TPETRA_MMM_TIMINGS
263 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"MMM Newmatrix OpenMPESFC"))));
267 RCP<Teuchos::ParameterList> labelList = rcp(
new Teuchos::ParameterList);
268 labelList->set(
"Timer Label",label);
269 if(!params.is_null()) labelList->set(
"compute global constants",params->get(
"compute global constants",
true));
270 RCP<const Export<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > dummyExport;
271 C.expertStaticFillComplete(Bview.origMatrix->getDomainMap(), Aview.origMatrix->getRangeMap(), Cimport,dummyExport,labelList);
275 Teuchos::ArrayRCP< const size_t > Crowptr;
276 Teuchos::ArrayRCP< const LocalOrdinal > Ccolind;
277 Teuchos::ArrayRCP< const Scalar > Cvalues;
278 C.getAllValues(Crowptr,Ccolind,Cvalues);
281 int MyPID = C->getComm()->getRank();
282 printf(
"[%d] Crowptr = ",MyPID);
283 for(
size_t i=0; i<(size_t) Crowptr.size(); i++) {
284 printf(
"%3d ",(
int)Crowptr.getConst()[i]);
287 printf(
"[%d] Ccolind = ",MyPID);
288 for(
size_t i=0; i<(size_t)Ccolind.size(); i++) {
289 printf(
"%3d ",(
int)Ccolind.getConst()[i]);
300 template<
class Scalar,
303 class LocalOrdinalViewType>
304 void KernelWrappers<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType>::mult_A_B_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
305 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Bview,
306 const LocalOrdinalViewType & Acol2Brow,
307 const LocalOrdinalViewType & Acol2Irow,
308 const LocalOrdinalViewType & Bcol2Ccol,
309 const LocalOrdinalViewType & Icol2Ccol,
310 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
311 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
312 const std::string& label,
313 const Teuchos::RCP<Teuchos::ParameterList>& params) {
314 #ifdef HAVE_TPETRA_MMM_TIMINGS
315 std::string prefix_mmm = std::string(
"TpetraExt ") + label + std::string(
": ");
316 using Teuchos::TimeMonitor;
317 Teuchos::RCP<TimeMonitor> MM;
324 int team_work_size = 16;
325 std::string myalg(
"LTG");
326 if(!params.is_null()) {
327 if(params->isParameter(
"openmp: algorithm"))
328 myalg = params->get(
"openmp: algorithm",myalg);
329 if(params->isParameter(
"openmp: team work size"))
330 team_work_size = params->get(
"openmp: team work size",team_work_size);
335 ::Tpetra::MatrixMatrix::ExtraKernels::mult_A_B_reuse_LowThreadGustavsonKernel(Aview,Bview,Acol2Brow,Acol2Irow,Bcol2Ccol,Icol2Ccol,C,Cimport,label,params);
338 throw std::runtime_error(
"Tpetra::MatrixMatrix::MMM reuse unknown kernel");
341 #ifdef HAVE_TPETRA_MMM_TIMINGS
342 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"MMM Reuse OpenMPESFC"))));
344 C.fillComplete(C.getDomainMap(), C.getRangeMap());
349 template<
class Scalar,
352 class LocalOrdinalViewType>
353 void KernelWrappers2<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType>::jacobi_A_B_newmatrix_kernel_wrapper(Scalar omega,
354 const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> & Dinv,
355 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
356 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Bview,
357 const LocalOrdinalViewType & Acol2Brow,
358 const LocalOrdinalViewType & Acol2Irow,
359 const LocalOrdinalViewType & Bcol2Ccol,
360 const LocalOrdinalViewType & Icol2Ccol,
361 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
362 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
363 const std::string& label,
364 const Teuchos::RCP<Teuchos::ParameterList>& params) {
366 #ifdef HAVE_TPETRA_MMM_TIMINGS
367 std::string prefix_mmm = std::string(
"TpetraExt ") + label + std::string(
": ");
368 using Teuchos::TimeMonitor;
369 Teuchos::RCP<TimeMonitor> MM;
376 int team_work_size = 16;
377 std::string myalg(
"LTG");
378 if(!params.is_null()) {
379 if(params->isParameter(
"openmp: jacobi algorithm"))
380 myalg = params->get(
"openmp: jacobi algorithm",myalg);
381 if(params->isParameter(
"openmp: team work size"))
382 team_work_size = params->get(
"openmp: team work size",team_work_size);
387 ::Tpetra::MatrixMatrix::ExtraKernels::jacobi_A_B_newmatrix_LowThreadGustavsonKernel(omega,Dinv,Aview,Bview,Acol2Brow,Acol2Irow,Bcol2Ccol,Icol2Ccol,C,Cimport,label,params);
389 else if(myalg ==
"MSAK") {
390 ::Tpetra::MatrixMatrix::ExtraKernels::jacobi_A_B_newmatrix_MultiplyScaleAddKernel(omega,Dinv,Aview,Bview,Acol2Brow,Acol2Irow,Bcol2Ccol,Icol2Ccol,C,Cimport,label,params);
392 else if(myalg ==
"KK") {
393 jacobi_A_B_newmatrix_KokkosKernels(omega,Dinv,Aview,Bview,Acol2Brow,Acol2Irow,Bcol2Ccol,Icol2Ccol,C,Cimport,label,params);
396 throw std::runtime_error(
"Tpetra::MatrixMatrix::Jacobi newmatrix unknown kernel");
399 #ifdef HAVE_TPETRA_MMM_TIMINGS
400 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"Jacobi Newmatrix OpenMPESFC"))));
404 RCP<Teuchos::ParameterList> labelList = rcp(
new Teuchos::ParameterList);
405 labelList->set(
"Timer Label",label);
406 if(!params.is_null()) labelList->set(
"compute global constants",params->get(
"compute global constants",
true));
409 if(!C.isFillComplete()) {
410 RCP<const Export<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > dummyExport;
411 C.expertStaticFillComplete(Bview.origMatrix->getDomainMap(), Aview.origMatrix->getRangeMap(), Cimport,dummyExport,labelList);
419 template<
class Scalar,
422 class LocalOrdinalViewType>
423 void KernelWrappers2<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType>::jacobi_A_B_reuse_kernel_wrapper(Scalar omega,
424 const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> & Dinv,
425 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
426 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Bview,
427 const LocalOrdinalViewType & Acol2Brow,
428 const LocalOrdinalViewType & Acol2Irow,
429 const LocalOrdinalViewType & Bcol2Ccol,
430 const LocalOrdinalViewType & Icol2Ccol,
431 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
432 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
433 const std::string& label,
434 const Teuchos::RCP<Teuchos::ParameterList>& params) {
436 #ifdef HAVE_TPETRA_MMM_TIMINGS
437 std::string prefix_mmm = std::string(
"TpetraExt ") + label + std::string(
": ");
438 using Teuchos::TimeMonitor;
439 Teuchos::RCP<TimeMonitor> MM;
446 int team_work_size = 16;
447 std::string myalg(
"LTG");
448 if(!params.is_null()) {
449 if(params->isParameter(
"openmp: jacobi algorithm"))
450 myalg = params->get(
"openmp: jacobi algorithm",myalg);
451 if(params->isParameter(
"openmp: team work size"))
452 team_work_size = params->get(
"openmp: team work size",team_work_size);
457 ::Tpetra::MatrixMatrix::ExtraKernels::jacobi_A_B_reuse_LowThreadGustavsonKernel(omega,Dinv,Aview,Bview,Acol2Brow,Acol2Irow,Bcol2Ccol,Icol2Ccol,C,Cimport,label,params);
460 throw std::runtime_error(
"Tpetra::MatrixMatrix::Jacobi reuse unknown kernel");
463 #ifdef HAVE_TPETRA_MMM_TIMINGS
464 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"Jacobi Reuse OpenMPESFC"))));
466 C.fillComplete(C.getDomainMap(), C.getRangeMap());
471 template<
class Scalar,
474 class LocalOrdinalViewType>
475 void KernelWrappers2<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType>::jacobi_A_B_newmatrix_KokkosKernels(Scalar omega,
476 const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> & Dinv,
477 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
478 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Bview,
479 const LocalOrdinalViewType & Acol2Brow,
480 const LocalOrdinalViewType & Acol2Irow,
481 const LocalOrdinalViewType & Bcol2Ccol,
482 const LocalOrdinalViewType & Icol2Ccol,
483 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
484 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
485 const std::string& label,
486 const Teuchos::RCP<Teuchos::ParameterList>& params) {
488 #ifdef HAVE_TPETRA_MMM_TIMINGS
489 std::string prefix_mmm = std::string(
"TpetraExt ") + label + std::string(
": ");
490 using Teuchos::TimeMonitor;
491 Teuchos::RCP<TimeMonitor> MM;
498 auto rowMap = Aview.origMatrix->getRowMap();
500 Aview.origMatrix->getLocalDiagCopy(diags);
501 size_t diagLength = rowMap->getLocalNumElements();
502 Teuchos::Array<Scalar> diagonal(diagLength);
503 diags.get1dCopy(diagonal());
505 for(
size_t i = 0; i < diagLength; ++i) {
506 TEUCHOS_TEST_FOR_EXCEPTION(diagonal[i] == Teuchos::ScalarTraits<Scalar>::zero(),
508 "Matrix A has a zero/missing diagonal: " << diagonal[i] << std::endl <<
509 "KokkosKernels Jacobi-fused SpGEMM requires nonzero diagonal entries in A" << std::endl);
514 using device_t =
typename Tpetra::KokkosCompat::KokkosOpenMPWrapperNode::device_type;
516 using graph_t =
typename matrix_t::StaticCrsGraphType;
517 using lno_view_t =
typename graph_t::row_map_type::non_const_type;
518 using c_lno_view_t =
typename graph_t::row_map_type::const_type;
519 using lno_nnz_view_t =
typename graph_t::entries_type::non_const_type;
520 using scalar_view_t =
typename matrix_t::values_type::non_const_type;
523 using handle_t =
typename KokkosKernels::Experimental::KokkosKernelsHandle<
524 typename lno_view_t::const_value_type,
typename lno_nnz_view_t::const_value_type,
typename scalar_view_t::const_value_type,
525 typename device_t::execution_space,
typename device_t::memory_space,
typename device_t::memory_space >;
528 c_lno_view_t Irowptr;
529 lno_nnz_view_t Icolind;
531 if(!Bview.importMatrix.is_null()) {
532 auto lclB = Bview.importMatrix->getLocalMatrixDevice();
533 Irowptr = lclB.graph.row_map;
534 Icolind = lclB.graph.entries;
539 const matrix_t Bmerged = Tpetra::MMdetails::merge_matrices(Aview,Bview,Acol2Brow,Acol2Irow,Bcol2Ccol,Icol2Ccol,C.getColMap()->getLocalNumElements());
542 const matrix_t & Amat = Aview.origMatrix->getLocalMatrixDevice();
543 const matrix_t & Bmat = Bview.origMatrix->getLocalMatrixDevice();
545 typename handle_t::nnz_lno_t AnumRows = Amat.numRows();
546 typename handle_t::nnz_lno_t BnumRows = Bmerged.numRows();
547 typename handle_t::nnz_lno_t BnumCols = Bmerged.numCols();
549 c_lno_view_t Arowptr = Amat.graph.row_map, Browptr = Bmerged.graph.row_map;
550 const lno_nnz_view_t Acolind = Amat.graph.entries, Bcolind = Bmerged.graph.entries;
551 const scalar_view_t Avals = Amat.values, Bvals = Bmerged.values;
554 lno_view_t row_mapC (Kokkos::ViewAllocateWithoutInitializing(
"non_const_lnow_row"), AnumRows + 1);
555 lno_nnz_view_t entriesC;
556 scalar_view_t valuesC;
559 int team_work_size = 16;
560 std::string myalg(
"SPGEMM_KK_MEMORY");
561 if(!params.is_null()) {
562 if(params->isParameter(
"cuda: algorithm"))
563 myalg = params->get(
"cuda: algorithm",myalg);
564 if(params->isParameter(
"cuda: team work size"))
565 team_work_size = params->get(
"cuda: team work size",team_work_size);
569 std::string nodename(
"OpenMP");
570 std::string alg = nodename + std::string(
" algorithm");
571 if(!params.is_null() && params->isParameter(alg)) myalg = params->get(alg,myalg);
572 KokkosSparse::SPGEMMAlgorithm alg_enum = KokkosSparse::StringToSPGEMMAlgorithm(myalg);
577 kh.create_spgemm_handle(alg_enum);
578 kh.set_team_work_size(team_work_size);
580 KokkosSparse::Experimental::spgemm_symbolic(&kh, AnumRows, BnumRows, BnumCols,
581 Arowptr, Acolind,
false,
582 Browptr, Bcolind,
false,
585 size_t c_nnz_size = kh.get_spgemm_handle()->get_c_nnz();
587 entriesC = lno_nnz_view_t (Kokkos::ViewAllocateWithoutInitializing(
"entriesC"), c_nnz_size);
588 valuesC = scalar_view_t (Kokkos::ViewAllocateWithoutInitializing(
"valuesC"), c_nnz_size);
591 KokkosSparse::Experimental::spgemm_jacobi(&kh, AnumRows, BnumRows, BnumCols,
592 Arowptr, Acolind, Avals,
false,
593 Browptr, Bcolind, Bvals,
false,
594 row_mapC, entriesC, valuesC,
595 omega, Dinv.getLocalViewDevice(Tpetra::Access::ReadOnly));
596 kh.destroy_spgemm_handle();
598 #ifdef HAVE_TPETRA_MMM_TIMINGS
599 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"Jacobi Newmatrix OpenMPSort"))));
603 if (params.is_null() || params->get(
"sort entries",
true))
604 Import_Util::sortCrsEntries(row_mapC, entriesC, valuesC);
605 C.setAllValues(row_mapC,entriesC,valuesC);
607 #ifdef HAVE_TPETRA_MMM_TIMINGS
608 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"Jacobi Newmatrix OpenMPESFC"))));
612 Teuchos::RCP<Teuchos::ParameterList> labelList = rcp(
new Teuchos::ParameterList);
613 labelList->set(
"Timer Label",label);
614 if(!params.is_null()) labelList->set(
"compute global constants",params->get(
"compute global constants",
true));
615 Teuchos::RCP<const Export<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > dummyExport;
616 C.expertStaticFillComplete(Bview.origMatrix->getDomainMap(), Aview.origMatrix->getRangeMap(), Cimport,dummyExport,labelList);
621 template<
class Scalar,
624 class LocalOrdinalViewType>
625 void KernelWrappers3<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType>::mult_R_A_P_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Rview,
626 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
627 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Pview,
628 const LocalOrdinalViewType & Acol2Prow,
629 const LocalOrdinalViewType & Acol2PIrow,
630 const LocalOrdinalViewType & Pcol2Accol,
631 const LocalOrdinalViewType & PIcol2Accol,
632 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Ac,
633 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Acimport,
634 const std::string& label,
635 const Teuchos::RCP<Teuchos::ParameterList>& params) {
639 #ifdef HAVE_TPETRA_MMM_TIMINGS
640 std::string prefix_mmm = std::string(
"TpetraExt ") + label + std::string(
": ");
641 using Teuchos::TimeMonitor;
642 Teuchos::RCP<TimeMonitor> MM;
646 std::string nodename(
"OpenMP");
649 std::string myalg(
"LTG");
651 if(!params.is_null()) {
652 if(params->isParameter(
"openmp: rap algorithm"))
653 myalg = params->get(
"openmp: rap algorithm",myalg);
658 ::Tpetra::MatrixMatrix::ExtraKernels::mult_R_A_P_newmatrix_LowThreadGustavsonKernel(Rview,Aview,Pview,Acol2Prow,Acol2PIrow,Pcol2Accol,PIcol2Accol,Ac,Acimport,label,params);
661 throw std::runtime_error(
"Tpetra::MatrixMatrix::R_A_P newmatrix unknown kernel");
666 template<
class Scalar,
669 class LocalOrdinalViewType>
670 void KernelWrappers3<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType>::mult_R_A_P_reuse_kernel_wrapper(
671 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Rview,
672 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
673 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Pview,
675 const LocalOrdinalViewType & Acol2Prow,
676 const LocalOrdinalViewType & Acol2Irow,
677 const LocalOrdinalViewType & Pcol2Ccol,
678 const LocalOrdinalViewType & Icol2Ccol,
679 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& C,
680 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Cimport,
681 const std::string& label,
682 const Teuchos::RCP<Teuchos::ParameterList>& params) {
684 #ifdef HAVE_TPETRA_MMM_TIMINGS
685 std::string prefix_mmm = std::string(
"TpetraExt ") + label + std::string(
": ");
686 using Teuchos::TimeMonitor;
687 Teuchos::RCP<TimeMonitor> MM;
694 std::string myalg(
"LTG");
695 if(!params.is_null()) {
696 if(params->isParameter(
"openmp: rap algorithm"))
697 myalg = params->get(
"openmp: rap algorithm",myalg);
702 ::Tpetra::MatrixMatrix::ExtraKernels::mult_R_A_P_reuse_LowThreadGustavsonKernel(Rview,Aview,Pview,Acol2Prow,Acol2Irow,Pcol2Ccol,Icol2Ccol,C,Cimport,label,params);
705 throw std::runtime_error(
"Tpetra::MatrixMatrix::R_A_P newmatrix unknown kernel");
708 #ifdef HAVE_TPETRA_MMM_TIMINGS
709 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"RAP Reuse OpenMPESFC"))));
711 C.fillComplete(C.getDomainMap(), C.getRangeMap());
718 template<
class Scalar,
721 class LocalOrdinalViewType>
722 void KernelWrappers3<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType>::mult_PT_A_P_newmatrix_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
724 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Pview,
725 const LocalOrdinalViewType & Acol2Prow,
726 const LocalOrdinalViewType & Acol2PIrow,
727 const LocalOrdinalViewType & Pcol2Accol,
728 const LocalOrdinalViewType & PIcol2Accol,
729 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Ac,
730 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Acimport,
731 const std::string& label,
732 const Teuchos::RCP<Teuchos::ParameterList>& params) {
735 #ifdef HAVE_TPETRA_MMM_TIMINGS
736 std::string prefix_mmm = std::string(
"TpetraExt ") + label + std::string(
": ");
737 using Teuchos::TimeMonitor;
738 Teuchos::RCP<TimeMonitor> MM;
742 std::string nodename(
"OpenMP");
745 std::string myalg(
"LTG");
747 if(!params.is_null()) {
748 if(params->isParameter(
"openmp: ptap algorithm"))
749 myalg = params->get(
"openmp: ptap algorithm",myalg);
753 #ifdef HAVE_TPETRA_MMM_TIMINGS
754 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"PTAP local transpose"))));
757 using Teuchos::ParameterList;
759 using LO = LocalOrdinal;
760 using GO = GlobalOrdinal;
764 using transposer_type =
765 RowMatrixTransposer<SC, LO, GO, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>;
766 transposer_type transposer (Pview.origMatrix, label +
"XP: ");
767 RCP<ParameterList> transposeParams (
new ParameterList);
768 if (! params.is_null ()) {
769 transposeParams->set (
"compute global constants",
770 params->get (
"compute global constants: temporaries",
773 transposeParams->set (
"sort",
false);
774 RCP<CrsMatrix<SC, LO, GO, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Ptrans =
775 transposer.createTransposeLocal (transposeParams);
776 CrsMatrixStruct<SC, LO, GO, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> Rview;
777 Rview.origMatrix = Ptrans;
779 using ::Tpetra::MatrixMatrix::ExtraKernels::mult_R_A_P_newmatrix_LowThreadGustavsonKernel;
780 mult_R_A_P_newmatrix_LowThreadGustavsonKernel
781 (Rview, Aview, Pview, Acol2Prow, Acol2PIrow, Pcol2Accol,
782 PIcol2Accol, Ac, Acimport, label, params);
785 throw std::runtime_error(
"Tpetra::MatrixMatrix::PT_A_P newmatrix unknown kernel");
790 template<
class Scalar,
793 class LocalOrdinalViewType>
794 void KernelWrappers3<Scalar,LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode,LocalOrdinalViewType>::mult_PT_A_P_reuse_kernel_wrapper(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Aview,
796 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Pview,
797 const LocalOrdinalViewType & Acol2Prow,
798 const LocalOrdinalViewType & Acol2PIrow,
799 const LocalOrdinalViewType & Pcol2Accol,
800 const LocalOrdinalViewType & PIcol2Accol,
801 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>& Ac,
802 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Acimport,
803 const std::string& label,
804 const Teuchos::RCP<Teuchos::ParameterList>& params) {
807 #ifdef HAVE_TPETRA_MMM_TIMINGS
808 std::string prefix_mmm = std::string(
"TpetraExt ") + label + std::string(
": ");
809 using Teuchos::TimeMonitor;
810 Teuchos::RCP<TimeMonitor> MM;
814 std::string nodename(
"OpenMP");
817 std::string myalg(
"LTG");
819 if(!params.is_null()) {
820 if(params->isParameter(
"openmp: ptap algorithm"))
821 myalg = params->get(
"openmp: ptap algorithm",myalg);
825 #ifdef HAVE_TPETRA_MMM_TIMINGS
826 MM = Teuchos::null; MM = rcp(
new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string(
"PTAP local transpose"))));
829 using Teuchos::ParameterList;
831 using LO = LocalOrdinal;
832 using GO = GlobalOrdinal;
836 using transposer_type =
837 RowMatrixTransposer<SC, LO, GO, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode>;
838 transposer_type transposer (Pview.origMatrix, label +
"XP: ");
839 RCP<ParameterList> transposeParams (
new ParameterList);
840 if (! params.is_null ()) {
841 transposeParams->set (
"compute global constants",
842 params->get (
"compute global constants: temporaries",
845 transposeParams->set (
"sort",
false);
846 RCP<CrsMatrix<SC, LO, GO, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> > Ptrans =
847 transposer.createTransposeLocal (transposeParams);
848 CrsMatrixStruct<SC, LO, GO, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode> Rview;
849 Rview.origMatrix = Ptrans;
851 using ::Tpetra::MatrixMatrix::ExtraKernels::mult_R_A_P_reuse_LowThreadGustavsonKernel;
852 mult_R_A_P_reuse_LowThreadGustavsonKernel
853 (Rview, Aview, Pview, Acol2Prow, Acol2PIrow, Pcol2Accol,
854 PIcol2Accol, Ac, Acimport, label, params);
857 throw std::runtime_error(
"Tpetra::MatrixMatrix::PT_A_P reuse unknown kernel");
859 Ac.fillComplete(Ac.getDomainMap(), Ac.getRangeMap());
static bool debug()
Whether Tpetra is in debug mode.
KokkosSparse::CrsMatrix< impl_scalar_type, local_ordinal_type, device_type, void, typename local_graph_device_type::size_type > local_matrix_device_type
The specialization of Kokkos::CrsMatrix that represents the part of the sparse matrix on each MPI pro...
A distributed dense vector.