Skip to content

Fix build without Zoltan when MPI is enabled#6956

Open
hakonhagland wants to merge 1 commit into
OPM:masterfrom
hakonhagland:test_mpich
Open

Fix build without Zoltan when MPI is enabled#6956
hakonhagland wants to merge 1 commit into
OPM:masterfrom
hakonhagland:test_mpich

Conversation

@hakonhagland

@hakonhagland hakonhagland commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Depends on OPM/opm-grid#1013.

I encountered this issue when trying to test reservoir coupling against mpich on Ubuntu 25.10, see #6951.

  • Move general MPI includes (DeferredLogger.hpp, DeferredLoggingErrorHelpers.hpp, gatherDeferredLogger.hpp, MPISerializer.hpp, Well headers) from #if HAVE_MPI && HAVE_ZOLTAN to #if HAVE_MPI in partitionCells.cpp, since they are used by partitionCellsFromFileMPI() which is in a #if HAVE_MPI block and does not require Zoltan
  • Keep Zoltan-specific includes (ParallelNLDDPartitioningZoltan.hpp, SetupPartitioningParams.hpp) under #if HAVE_MPI && HAVE_ZOLTAN
  • Move ParallelNLDDPartitioningZoltan.cpp from the unconditional if(MPI_FOUND) source list to a nested if(ZOLTAN_FOUND) block in CMakeLists_files.cmake, since it directly includes <zoltan.h> and cannot compile without Zoltan

Motivation

When building opm-simulators with MPI enabled but without Zoltan (e.g. when using MPICH instead of OpenMPI, where the system Zoltan package is linked against OpenMPI), the build fails with two errors: OPM_BEGIN_PARALLEL_TRY_CATCH undeclared (because DeferredLoggingErrorHelpers.hpp was only included under the Zoltan guard) and zoltan.h: No such file or directory (because ParallelNLDDPartitioningZoltan.cpp was compiled unconditionally). This is a companion fix to a corresponding opm-grid PR that adds HAVE_ZOLTAN guards there. See also OPM/opm-grid#1014.

Move general MPI includes (DeferredLogger, DeferredLoggingErrorHelpers,
gatherDeferredLogger, MPISerializer, Well headers) from
These are used by partitionCellsFromFileMPI() which is in a

Move ParallelNLDDPartitioningZoltan.cpp from the MPI source list to
a nested if(ZOLTAN_FOUND) block in CMakeLists_files.cmake, since it
directly includes <zoltan.h>.
@hakonhagland

Copy link
Copy Markdown
Contributor Author

jenkins build this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants