Skip to content
Snippets Groups Projects
Commit 14371eb3 authored by Markus Blatt's avatar Markus Blatt
Browse files

[release] Always indicate whether we support parallelism.

Since commit 495f2fce USE_MPI was removed from dunecontrol and
the default configuration now defaults to use
parallelism. Unfortunately, there are downstream modules that try to
support multiple versions of DUNE. Sometimes these need to decide
whether to support parallelism before they know which version of DUNE
they are using. This is was not possible when providing
--enable-parallel as no variable gets set for DUNE>=2.4.

With this commit dunecontrol always sets
CMAKE_DISABLE_FIND_PACKAGE_MPI to an appropriate value. Thus if
dunecontrol is used then one can check in one's own module whether the
variable is set explicitly to false and conclude that one is using
>=2.4 and wants parallelism. Otherwise one can check USE_MPI to detect
which behaviour is needed for 2.3.

E.g. like this:
<code>
option (USE_MPI "Use Message Passing Interface for parallel computing" OFF)

if( NOT CMAKE_DISABLE_FIND_PACKAGE_MPI STREQUAL ""
    AND NOT CMAKE_DISABLE_FIND_PACKAGE_MPI)
  set(USE_MPI ON)
endif()

if (NOT USE_MPI)
      set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
 set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
endif (NOT USE_MPI)
</code>

Of course without dunecontrol and using the defaults one will still
configure DUNE as parallel, but one's own module as sequential.
parent 21dbaefe
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@ dune_common_options_am2cmake()
echo $PARAMS | grep \\-\\-disable-parallel > /dev/null
if test "$?" -eq 0 ; then
CMAKE_PARAMS="$CMAKE_PARAMS -DCMAKE_DISABLE_FIND_PACKAGE_MPI=TRUE"
else
CMAKE_PARAMS="$CMAKE_PARAMS -DCMAKE_DISABLE_FIND_PACKAGE_MPI=FALSE"
fi
# Check for --disable-cxx11check
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment