Skip to content

Commit 5a3b5bd

Browse files
committed
add {ma27,ma57,mumps}_print_level options
1 parent 0001b10 commit 5a3b5bd

File tree

4 files changed

+43
-12
lines changed

4 files changed

+43
-12
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ More detailed information about incremental changes can be found in the
77

88
## 3.14
99

10+
### 3.14.8 (2022-07-13)
11+
12+
- Added options ma27_print_level, ma57_print_level, and mumps_print_level
13+
to enable output from these linear solvers.
14+
1015
### 3.14.7 (2022-06-24)
1116

1217
- Fixed that ComputeSensitivityMatrix() of sIpopt assumed that there are

src/Algorithm/LinearSolvers/IpMa27TSolverInterface.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ void Ma27TSolverInterface::RegisterOptions(
8484
SmartPtr<RegisteredOptions> roptions
8585
)
8686
{
87+
roptions->AddBoundedIntegerOption(
88+
"ma27_print_level",
89+
"Debug printing level for the linear solver MA27",
90+
0, 4, 0,
91+
"0: no printing; 1: Error messages only; 2: Error and warning messages; 3: Error and warning messages and terse monitoring; 4: All information.");
8792
roptions->AddBoundedNumberOption(
8893
"ma27_pivtol",
8994
"Pivot tolerance for the linear solver MA27.",
@@ -200,6 +205,8 @@ bool Ma27TSolverInterface::InitializeImpl(
200205
pivtolmax_ = Max(pivtolmax_, pivtol_);
201206
}
202207

208+
Index print_level;
209+
options.GetIntegerValue("ma27_print_level", print_level, prefix);
203210
options.GetNumericValue("ma27_liw_init_factor", liw_init_factor_, prefix);
204211
options.GetNumericValue("ma27_la_init_factor", la_init_factor_, prefix);
205212
options.GetNumericValue("ma27_meminc_factor", meminc_factor_, prefix);
@@ -210,11 +217,13 @@ bool Ma27TSolverInterface::InitializeImpl(
210217

211218
/* Set the default options for MA27 */
212219
ma27i(icntl_, cntl_);
213-
#if IPOPT_VERBOSITY == 0
214220

215-
icntl_[0] = 0; // Suppress error messages
216-
icntl_[1] = 0; // Suppress diagnostic messages
217-
#endif
221+
if( print_level == 0 )
222+
icntl_[0] = 0; // Suppress error messages
223+
if( print_level <= 1 )
224+
icntl_[1] = 0; // Suppress warning messages
225+
if( print_level >= 2 )
226+
icntl_[2] = print_level - 2; // diagnostic messages level
218227

219228
// Reset all private data
220229
initialized_ = false;

src/Algorithm/LinearSolvers/IpMa57TSolverInterface.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ void Ma57TSolverInterface::RegisterOptions(
192192
SmartPtr<RegisteredOptions> roptions
193193
)
194194
{
195+
roptions->AddLowerBoundedIntegerOption(
196+
"ma57_print_level",
197+
"Debug printing level for the linear solver MA57",
198+
0, 0,
199+
"0: no printing; 1: Error messages only; 2: Error and warning messages; 3: Error and warning messages and terse monitoring; >=4: All information.");
195200
roptions->AddBoundedNumberOption(
196201
"ma57_pivtol",
197202
"Pivot tolerance for the linear solver MA57.",
@@ -321,6 +326,9 @@ bool Ma57TSolverInterface::InitializeImpl(
321326
DBG_ASSERT(ma57i != NULL);
322327

323328
// Obtain the options settings
329+
Index print_level;
330+
options.GetIntegerValue("ma57_print_level", print_level, prefix);
331+
324332
options.GetNumericValue("ma57_pivtol", pivtol_, prefix);
325333
if( options.GetNumericValue("ma57_pivtolmax", pivtolmax_, prefix) )
326334
{
@@ -361,7 +369,7 @@ bool Ma57TSolverInterface::InitializeImpl(
361369
wd_icntl_[1] = 0; /* Warning stream. */
362370

363371
wd_icntl_[3] = 1; /* Print statistics. NOT Used. */
364-
wd_icntl_[4] = 0; /* Print error. */
372+
wd_icntl_[4] = print_level; /* Print level. */
365373

366374
wd_icntl_[5] = ma57_pivot_order; /* Pivoting order. */
367375

src/Algorithm/LinearSolvers/IpMumpsSolverInterface.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ MumpsSolverInterface::MumpsSolverInterface()
105105
#endif
106106

107107
mumps_c(mumps_);
108-
mumps_->icntl[1] = 0;
109-
mumps_->icntl[2] = 0; //QUIETLY!
110-
mumps_->icntl[3] = 0;
108+
mumps_->icntl[2] = 0; // global info stream
109+
mumps_->icntl[3] = 0; // print level
111110
mumps_ptr_ = (void*) mumps_;
112111
}
113112

@@ -131,6 +130,11 @@ void MumpsSolverInterface::RegisterOptions(
131130
SmartPtr<RegisteredOptions> roptions
132131
)
133132
{
133+
roptions->AddLowerBoundedIntegerOption(
134+
"mumps_print_level",
135+
"Debug printing level for the linear solver MUMPS",
136+
0, 0,
137+
"0: no printing; 1: Error messages only; 2: Error, warning, and main statistic messages; 3: Error and warning messages and terse diagnostics; >=4: All information.");
134138
roptions->AddBoundedNumberOption(
135139
"mumps_pivtol",
136140
"Pivot tolerance for the linear solver MUMPS.",
@@ -190,6 +194,9 @@ bool MumpsSolverInterface::InitializeImpl(
190194
const std::string& prefix
191195
)
192196
{
197+
Index print_level;
198+
options.GetIntegerValue("mumps_print_level", print_level, prefix);
199+
193200
options.GetNumericValue("mumps_pivtol", pivtol_, prefix);
194201
if( options.GetNumericValue("mumps_pivtolmax", pivtolmax_, prefix) )
195202
{
@@ -229,6 +236,12 @@ bool MumpsSolverInterface::InitializeImpl(
229236
"MumpsSolverInterface called with warm_start_same_structure, but the problem is solved for the first time.");
230237
}
231238

239+
if( print_level > 0 )
240+
{
241+
mumps_->icntl[2] = 6; // global info stream
242+
mumps_->icntl[3] = print_level; // print level
243+
}
244+
232245
return true;
233246
}
234247

@@ -387,10 +400,6 @@ ESymSolverStatus MumpsSolverInterface::SymbolicFactorization()
387400

388401
mumps_data->job = 1; //symbolic ordering pass
389402

390-
//mumps_data->icntl[1] = 6;
391-
//mumps_data->icntl[2] = 6;//QUIETLY!
392-
//mumps_data->icntl[3] = 4;
393-
394403
mumps_data->icntl[5] = mumps_permuting_scaling_;
395404
mumps_data->icntl[6] = mumps_pivot_order_;
396405
mumps_data->icntl[7] = mumps_scaling_;

0 commit comments

Comments
 (0)