37 : SolverCore<Amesos2::Basker,Matrix,Vector>(A, X, B)
87 #ifdef HAVE_AMESOS2_TIMERS
88 Teuchos::TimeMonitor numFactTimer(this->timers_.numFactTime_);
91 #ifdef HAVE_AMESOS2_VERBOSE_DEBUG
92 std::cout <<
"Basker:: Before numeric factorization" << std::endl;
93 std::cout <<
"nzvals_ : " << nzvals_.toString() << std::endl;
94 std::cout <<
"rowind_ : " << rowind_.toString() << std::endl;
95 std::cout <<
"colptr_ : " << colptr_.toString() << std::endl;
98 basker_dtype * pBaskerValues = function_map::convert_scalar(host_nzvals_view_.data());
99 info = basker.factor(this->globalNumRows_, this->globalNumCols_, this->globalNumNonZeros_, host_col_ptr_view_.data(), host_rows_view_.data(), pBaskerValues);
103 this->setNnzLU( as<size_t>(basker.get_NnzLU() ) ) ;
109 Teuchos::broadcast(*(this->matrixA_->getComm()), 0, &info);
113 TEUCHOS_TEST_FOR_EXCEPTION( (info == -1) ,
115 "Basker: Could not alloc space for L and U");
116 TEUCHOS_TEST_FOR_EXCEPTION( (info == -2),
118 "Basker: Could not alloc needed work space");
119 TEUCHOS_TEST_FOR_EXCEPTION( (info == -3) ,
121 "Basker: Could not alloc additional memory needed for L and U");
122 TEUCHOS_TEST_FOR_EXCEPTION( (info > 0) ,
124 "Basker: Zero pivot found at: " << info );
140 const global_size_type ld_rhs = this->root_ ? X->getGlobalLength() : 0;
141 const size_t nrhs = X->getGlobalNumVectors();
145#ifdef HAVE_AMESOS2_TIMERS
146 Teuchos::TimeMonitor mvConvTimer(this->timers_.vecConvTime_);
147 Teuchos::TimeMonitor redistTimer( this->timers_.vecRedistTime_ );
150 const bool initialize_data =
true;
151 const bool do_not_initialize_data =
false;
152 if ( single_proc_optimization() && nrhs == 1 ) {
154 Util::get_1d_copy_helper_kokkos_view<MultiVecAdapter<Vector>,
155 host_solve_array_t>::do_get(initialize_data, B, bValues_, as<size_t>(ld_rhs));
157 bDidAssignX = Util::get_1d_copy_helper_kokkos_view<MultiVecAdapter<Vector>,
158 host_solve_array_t>::do_get(do_not_initialize_data, X, xValues_, as<size_t>(ld_rhs));
161 Util::get_1d_copy_helper_kokkos_view<MultiVecAdapter<Vector>,
162 host_solve_array_t>::do_get(initialize_data, B, bValues_,
165 this->rowIndexBase_);
168 bDidAssignX = Util::get_1d_copy_helper_kokkos_view<MultiVecAdapter<Vector>,
169 host_solve_array_t>::do_get(do_not_initialize_data, X, xValues_,
172 this->rowIndexBase_);
177#ifdef HAVE_AMESOS2_TIMERS
178 Teuchos::TimeMonitor solveTimer(this->timers_.solveTime_);
181 basker_dtype * pxBaskerValues = function_map::convert_scalar(xValues_.data());
182 basker_dtype * pbBaskerValues = function_map::convert_scalar(bValues_.data());
183 ierr = basker.solveMultiple(nrhs, pbBaskerValues, pxBaskerValues);
187 Teuchos::broadcast(*(this->getComm()), 0, &ierr);
189 TEUCHOS_TEST_FOR_EXCEPTION( ierr > 0,
191 "Encountered zero diag element at: " << ierr);
192 TEUCHOS_TEST_FOR_EXCEPTION( ierr == -1,
194 "Could not alloc needed working memory for solve" );
199#ifdef HAVE_AMESOS2_TIMERS
200 Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
203 Util::put_1d_data_helper_kokkos_view<MultiVecAdapter<Vector>,
204 host_solve_array_t>::do_put(X, xValues_,
264 if(current_phase == SOLVE)
return (
false);
266 #ifdef HAVE_AMESOS2_TIMERS
267 Teuchos::TimeMonitor convTimer(this->timers_.mtxConvTime_);
272 host_nzvals_view_ = host_value_type_array(
273 Kokkos::ViewAllocateWithoutInitializing(
"host_nzvals_view_"), this->globalNumNonZeros_);
274 host_rows_view_ = host_ordinal_type_array(
275 Kokkos::ViewAllocateWithoutInitializing(
"host_rows_view_"), this->globalNumNonZeros_);
276 host_col_ptr_view_ = host_ordinal_type_array(
277 Kokkos::ViewAllocateWithoutInitializing(
"host_col_ptr_view_"), this->globalNumRows_ + 1);
280 local_ordinal_type nnz_ret = 0;
282 #ifdef HAVE_AMESOS2_TIMERS
283 Teuchos::TimeMonitor mtxRedistTimer( this->timers_.mtxRedistTime_ );
288 ::do_get(this->matrixA_.ptr(),
289 host_nzvals_view_, host_rows_view_, host_col_ptr_view_, nnz_ret,
292 this->rowIndexBase_);
296 TEUCHOS_TEST_FOR_EXCEPTION( nnz_ret != as<local_ordinal_type>(this->globalNumNonZeros_),
298 "Amesos2_Basker loadA_impl: Did not get the expected number of non-zero vals");