97#ifdef HAVE_AMESOS2_TIMERS
98 Teuchos::TimeMonitor symFactTime( this->timers_.symFactTime_ );
103 if(do_optimization()) {
104 this->matrixA_->returnRowPtr_kokkos_view(host_row_ptr_view_);
105 this->matrixA_->returnColInd_kokkos_view(host_cols_view_);
108 data_.solver.setSolutionMethod(data_.method);
109 data_.solver.setLevelSetOptionAlgorithmVariant(data_.variant);
115 data_.solver.analyze(this->globalNumCols_, host_row_ptr_view_, host_cols_view_);
116 data_.solver.initialize();
143 const Teuchos::Ptr<
const MultiVecAdapter<Vector> > B)
const
147 const global_size_type ld_rhs = this->root_ ? X->getGlobalLength() : 0;
148 const size_t nrhs = X->getGlobalNumVectors();
157#ifdef HAVE_AMESOS2_TIMERS
158 Teuchos::TimeMonitor mvConvTimer(this->timers_.vecConvTime_);
159 Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
161 const bool initialize_data =
true;
162 const bool do_not_initialize_data =
false;
163 Util::get_1d_copy_helper_kokkos_view<MultiVecAdapter<Vector>,
164 device_solve_array_t>::do_get(initialize_data, B, this->bValues_,
166 ROOTED, this->rowIndexBase_);
167 bDidAssignX = Util::get_1d_copy_helper_kokkos_view<MultiVecAdapter<Vector>,
168 device_solve_array_t>::do_get(do_not_initialize_data, X, this->xValues_,
170 ROOTED, this->rowIndexBase_);
176#ifdef HAVE_AMESOS2_TIMER
177 Teuchos::TimeMonitor solveTimer(this->timers_.solveTime_);
180 if (workspace_.extent(0) < this->globalNumRows_ || workspace_.extent(1) < nrhs) {
181 workspace_ = device_solve_array_t(
182 Kokkos::ViewAllocateWithoutInitializing(
"t"), this->globalNumRows_, nrhs);
185 data_.solver.solve(xValues_, bValues_, workspace_);
194 Teuchos::broadcast(*(this->getComm()), 0, &ierr);
196 TEUCHOS_TEST_FOR_EXCEPTION( ierr != 0, std::runtime_error,
197 "tacho_solve has error code: " << ierr );
204#ifdef HAVE_AMESOS2_TIMERS
205 Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
210 Util::template put_1d_data_helper_kokkos_view<
211 MultiVecAdapter<Vector>,device_solve_array_t>::do_put(X, xValues_,
213 ROOTED, this->rowIndexBase_);
289 if(current_phase == SOLVE) {
293 if(!do_optimization()) {
294#ifdef HAVE_AMESOS2_TIMERS
295 Teuchos::TimeMonitor convTimer(this->timers_.mtxConvTime_);
305 device_nzvals_view_ = device_value_type_array(
306 Kokkos::ViewAllocateWithoutInitializing(
"nzvals"), this->globalNumNonZeros_);
307 host_cols_view_ = host_ordinal_type_array(
308 Kokkos::ViewAllocateWithoutInitializing(
"colind"), this->globalNumNonZeros_);
309 host_row_ptr_view_ = host_size_type_array(
310 Kokkos::ViewAllocateWithoutInitializing(
"rowptr"), this->globalNumRows_ + 1);
313 typename host_size_type_array::value_type nnz_ret = 0;
315 #ifdef HAVE_AMESOS2_TIMERS
316 Teuchos::TimeMonitor mtxRedistTimer( this->timers_.mtxRedistTime_ );
319 TEUCHOS_TEST_FOR_EXCEPTION( this->rowIndexBase_ != this->columnIndexBase_,
321 "Row and column maps have different indexbase ");
324 device_value_type_array, host_ordinal_type_array, host_size_type_array>::do_get(
325 this->matrixA_.ptr(),
331 this->columnIndexBase_);
TachoSolver(Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
Initialize from Teuchos::RCP.
Definition Amesos2_Tacho_def.hpp:58