Commit 3231f967 authored by Dominik Bongartz's avatar Dominik Bongartz
Browse files

Update to newest mumps

Updated mumps pointer to newest verison of our mumps repo, which
contains MUMPS 5.4.0. Needed to make some slight changes to the
interface because of the MPI fix we did in our MUMPS repo: Since we only
used MUMPS sequentially, but potentially within an MPI code, we renamed
all things called MPI_* in MUMPS (including in particular their fake
implementation of the MPI functions) to FPI_*.
parent f64c5b74
......@@ -20,9 +20,9 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/coinutilsSourceFiles.cmake)
add_library(clp ${CLP_SOURCES} ${COINUTILS_SOURCES})
target_include_directories(clp
PUBLIC
${CLP_SRCDIR}
${CLP_COINDIR}
PUBLIC
${CLP_SRCDIR}
${CLP_COINDIR}
)
set_target_properties(clp PROPERTIES DEBUG_POSTFIX d)
......@@ -37,81 +37,82 @@ endif()
if(MSVC)
target_compile_options(clp PRIVATE /MP)
else()
target_compile_options(clp
PRIVATE
$<$<C_COMPILER_ID:Intel>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<C_COMPILER_ID:GNU>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<C_COMPILER_ID:AppleClang>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<C_COMPILER_ID:Clang>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
target_compile_options(clp
PRIVATE
$<$<C_COMPILER_ID:Intel>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<C_COMPILER_ID:GNU>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<C_COMPILER_ID:AppleClang>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<C_COMPILER_ID:Clang>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
)
endif()
target_compile_options(clp
PRIVATE
$<$<C_COMPILER_ID:MSVC>: /wd4141;/wd4068;/wd4018;/wd4244;/wd4267;/wd4065;/wd4102;/wd4101;/wd4805>
$<$<C_COMPILER_ID:Intel>: $<$<PLATFORM_ID:Windows>:/Qwd858> $<$<NOT:$<PLATFORM_ID:Windows>>:-wd858>>
$<$<C_COMPILER_ID:GNU>: -Wno-stringop-overflow -Wno-format-overflow>
$<$<C_COMPILER_ID:AppleClang>: -Wno-constant-logical-operand -Wno-deprecated-register -Wno-parentheses-equality -Wno-constant-conversion>
$<$<C_COMPILER_ID:Clang>: -Wno-constant-logical-operand -Wno-deprecated-register -Wno-parentheses-equality -Wno-constant-conversion>
PRIVATE
$<$<C_COMPILER_ID:MSVC>: /wd4141;/wd4068;/wd4018;/wd4244;/wd4267;/wd4065;/wd4102;/wd4101;/wd4805>
$<$<C_COMPILER_ID:Intel>: $<$<PLATFORM_ID:Windows>:/Qwd858> $<$<NOT:$<PLATFORM_ID:Windows>>:-wd858>>
$<$<C_COMPILER_ID:GNU>: -Wno-stringop-overflow -Wno-format-overflow>
$<$<C_COMPILER_ID:AppleClang>: -Wno-constant-logical-operand -Wno-deprecated-register -Wno-parentheses-equality -Wno-constant-conversion>
$<$<C_COMPILER_ID:Clang>: -Wno-constant-logical-operand -Wno-deprecated-register -Wno-parentheses-equality -Wno-constant-conversion>
)
target_compile_definitions(clp
PRIVATE
__BYTE_ORDER
HAVE_CONFIG_H
CLP_BUILD
COINUTILS_BUILD
$<$<C_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS>
PRIVATE
__BYTE_ORDER
HAVE_CONFIG_H
CLP_BUILD
COINUTILS_BUILD
COIN_USE_MUMPS_MPI_H
$<$<C_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS>
)
if(WIN32)
target_compile_definitions(clp
PRIVATE
NDEBUG # Since there is a portion of CLP code (which is compiled if NDEBUG is not defined) that uses usleep (which does not exist for windows), so we need to disable it
target_compile_definitions(clp
PRIVATE
NDEBUG # Since there is a portion of CLP code (which is compiled if NDEBUG is not defined) that uses usleep (which does not exist for windows), so we need to disable it
)
endif()
target_link_libraries(clp
PRIVATE
mumps
blas
lapack
PRIVATE
mumps
blas
lapack
)
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# Add dependencies
add_subdirectory(dep/blas)
message("BLAS done.")
add_subdirectory(dep/lapack)
message("LAPACK done.")
add_subdirectory(dep/mumps)
message("MUMPS done.")
# Test executables
add_executable(clp-test
${PROJECT_SOURCE_DIR}/test/test.cpp
)
target_link_libraries(clp-test clp)
target_compile_features(clp-test PRIVATE cxx_std_11)
# Add dependencies
add_subdirectory(dep/blas)
message("BLAS done.")
add_subdirectory(dep/lapack)
message("LAPACK done.")
add_subdirectory(dep/mumps)
message("MUMPS done.")
# Test executables
add_executable(clp-test
${PROJECT_SOURCE_DIR}/test/test.cpp
)
target_link_libraries(clp-test clp)
target_compile_features(clp-test PRIVATE cxx_std_11)
endif()
# Determine Fortran-C name mangling
if((${MUMPS_usePrecompiledDll}) AND (${BLAS_usePrecompiledDll}) AND (${LAPACK_usePrecompiledDlls}))
set(MANGLINGFILE "lapackNameMangling.h")
set(MANGLINGMACRO FCLAPACK_GLOBAL)
set(MANGLINGMACRO_ FCLAPACK_GLOBAL_)
set(MANGLINGFILE "lapackNameMangling.h")
set(MANGLINGMACRO FCLAPACK_GLOBAL)
set(MANGLINGMACRO_ FCLAPACK_GLOBAL_)
else()
set(MANGLINGFILE "lapackNameMangling.h")
enable_language(Fortran)
# Fortran-C Interface
include(FortranCInterface)
set(MANGLINGFILE "clpNameMangling.h")
set(MANGLINGMACRO FCCLP_GLOBAL)
set(MANGLINGMACRO_ FCCLP_GLOBAL_)
FortranCInterface_HEADER(${CMAKE_CURRENT_BINARY_DIR}/clpNameMangling/${MANGLINGFILE} MACRO_NAMESPACE "FCCLP_")
add_library(clpNameMangling INTERFACE)
target_include_directories(clp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/clpNameMangling)
set(MANGLINGFILE "lapackNameMangling.h")
enable_language(Fortran)
# Fortran-C Interface
include(FortranCInterface)
set(MANGLINGFILE "clpNameMangling.h")
set(MANGLINGMACRO FCCLP_GLOBAL)
set(MANGLINGMACRO_ FCCLP_GLOBAL_)
FortranCInterface_HEADER(${CMAKE_CURRENT_BINARY_DIR}/clpNameMangling/${MANGLINGFILE} MACRO_NAMESPACE "FCCLP_")
add_library(clpNameMangling INTERFACE)
target_include_directories(clp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/clpNameMangling)
endif()
......
......@@ -7,7 +7,7 @@
#include "ClpConfig.h"
#define MPI_COMM_WORLD CLP_MPI_COMM_WORLD
#define FPI_COMM_WORLD CLP_FPI_COMM_WORLD
#define JOB_INIT -1
#define JOB_END -2
#define USE_COMM_WORLD -987654
......@@ -50,12 +50,12 @@ ClpCholeskyMumps::ClpCholeskyMumps(int denseThreshold, int logLevel)
mumps_->comm_fortran = USE_COMM_WORLD;
int myid;
int justName;
MPI_Init(&justName, NULL);
FPI_Init(&justName, NULL);
#ifndef NDEBUG
int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &myid);
int ierr = FPI_Comm_rank(FPI_COMM_WORLD, &myid);
assert(!ierr);
#else
MPI_Comm_rank(MPI_COMM_WORLD, &myid);
FPI_Comm_rank(FPI_COMM_WORLD, &myid);
#endif
dmumps_c(mumps_);
#define ICNTL(I) icntl[(I)-1] /* macro s.t. indices match documentation */
......@@ -89,7 +89,7 @@ ClpCholeskyMumps::~ClpCholeskyMumps()
{
mumps_->job = JOB_END;
dmumps_c(mumps_); /* Terminate instance */
MPI_Finalize();
FPI_Finalize();
free(mumps_);
}
......
Subproject commit 72ec1603826019531be974367211eba253ddfb26
Subproject commit 8d03311bd66b2bee39a8db75e68bf822b02952c9
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment