[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.
Please register or sign in to comment