20#ifndef AMESOS2_SHYLUBASKER_DEF_HPP
21#define AMESOS2_SHYLUBASKER_DEF_HPP
23#include <Teuchos_Tuple.hpp>
24#include <Teuchos_ParameterList.hpp>
25#include <Teuchos_StandardParameterEntryValidators.hpp>
33template <
class Matrix,
class Vector>
34ShyLUBasker<Matrix,Vector>::ShyLUBasker(
35 Teuchos::RCP<const Matrix> A,
36 Teuchos::RCP<Vector> X,
37 Teuchos::RCP<const Vector> B )
38 : SolverCore<Amesos2::ShyLUBasker,Matrix,Vector>(A, X, B)
39 , schur_out_ptr(nullptr)
40 , is_contiguous_(true)
48#if defined(HAVE_AMESOS2_KOKKOS)
53 ShyLUbasker = new ::BaskerNS::BaskerTrilinosInterface<local_ordinal_type, shylubasker_dtype, Exe_Space>();
54 ShyLUbasker->Options.no_pivot = BASKER_FALSE;
55 ShyLUbasker->Options.static_delayed_pivot = 0;
56 ShyLUbasker->Options.symmetric = BASKER_FALSE;
57 ShyLUbasker->Options.realloc = BASKER_TRUE;
58 ShyLUbasker->Options.verbose = BASKER_FALSE;
59 ShyLUbasker->Options.prune = BASKER_TRUE;
60 ShyLUbasker->Options.btf_matching = 2;
61 ShyLUbasker->Options.blk_matching = 0;
62 ShyLUbasker->Options.matrix_scaling = 0;
63 ShyLUbasker->Options.min_block_size = 0;
64 ShyLUbasker->Options.amd_dom = BASKER_TRUE;
65 ShyLUbasker->Options.use_metis = BASKER_TRUE;
66 ShyLUbasker->Options.use_nodeNDP = BASKER_TRUE;
67 ShyLUbasker->Options.run_nd_on_leaves = BASKER_TRUE;
68 ShyLUbasker->Options.run_amd_on_leaves = BASKER_FALSE;
69 ShyLUbasker->Options.transpose = BASKER_FALSE;
70 ShyLUbasker->Options.threaded_solve = BASKER_FALSE;
71 ShyLUbasker->Options.replace_zero_pivot = BASKER_TRUE;
72 ShyLUbasker->Options.replace_tiny_pivot = BASKER_FALSE;
73 ShyLUbasker->Options.verbose_matrix_out = BASKER_FALSE;
75 ShyLUbasker->Options.user_fill = (double)BASKER_FILL_USER;
76 ShyLUbasker->Options.use_sequential_diag_facto = BASKER_FALSE;
77#ifdef KOKKOS_ENABLE_OPENMP
78 num_threads = Kokkos::OpenMP::impl_max_hardware_threads();
82 ShyLUbasker->Options.worker_threads =
false;
84 ShyLUbasker->Options.partial_facto = 0;
85 ShyLUbasker->Options.only_forward_solve =
false;
86 ShyLUbasker->Options.only_backward_solve =
false;
89 TEUCHOS_TEST_FOR_EXCEPTION(1 != 0,
91 "Amesos2_ShyLUBasker Exception: Do not have Kokkos enabled for ShyLUBasker");
96template <
class Matrix,
class Vector>
97ShyLUBasker<Matrix,Vector>::~ShyLUBasker( )
100#if defined(HAVE_AMESOS2_KOKKOS)
101 ShyLUbasker->Finalize();
106template <
class Matrix,
class Vector>
109 return (this->root_ && (this->matrixA_->getComm()->getSize() == 1) && is_contiguous_);
112template<
class Matrix,
class Vector>
118#ifdef HAVE_AMESOS2_TIMERS
119 Teuchos::TimeMonitor preOrderTimer(this->timers_.preOrderTime_);
126template <
class Matrix,
class Vector>
134 int nthreads = num_threads;
135 if (ShyLUbasker->Options.partial_facto != 0) {
137 TEUCHOS_TEST_FOR_EXCEPTION
138 (nthreads < 2, std::runtime_error,
139 "ShyLU-Basker dense Schur option requires # of threads (2x # of leaves) to be greater than 1 (" << nthreads <<
")");
141 if (ShyLUbasker->Options.worker_threads) {
144 if (ShyLUbasker->Options.verbose && this->root_) {
145 std::cout <<
"Amesos2::ShyLUBasker:: reduce num threads from " << nthreads <<
" to " << nthreads/2
146 <<
" for worker threads" << std::endl;
151 ShyLUbasker->Options.worker_threads =
false;
154 ShyLUbasker->SetThreads(nthreads);
162 if ( single_proc_optimization() ) {
164 host_ordinal_type_array sp_rowptr;
165 host_ordinal_type_array sp_colind;
167 this->matrixA_->returnRowPtr_kokkos_view(sp_rowptr);
168 TEUCHOS_TEST_FOR_EXCEPTION(sp_rowptr.data() ==
nullptr,
169 std::runtime_error,
"Amesos2 Runtime Error: sp_rowptr returned null ");
170 this->matrixA_->returnColInd_kokkos_view(sp_colind);
171 TEUCHOS_TEST_FOR_EXCEPTION(sp_colind.data() ==
nullptr,
172 std::runtime_error,
"Amesos2 Runtime Error: sp_colind returned null ");
174 host_value_type_array hsp_values;
175 this->matrixA_->returnValues_kokkos_view(hsp_values);
176 shylubasker_dtype * sp_values = function_map::convert_scalar(hsp_values.data());
178 TEUCHOS_TEST_FOR_EXCEPTION(sp_values ==
nullptr,
179 std::runtime_error,
"Amesos2 Runtime Error: sp_values returned null ");
182 if (ShyLUbasker->Options.partial_facto != 0) {
183 shylubasker_dtype * sp_schur_out = function_map::convert_scalar(schur_out.data());
184 info = ShyLUbasker->Symbolic(this->globalNumRows_,
185 this->globalNumCols_,
186 this->globalNumNonZeros_,
194 info = ShyLUbasker->Symbolic(this->globalNumRows_,
195 this->globalNumCols_,
196 this->globalNumNonZeros_,
202 TEUCHOS_TEST_FOR_EXCEPTION(info != 0,
203 std::runtime_error,
"Error in ShyLUBasker Symbolic");
208 shylubasker_dtype * sp_values = function_map::convert_scalar(nzvals_view_.data());
209 if (ShyLUbasker->Options.partial_facto != 0) {
210 shylubasker_dtype * sp_schur_out = function_map::convert_scalar(schur_out.data());
211 info = ShyLUbasker->Symbolic(this->globalNumRows_,
212 this->globalNumCols_,
213 this->globalNumNonZeros_,
220 info = ShyLUbasker->Symbolic(this->globalNumRows_,
221 this->globalNumCols_,
222 this->globalNumNonZeros_,
227 TEUCHOS_TEST_FOR_EXCEPTION(info != 0,
228 std::runtime_error,
"Error in ShyLUBasker Symbolic");
234 Teuchos::broadcast(*(this->matrixA_->getComm()), 0, &info);
239template <
class Matrix,
class Vector>
248#ifdef HAVE_AMESOS2_TIMERS
249 Teuchos::TimeMonitor numFactTimer(this->timers_.numFactTime_);
257 if ( single_proc_optimization() ) {
259 host_ordinal_type_array sp_rowptr;
260 host_ordinal_type_array sp_colind;
261 this->matrixA_->returnRowPtr_kokkos_view(sp_rowptr);
262 TEUCHOS_TEST_FOR_EXCEPTION(sp_rowptr.data() ==
nullptr,
263 std::runtime_error,
"Amesos2 Runtime Error: sp_rowptr returned null ");
264 this->matrixA_->returnColInd_kokkos_view(sp_colind);
265 TEUCHOS_TEST_FOR_EXCEPTION(sp_colind.data() ==
nullptr,
266 std::runtime_error,
"Amesos2 Runtime Error: sp_colind returned null ");
268 host_value_type_array hsp_values;
269 this->matrixA_->returnValues_kokkos_view(hsp_values);
270 shylubasker_dtype * sp_values = function_map::convert_scalar(hsp_values.data());
273 TEUCHOS_TEST_FOR_EXCEPTION(sp_values ==
nullptr,
274 std::runtime_error,
"Amesos2 Runtime Error: sp_values returned null ");
277 info = ShyLUbasker->Factor( this->globalNumRows_,
278 this->globalNumCols_,
279 this->globalNumNonZeros_,
287 shylubasker_dtype * sp_values = function_map::convert_scalar(nzvals_view_.data());
288 info = ShyLUbasker->Factor(this->globalNumRows_,
289 this->globalNumCols_,
290 this->globalNumNonZeros_,
295 if (ShyLUbasker->Options.partial_facto != 0) {
296 if (schur_out_ptr !=
nullptr) {
299 for (
size_t j = 0; j < schur_size; j++) {
300 for (
size_t i = 0; i < schur_size; i++) {
301 schur_out_ptr[i+j*schur_size] = schur_out[i+j*schur_size];
309 local_ordinal_type blnnz = local_ordinal_type(0);
310 local_ordinal_type bunnz = local_ordinal_type(0);
311 ShyLUbasker->GetLnnz(blnnz);
312 ShyLUbasker->GetUnnz(bunnz);
316 this->setNnzLU( as<size_t>( blnnz + bunnz ) );
322 Teuchos::broadcast(*(this->matrixA_->getComm()), 0, &info);
325 TEUCHOS_TEST_FOR_EXCEPTION(info != 0,
326 std::runtime_error,
" ShyLUBasker::numericFactorization failed.");
332template <
class Matrix,
class Vector>
342 const global_size_type ld_rhs = this->root_ ? X->getGlobalLength() : 0;
343 const size_t nrhs = X->getGlobalNumVectors();
345 const bool ShyluBaskerTransposeRequest = this->control_.useTranspose_;
346 const bool initialize_data =
true;
347 const bool do_not_initialize_data =
false;
348 bool use_gather = use_gather_;
349 use_gather = (use_gather && this->matrixA_->getComm()->getSize() > 1);
350 use_gather = (use_gather && (std::is_same<vector_scalar_type, float>::value ||
351 std::is_same<vector_scalar_type, double>::value));
353#ifdef HAVE_AMESOS2_TIMERS
354 Teuchos::TimeMonitor mvConvTimer(this->timers_.vecConvTime_);
356 if ( single_proc_optimization() && nrhs == 1 ) {
359 Util::get_1d_copy_helper_kokkos_view<MultiVecAdapter<Vector>,
360 host_solve_array_t>::do_get(initialize_data, B, bValues_, as<size_t>(ld_rhs));
362 Util::get_1d_copy_helper_kokkos_view<MultiVecAdapter<Vector>,
363 host_solve_array_t>::do_get(do_not_initialize_data, X, xValues_, as<size_t>(ld_rhs));
368 int rval = B->gather(bValues_, this->perm_g2l, this->recvCountRows, this->recvDisplRows,
371 X->gather(xValues_, this->perm_g2l, this->recvCountRows, this->recvDisplRows,
378 Util::get_1d_copy_helper_kokkos_view<MultiVecAdapter<Vector>,
379 host_solve_array_t>::do_get(initialize_data, B, bValues_,
382 this->rowIndexBase_);
385 Util::get_1d_copy_helper_kokkos_view<MultiVecAdapter<Vector>,
386 host_solve_array_t>::do_get(do_not_initialize_data, X, xValues_,
389 this->rowIndexBase_);
395#ifdef HAVE_AMESOS2_TIMERS
396 Teuchos::TimeMonitor solveTimer(this->timers_.solveTime_);
399 shylubasker_dtype * pxValues = function_map::convert_scalar(xValues_.data());
400 shylubasker_dtype * pbValues = function_map::convert_scalar(bValues_.data());
401 if (!ShyluBaskerTransposeRequest)
402 ierr = ShyLUbasker->Solve(nrhs, pbValues, pxValues);
404 ierr = ShyLUbasker->Solve(nrhs, pbValues, pxValues,
true);
407 Teuchos::broadcast(*(this->getComm()), 0, &ierr);
409 TEUCHOS_TEST_FOR_EXCEPTION( ierr > 0,
411 "Encountered zero diag element at: " << ierr);
412 TEUCHOS_TEST_FOR_EXCEPTION( ierr == -1,
414 "Could not alloc needed working memory for solve" );
416#ifdef HAVE_AMESOS2_TIMERS
417 Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
420 int rval = X->scatter(xValues_, this->perm_g2l, this->recvCountRows, this->recvDisplRows,
422 if (rval != 0) use_gather =
false;
425 Util::put_1d_data_helper_kokkos_view<
435template <
class Matrix,
class Vector>
440 return( this->globalNumRows_ == this->globalNumCols_ );
444template <
class Matrix,
class Vector>
449 using Teuchos::getIntegralValue;
450 using Teuchos::ParameterEntryValidator;
452 RCP<const Teuchos::ParameterList> valid_params = getValidParameters_impl();
454 if(parameterList->isParameter(
"IsContiguous"))
456 is_contiguous_ = parameterList->get<
bool>(
"IsContiguous");
459 if(parameterList->isParameter(
"UseCustomGather"))
461 use_gather_ = parameterList->get<
bool>(
"UseCustomGather");
464 if(parameterList->isParameter(
"num_threads"))
466 num_threads = parameterList->get<
int>(
"num_threads");
468 if(parameterList->isParameter(
"worker_threads"))
470 ShyLUbasker->Options.worker_threads = parameterList->get<
bool>(
"worker_threads");
472 if(parameterList->isParameter(
"pivot"))
474 ShyLUbasker->Options.no_pivot = (!parameterList->get<
bool>(
"pivot"));
476 if(parameterList->isParameter(
"delayed pivot"))
478 ShyLUbasker->Options.static_delayed_pivot = (parameterList->get<
int>(
"delayed pivot"));
480 if(parameterList->isParameter(
"pivot_tol"))
482 ShyLUbasker->Options.pivot_tol = parameterList->get<
double>(
"pivot_tol");
484 if(parameterList->isParameter(
"symmetric"))
486 ShyLUbasker->Options.symmetric = parameterList->get<
bool>(
"symmetric");
488 if(parameterList->isParameter(
"realloc"))
490 ShyLUbasker->Options.realloc = parameterList->get<
bool>(
"realloc");
492 if(parameterList->isParameter(
"verbose"))
494 ShyLUbasker->Options.verbose = parameterList->get<
bool>(
"verbose");
496 if(parameterList->isParameter(
"verbose_matrix"))
498 ShyLUbasker->Options.verbose_matrix_out = parameterList->get<
bool>(
"verbose_matrix");
500 if(parameterList->isParameter(
"btf"))
502 ShyLUbasker->Options.btf = parameterList->get<
bool>(
"btf");
504 if(parameterList->isParameter(
"use_metis"))
506 ShyLUbasker->Options.use_metis = parameterList->get<
bool>(
"use_metis");
508 if(parameterList->isParameter(
"use_nodeNDP"))
510 ShyLUbasker->Options.use_nodeNDP = parameterList->get<
bool>(
"use_nodeNDP");
512 if(parameterList->isParameter(
"run_nd_on_leaves"))
514 ShyLUbasker->Options.run_nd_on_leaves = parameterList->get<
bool>(
"run_nd_on_leaves");
516 if(parameterList->isParameter(
"run_amd_on_leaves"))
518 ShyLUbasker->Options.run_amd_on_leaves = parameterList->get<
bool>(
"run_amd_on_leaves");
520 if(parameterList->isParameter(
"amd_on_blocks"))
522 ShyLUbasker->Options.amd_dom = parameterList->get<
bool>(
"amd_on_blocks");
524 if(parameterList->isParameter(
"transpose"))
527 const auto transpose = parameterList->get<
bool>(
"transpose");
528 if (transpose ==
true)
529 this->control_.useTranspose_ =
true;
531 if(parameterList->isParameter(
"threaded_solve"))
533 ShyLUbasker->Options.threaded_solve = parameterList->get<
bool>(
"threaded_solve");
535 if(parameterList->isParameter(
"use_sequential_diag_facto"))
537 ShyLUbasker->Options.use_sequential_diag_facto = parameterList->get<
bool>(
"use_sequential_diag_facto");
539 if(parameterList->isParameter(
"user_fill"))
541 ShyLUbasker->Options.user_fill = parameterList->get<
double>(
"user_fill");
543 if(parameterList->isParameter(
"prune"))
545 ShyLUbasker->Options.prune = parameterList->get<
bool>(
"prune");
547 if(parameterList->isParameter(
"replace_zero_pivot"))
549 ShyLUbasker->Options.replace_zero_pivot = parameterList->get<
bool>(
"replace_zero_pivot");
551 if(parameterList->isParameter(
"replace_tiny_pivot"))
553 ShyLUbasker->Options.replace_tiny_pivot = parameterList->get<
bool>(
"replace_tiny_pivot");
555 if(parameterList->isParameter(
"btf_matching"))
557 ShyLUbasker->Options.btf_matching = parameterList->get<
int>(
"btf_matching");
558 if (ShyLUbasker->Options.btf_matching == 1 || ShyLUbasker->Options.btf_matching == 2) {
559 ShyLUbasker->Options.matching =
true;
561 ShyLUbasker->Options.matching =
false;
564 if(parameterList->isParameter(
"blk_matching"))
566 ShyLUbasker->Options.blk_matching = parameterList->get<
int>(
"blk_matching");
568 if(parameterList->isParameter(
"matrix_scaling"))
570 ShyLUbasker->Options.matrix_scaling = parameterList->get<
int>(
"matrix_scaling");
572 if(parameterList->isParameter(
"min_block_size"))
574 ShyLUbasker->Options.min_block_size = parameterList->get<
int>(
"min_block_size");
577 if(parameterList->isParameter(
"PartialFacto"))
579 ShyLUbasker->Options.partial_facto = parameterList->get<
int>(
"PartialFacto");
581 if(parameterList->isParameter(
"SchurPart"))
584 auto schur_part_ptr = parameterList->get<
const local_ordinal_type*>(
"SchurPart");
585 Kokkos::resize(schur_part, this->globalNumCols_);
587 for (global_size_type i=0; i<this->globalNumCols_; i++) {
588 schur_part(i) = schur_part_ptr[i];
589 if (schur_part(i) == 1) schur_size ++;
592 Kokkos::resize(schur_out, schur_size*schur_size);
594 if(parameterList->isParameter(
"SchurOut"))
597 schur_out_ptr = parameterList->get<scalar_type*>(
"SchurOut");
599 if(parameterList->isParameter(
"OnlyForwardSolve"))
601 ShyLUbasker->Options.only_forward_solve = parameterList->get<
bool>(
"OnlyForwardSolve");
603 if(parameterList->isParameter(
"OnlyBackwardSolve"))
605 ShyLUbasker->Options.only_backward_solve = parameterList->get<
bool>(
"OnlyBackwardSolve");
609template <
class Matrix,
class Vector>
610Teuchos::RCP<const Teuchos::ParameterList>
613 using Teuchos::ParameterList;
615 static Teuchos::RCP<const Teuchos::ParameterList> valid_params;
617 if( is_null(valid_params) )
619 Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
620 pl->set(
"IsContiguous",
true,
621 "Are GIDs contiguous");
622 pl->set(
"UseCustomGather",
true,
623 "Use Matrix-gather routine");
624 pl->set(
"num_threads", 1,
625 "Number of threads");
626 pl->set(
"pivot",
false,
628 pl->set(
"delayed pivot", 0,
629 "Apply static delayed pivot on a big block");
630 pl->set(
"pivot_tol", .0001,
631 "Tolerance before pivot, currently not used");
632 pl->set(
"symmetric",
false,
633 "Should Symbolic assume symmetric nonzero pattern");
634 pl->set(
"realloc" ,
false,
635 "Should realloc space if not enough");
636 pl->set(
"verbose",
false,
637 "Information about factoring");
638 pl->set(
"verbose_matrix",
false,
639 "Give Permuted Matrices");
642 pl->set(
"prune",
false,
643 "Use prune on BTF blocks (Not Supported)");
644 pl->set(
"btf_matching", 2,
645 "Matching option for BTF: 0 = none, 1 = Basker, 2 = Trilinos (default), (3 = MC64 if enabled)");
646 pl->set(
"blk_matching", 0,
647 "Matching optioon for block: 0 = none, 1 or anything else = Basker (default), (2 = MC64 if enabled)");
648 pl->set(
"matrix_scaling", 0,
649 "Use matrix scaling to biig A BTF block: 0 = no-scaling, 1 = symmetric diagonal scaling, 2 = row-max, and then col-max scaling");
650 pl->set(
"min_block_size", 0,
651 "Size of the minimum diagonal blocks");
652 pl->set(
"replace_zero_pivot",
true,
653 "Replace zero pivots during the numerical factorization");
654 pl->set(
"replace_tiny_pivot",
false,
655 "Replace tiny pivots during the numerical factorization");
656 pl->set(
"use_metis",
true,
658 pl->set(
"use_nodeNDP",
true,
659 "Use nodeND to compute ND partition");
660 pl->set(
"run_nd_on_leaves",
false,
661 "Run ND on the final leaf-nodes for ND factorization");
662 pl->set(
"run_amd_on_leaves",
false,
663 "Run AMD on the final leaf-nodes for ND factorization");
664 pl->set(
"amd_on_blocks",
true,
665 "Run AMD on each diagonal blocks");
666 pl->set(
"transpose",
false,
667 "Solve the transpose A");
668 pl->set(
"threaded_solve",
false,
669 "Use threads for forward/backward solves");
670 pl->set(
"worker_threads",
false,
671 "Use worker thread for ND factorization");
672 pl->set(
"use_sequential_diag_facto",
false,
673 "Use sequential algorithm to factor each diagonal block");
674 pl->set(
"user_fill", (
double)BASKER_FILL_USER,
675 "User-provided padding for the fill ratio");
678 scalar_type *dummy_scalar_ptr;
679 const local_ordinal_type *dummy_ordinal_ptr;
680 pl->set(
"PartialFacto", 0,
681 "Perform partial factorization to extract dense Schur complement (0: no, 1: form + factor Schur, 2: ony form");
682 pl->set(
"SchurPart", dummy_ordinal_ptr,
683 "Specify rows/columns belonging to Schur complement for partial factorization");
684 pl->set(
"SchurOut", dummy_scalar_ptr,
685 "Store output Schur complement from partial factorization");
686 pl->set(
"OnlyForwardSolve",
false,
687 "Perform only the forward substitution");
688 pl->set(
"OnlyBackwardSolve",
false,
689 "Perform only the backward substitution");
696template <
class Matrix,
class Vector>
701 if(current_phase == SOLVE || current_phase == PREORDERING )
return(
false );
703 #ifdef HAVE_AMESOS2_TIMERS
704 Teuchos::TimeMonitor convTimer(this->timers_.mtxConvTime_);
709 if ( single_proc_optimization() ) {
716 if( this->root_ && current_phase == SYMBFACT )
718 Kokkos::resize(nzvals_view_, this->globalNumNonZeros_);
719 Kokkos::resize(rowind_view_, this->globalNumNonZeros_);
720 Kokkos::resize(colptr_view_, this->globalNumCols_ + 1);
723 local_ordinal_type nnz_ret = -1;
724 bool use_gather = use_gather_;
725 use_gather = (use_gather && this->matrixA_->getComm()->getSize() > 1);
726 use_gather = (use_gather && (std::is_same<scalar_type, float>::value || std::is_same<scalar_type, double>::value));
728 #ifdef HAVE_AMESOS2_TIMERS
729 Teuchos::TimeMonitor mtxRedistTimer( this->timers_.mtxRedistTime_ );
732 bool column_major =
true;
733 if (!is_contiguous_) {
734 auto contig_mat = this->matrixA_->reindex(this->contig_rowmap_, this->contig_colmap_, current_phase);
735 nnz_ret = contig_mat->gather(nzvals_view_, rowind_view_, colptr_view_, this->perm_g2l, this->recvCountRows, this->recvDisplRows, this->recvCounts, this->recvDispls,
736 this->transpose_map, this->nzvals_t, column_major, current_phase);
738 nnz_ret = this->matrixA_->gather(nzvals_view_, rowind_view_, colptr_view_, this->perm_g2l, this->recvCountRows, this->recvDisplRows, this->recvCounts, this->recvDispls,
739 this->transpose_map, this->nzvals_t, column_major, current_phase);
743 if (nnz_ret < 0) use_gather =
false;
748 ::do_get(this->matrixA_.ptr(), nzvals_view_, rowind_view_, colptr_view_, nnz_ret,
751 this->rowIndexBase_);
756 if (use_gather || this->root_) {
757 TEUCHOS_TEST_FOR_EXCEPTION( nnz_ret != as<local_ordinal_type>(this->globalNumNonZeros_),
759 "Amesos2_ShyLUBasker loadA_impl: Did not get the expected number of non-zero vals("
760 +std::to_string(nnz_ret)+
" vs "+std::to_string(this->globalNumNonZeros_)+
")");
767template <
class Matrix,
class Vector>
770 const Teuchos::EVerbosityLevel verbLevel)
const
772 out <<
" ShyLUBasker current parameters:" << std::endl;
773 out <<
" > IsContiguous = " << (is_contiguous_ ?
"YES" :
"NO") << std::endl;
774 out <<
" > UseCustomGather = " << (use_gather_ ?
"YES" :
"NO") << std::endl;
775 out <<
" > num_threads = " << num_threads << std::endl;
776 out <<
" > worker_threads = " << ShyLUbasker->Options.worker_threads << std::endl;
777 out <<
" > pivot = " << ShyLUbasker->Options.no_pivot << std::endl;
778 out <<
" > pivot_tol = " << ShyLUbasker->Options.pivot_tol << std::endl;
779 out <<
" > realloc = " << ShyLUbasker->Options.realloc << std::endl;
780 out <<
" > verbose = " << (ShyLUbasker->Options.verbose ?
"YES" :
"NO") << std::endl;
781 out <<
" > btf = " << (ShyLUbasker->Options.btf ?
"YES" :
"NO") << std::endl;
782 out <<
" > use_metis = " << (ShyLUbasker->Options.use_metis ?
"YES" :
"NO") << std::endl;
783 out <<
" > use_nodeNDP = " << (ShyLUbasker->Options.use_nodeNDP ?
"YES" :
"NO") << std::endl;
784 out <<
" > run_nd_on_leaves = " << (ShyLUbasker->Options.run_nd_on_leaves ?
"YES" :
"NO") << std::endl;
785 out <<
" > run_amd_on_leaves = " << (ShyLUbasker->Options.run_amd_on_leaves ?
"YES" :
"NO") << std::endl;
786 out <<
" > amd_on_blocks = " << (ShyLUbasker->Options.amd_dom ?
"YES" :
"NO") << std::endl;
787 out <<
" > transpose = " << (this->control_.useTranspose_ ?
"YES" :
"NO") << std::endl;
788 out <<
" > threaded_solve = " << (ShyLUbasker->Options.threaded_solve ?
"YES" :
"NO") << std::endl;
789 out <<
" > user_fill = " << ShyLUbasker->Options.user_fill << std::endl;
790 out <<
" > prune = " << (ShyLUbasker->Options.prune ?
"YES" :
"NO") << std::endl;
791 out <<
" > replace_zero_pivot = " << (ShyLUbasker->Options.replace_zero_pivot ?
"YES" :
"NO") << std::endl;
792 out <<
" > replace_tiny_pivot = " << (ShyLUbasker->Options.replace_tiny_pivot ?
"YES" :
"NO") << std::endl;
793 out <<
" > btf_matching = " << (ShyLUbasker->Options.btf_matching ?
"YES" :
"NO") << std::endl;
794 out <<
" > blk_matching = " << (ShyLUbasker->Options.blk_matching ?
"YES" :
"NO") << std::endl;
795 out <<
" > use_sequential_diag_facto = " << (ShyLUbasker->Options.use_sequential_diag_facto ?
"YES" :
"NO") << std::endl;
796 out <<
" > partial_facto = " << ShyLUbasker->Options.partial_facto << std::endl;
801template<
class Matrix,
class Vector>
Amesos2 ShyLUBasker declarations.
@ ROOTED
Definition Amesos2_TypeDecl.hpp:93
@ CONTIGUOUS_AND_ROOTED
Definition Amesos2_TypeDecl.hpp:94
@ ARBITRARY
Definition Amesos2_TypeDecl.hpp:109
A Matrix adapter interface for Amesos2.
Definition Amesos2_MatrixAdapter_decl.hpp:42
Amesos2 interface to the Baker package.
Definition Amesos2_ShyLUBasker_decl.hpp:43
EPhase
Used to indicate a phase in the direct solution.
Definition Amesos2_TypeDecl.hpp:31
void transpose(ArrayView< Scalar > vals, ArrayView< GlobalOrdinal > indices, ArrayView< GlobalSizeT > ptr, ArrayView< Scalar > trans_vals, ArrayView< GlobalOrdinal > trans_indices, ArrayView< GlobalSizeT > trans_ptr)
A templated MultiVector class adapter for Amesos2.
Definition Amesos2_MultiVecAdapter_decl.hpp:142
A generic helper class for getting a CCS representation of a Matrix.
Definition Amesos2_Util.hpp:589