Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/LinAlg/hiopLinSolverSymSparseMA57.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace hiop
// 4 use Metis;
// 5 automatic choice(MA47 or Metis);
icntl_[7-1] = 1; // Pivoting strategy.
icntl_[9-1] = 10; // up to 10 steps of iterative refinement
icntl_[9-1] = 1; // use one step of iterative refinement
icntl_[11-1] = 16;
icntl_[12-1] = 16;
icntl_[15-1] = 0;
Expand All @@ -92,7 +92,13 @@ namespace hiop
keep_ = new int[lkeep_]{0}; // Initialize to 0 as otherwise MA57ED can sometimes fail

iwork_ = new int[5 * n_];
dwork_ = new double[n_];
if(icntl_[9-1] > 1 && icntl_[10-1] > 1 ) {
dwork_ = new double[4*n_];
} else if(icntl_[9-1] > 1) {
dwork_ = new double[3*n_];
} else {
dwork_ = new double[n_];
}

MA57AD( &n_, &nnz_, irowM_, jcolM_, &lkeep_, keep_, iwork_, icntl_, info_, rinfo_ );

Expand Down Expand Up @@ -194,7 +200,10 @@ namespace hiop

int job = 1; // full solve
int one = 1;
icntl_[9-1] = 1; // do one step of iterative refinement

if(icntl_[9-1]>1) {
job = 0; // only allow 0 or 2
}

hiopVector* x = dynamic_cast<hiopVector*>(&x_in);
assert(x!=nullptr);
Expand Down