From 735229e2acb285eda57fa2c7931579f2f2e229c0 Mon Sep 17 00:00:00 2001 From: nychiang Date: Tue, 25 Jul 2023 12:44:33 -0700 Subject: [PATCH 1/3] update parameter settings --- src/LinAlg/hiopLinSolverSymSparseMA57.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/LinAlg/hiopLinSolverSymSparseMA57.cpp b/src/LinAlg/hiopLinSolverSymSparseMA57.cpp index 3c1ab476e..9d503733a 100644 --- a/src/LinAlg/hiopLinSolverSymSparseMA57.cpp +++ b/src/LinAlg/hiopLinSolverSymSparseMA57.cpp @@ -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] = 10; // use one step of iterative refinement icntl_[11-1] = 16; icntl_[12-1] = 16; icntl_[15-1] = 0; @@ -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 and 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_ ); @@ -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(&x_in); assert(x!=nullptr); From 84009a414c235d35c61224f91f3be78941914e0b Mon Sep 17 00:00:00 2001 From: nychiang Date: Tue, 25 Jul 2023 12:46:16 -0700 Subject: [PATCH 2/3] update default parameter settings --- src/LinAlg/hiopLinSolverSymSparseMA57.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LinAlg/hiopLinSolverSymSparseMA57.cpp b/src/LinAlg/hiopLinSolverSymSparseMA57.cpp index 9d503733a..d663ae004 100644 --- a/src/LinAlg/hiopLinSolverSymSparseMA57.cpp +++ b/src/LinAlg/hiopLinSolverSymSparseMA57.cpp @@ -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; // use one step 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; From 0646a8f6bd13c0e884fdc51cddd98131e1e380a3 Mon Sep 17 00:00:00 2001 From: nychiang Date: Thu, 27 Jul 2023 00:22:00 -0700 Subject: [PATCH 3/3] fix typo --- src/LinAlg/hiopLinSolverSymSparseMA57.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LinAlg/hiopLinSolverSymSparseMA57.cpp b/src/LinAlg/hiopLinSolverSymSparseMA57.cpp index d663ae004..0a479216c 100644 --- a/src/LinAlg/hiopLinSolverSymSparseMA57.cpp +++ b/src/LinAlg/hiopLinSolverSymSparseMA57.cpp @@ -92,7 +92,7 @@ namespace hiop keep_ = new int[lkeep_]{0}; // Initialize to 0 as otherwise MA57ED can sometimes fail iwork_ = new int[5 * n_]; - if(icntl_[9-1] > 1 and icntl_[10-1] > 1 ) { + 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_];