Skip to content

Commit 1760fc9

Browse files
committed
have option mumps_mpi_communicator only if not using MUMPS' fake mpi.h
- ref #790
1 parent 112be59 commit 1760fc9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

doc/options.dox

+1-1
Original file line numberDiff line numberDiff line change
@@ -2476,7 +2476,7 @@ Possible values:
24762476
\anchor OPT_mumps_mpi_communicator
24772477
<strong>mumps_mpi_communicator</strong> (<em>advanced</em>): MPI communicator used for matrix operations
24782478
<blockquote>
2479-
This sets the MPI communicator. MPI_COMM_WORLD is the default. Any other value should be the return value from MPI_Comm_c2f. The valid range for this integer option is unrestricted and its default value is -987654.
2479+
This sets the MPI communicator. MPI_COMM_WORLD is the default. Any other value should be the return value from MPI_Comm_c2f. The valid range for this integer option is unrestricted and its default value is -987654. This option is only available if MUMPS's libseq/mpi.h is not used.
24802480
</blockquote>
24812481

24822482

src/Algorithm/LinearSolvers/IpMumpsSolverInterface.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,14 @@ void MumpsSolverInterface::RegisterOptions(
172172
"Threshold to consider a pivot at zero in detection of linearly dependent constraints with MUMPS.",
173173
0.0,
174174
"This is CNTL(3) in MUMPS.", true);
175+
#ifndef COIN_USE_MUMPS_MPI_H
175176
roptions->AddIntegerOption(
176177
"mumps_mpi_communicator",
177178
"MPI communicator used for matrix operations",
178179
USE_COMM_WORLD,
179-
"This sets the MPI communicator. MPI_COMM_WORLD is the default. Any other value should be the return value from MPI_Comm_c2f.", true);
180+
"This sets the MPI communicator. MPI_COMM_WORLD is the default. Any other value should be the return value from MPI_Comm_c2f. "
181+
"This option is only available if MUMPS's libseq/mpi.h is not used.", true);
182+
#endif
180183
}
181184

182185
/// give name of MUMPS with version info
@@ -217,7 +220,11 @@ bool MumpsSolverInterface::InitializeImpl(
217220
MUMPS_STRUC_C* mumps_ = static_cast<MUMPS_STRUC_C*>(mumps_ptr_);
218221

219222
Index mpi_comm;
223+
#ifndef COIN_USE_MUMPS_MPI_H
220224
options.GetIntegerValue("mumps_mpi_communicator", mpi_comm, prefix);
225+
#else
226+
mpi_comm = USE_COMM_WORLD;
227+
#endif
221228
mumps_->comm_fortran = static_cast<int>(mpi_comm);
222229

223230
#ifndef IPOPT_MUMPS_NOMUTEX

0 commit comments

Comments
 (0)