100 if (data_.Symbolic) {
101 function_map::umfpack_free_symbolic(&(data_.Symbolic));
104 function_map::umfpack_defaults(data_.Control);
106 status = function_map::umfpack_symbolic(
107 this->globalNumRows_,this->globalNumCols_,
108 &(this->colptr_view_[0]), &(this->rowind_view_[0]),
109 &(this->nzvals_view_[0]), &(data_.Symbolic), data_.Control, data_.Info);
122 if(!data_.Symbolic) {
123 symbolicFactorization_impl();
126 function_map::umfpack_defaults(data_.Control);
129 function_map::umfpack_free_numeric(&(data_.Numeric));
132 status = function_map::umfpack_numeric(
133 &(this->colptr_view_[0]),
134 &(this->rowind_view_[0]), &(this->nzvals_view_[0]), data_.Symbolic,
135 &(data_.Numeric), data_.Control, data_.Info);
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();
150 const size_t val_store_size = as<size_t>(ld_rhs * nrhs);
151 Teuchos::Array<umfpack_type> xValues(val_store_size);
152 Teuchos::Array<umfpack_type> bValues(val_store_size);
155#ifdef HAVE_AMESOS2_TIMERS
156 Teuchos::TimeMonitor mvConvTimer(this->timers_.vecConvTime_);
157 Teuchos::TimeMonitor redistTimer( this->timers_.vecRedistTime_ );
159 if ( is_contiguous_ ==
true ) {
161 umfpack_type>::do_get(B, bValues(),
164 this->rowIndexBase_);
168 umfpack_type>::do_get(B, bValues(),
171 this->rowIndexBase_);
175 int UmfpackRequest = this->control_.useTranspose_ ? UMFPACK_At : UMFPACK_A;
181#ifdef HAVE_AMESOS2_TIMER
182 Teuchos::TimeMonitor solveTimer(this->timers_.solveTime_);
184 if (data_.Symbolic) {
185 function_map::umfpack_free_symbolic(&(data_.Symbolic));
189 int i_ld_rhs = as<int>(ld_rhs);
191 for(
size_t j = 0 ; j < nrhs; j++) {
192 int status = function_map::umfpack_solve(
194 &(this->colptr_view_[0]), &(this->rowind_view_[0]), &(this->nzvals_view_[0]),
195 &xValues.getRawPtr()[j*i_ld_rhs],
196 &bValues.getRawPtr()[j*i_ld_rhs],
197 data_.Numeric, data_.Control, data_.Info);
208 Teuchos::broadcast(*(this->getComm()), 0, &ierr);
210 TEUCHOS_TEST_FOR_EXCEPTION( ierr != 0, std::runtime_error,
211 "umfpack_solve has error code: " << ierr );
215#ifdef HAVE_AMESOS2_TIMERS
216 Teuchos::TimeMonitor redistTimer(this->timers_.vecRedistTime_);
219 if ( is_contiguous_ ==
true ) {
221 MultiVecAdapter<Vector>,umfpack_type>::do_put(X, xValues(),
224 this->rowIndexBase_);
228 MultiVecAdapter<Vector>,umfpack_type>::do_put(X, xValues(),
231 this->rowIndexBase_);
288 if(current_phase == SOLVE) {
292#ifdef HAVE_AMESOS2_TIMERS
293 Teuchos::TimeMonitor convTimer(this->timers_.mtxConvTime_);
298 Kokkos::resize(nzvals_view_,this->globalNumNonZeros_);
299 Kokkos::resize(rowind_view_,this->globalNumNonZeros_);
300 Kokkos::resize(colptr_view_,this->globalNumCols_ + 1);
305#ifdef HAVE_AMESOS2_TIMERS
306 Teuchos::TimeMonitor mtxRedistTimer( this->timers_.mtxRedistTime_ );
309 TEUCHOS_TEST_FOR_EXCEPTION( this->rowIndexBase_ != this->columnIndexBase_,
311 "Row and column maps have different indexbase ");
312 if ( is_contiguous_ ==
true ) {
314 host_value_type_array,host_ordinal_type_array, host_size_type_array>::do_get(this->matrixA_.ptr(),
315 nzvals_view_, rowind_view_,
316 colptr_view_, nnz_ret,
319 this->rowIndexBase_);
322 host_value_type_array,host_ordinal_type_array, host_size_type_array>::do_get(this->matrixA_.ptr(),
323 nzvals_view_, rowind_view_,
324 colptr_view_, nnz_ret,
327 this->rowIndexBase_);
Umfpack(Teuchos::RCP< const Matrix > A, Teuchos::RCP< Vector > X, Teuchos::RCP< const Vector > B)
Initialize from Teuchos::RCP.
Definition Amesos2_Umfpack_def.hpp:58