Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate mumps solver #27

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions cmake/packages/FindMUMPS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,20 @@ if(MUMPS_FOUND AND NOT TARGET mumps)
set_property(TARGET mumps APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "ptesmumps")

add_library(scalapack UNKNOWN IMPORTED)
set_target_properties(scalapack PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${SCALAPACK_LIBRARY}")

set_property(TARGET mumps APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "scalapack")
#if(TARGET mkl)
# set_property(TARGET mumps APPEND PROPERTY
# INTERFACE_LINK_LIBRARIES "mkl")
#endif()
if(TARGET mkl)
set_property(TARGET mumps APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "mkl")
else()
add_library(scalapack UNKNOWN IMPORTED)
set_target_properties(scalapack PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${SCALAPACK_LIBRARY}")


set_property(TARGET mumps APPEND PROPERTY
INTERFACE_LINK_LIBRARIES "scalapack")
endif()


add_library(gfortran UNKNOWN IMPORTED)
set_target_properties(gfortran PROPERTIES
Expand Down
22 changes: 22 additions & 0 deletions modules/external_packages/src/alien/kernels/petsc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,24 @@
)
endif (TARGET superlu)

if (TARGET mumps)
if(USE_AXLSTAR)
generateAxl(alien_external_packages
linear_solver/mumps/PETScSolverConfigMUMPS.axl
linear_solver/mumps/PETScPrecConfigMUMPS.axl
AXL_OPTION_GENERATION_MODE ${AXL_OPTION_GENERATION_TYPE}
NAMESPACE ${NAMESPACE_TYPE}
${IS_WITH_ARCANE}
${IS_WITH_MESH}
INSTALL_GENERATED_FILES
)
endif()
addSources(alien_external_packages
linear_solver/mumps/PETScSolverConfigMUMPSService.cc
linear_solver/mumps/PETScPrecConfigMUMPSService.cc
)
endif (TARGET mumps)

if (TARGET superlu)
linkLibraries(alien_external_packages superlu)
endif ()
Expand All @@ -128,6 +146,10 @@
linkLibraries(alien_external_packages superludist)
endif ()

if (TARGET mumps)
linkLibraries(alien_external_packages mumps)
endif ()

if (TARGET metis)
linkLibraries(alien_external_packages metis)
endif ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Generated by createNew
*/

#include <alien/kernels/petsc/linear_solver/MUMPS/PETScPrecConfigMUMPSService.h>
#include <alien/kernels/petsc/linear_solver/mumps/PETScPrecConfigMUMPSService.h>
#include <ALIEN/axl/PETScPrecConfigMUMPS_StrongOptions.h>

/* Pour debugger le ILU, utiliser l'option:
Expand Down Expand Up @@ -30,9 +30,9 @@ PETScPrecConfigMUMPSService::PETScPrecConfigMUMPSService(
#endif

PETScPrecConfigMUMPSService::PETScPrecConfigMUMPSService(
IParallelMng* parallel_mng, std::shared_ptr<IOptionsPETScPrecConfigMUMPS> options)
Arccore::MessagePassing::IMessagePassingMng* parallel_mng, std::shared_ptr<IOptionsPETScPrecConfigMUMPS> options)
: ArcanePETScPrecConfigMUMPSObject(options)
, PETScConfig(parallel_mng->isParallel())
, PETScConfig(parallel_mng->commSize() > 1)
{
;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ALIEN_EXTERNAL_PACKAGES_EXPORT PETScPrecConfigMUMPSService
#endif

PETScPrecConfigMUMPSService(
IParallelMng* parallel_mng, std::shared_ptr<IOptionsPETScPrecConfigMUMPS> options);
Arccore::MessagePassing::IMessagePassingMng* parallel_mng, std::shared_ptr<IOptionsPETScPrecConfigMUMPS> options);

/** Destructeur de la classe */
virtual ~PETScPrecConfigMUMPSService() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Generated by createNew
*/

#include <alien/kernels/petsc/linear_solver/MUMPS/PETScSolverConfigMUMPSService.h>
#include <alien/kernels/petsc/linear_solver/mumps/PETScSolverConfigMUMPSService.h>
#include <ALIEN/axl/PETScSolverConfigMUMPS_StrongOptions.h>

/*---------------------------------------------------------------------------*/
Expand All @@ -21,9 +21,9 @@ PETScSolverConfigMUMPSService::PETScSolverConfigMUMPSService(
}
#endif
PETScSolverConfigMUMPSService::PETScSolverConfigMUMPSService(
IParallelMng* parallel_mng, std::shared_ptr<IOptionsPETScSolverConfigMUMPS> options)
Arccore::MessagePassing::IMessagePassingMng* parallel_mng, std::shared_ptr<IOptionsPETScSolverConfigMUMPS> options)
: ArcanePETScSolverConfigMUMPSObject(options)
, PETScConfig(parallel_mng->isParallel())
, PETScConfig(parallel_mng->commSize() > 1)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PETScSolverConfigMUMPSService : public ArcanePETScSolverConfigMUMPSObject,
/** Constructeur de la classe */
PETScSolverConfigMUMPSService(const Arcane::ServiceBuildInfo& sbi);

PETScSolverConfigMUMPSService(IParallelMng* parallel_mng,
PETScSolverConfigMUMPSService(Arccore::MessagePassing::IMessagePassingMng* parallel_mng,
std::shared_ptr<IOptionsPETScSolverConfigMUMPS> options);

/** Destructeur de la classe */
Expand Down
14 changes: 14 additions & 0 deletions test/Tests/RefSemantic/block/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ foreach (REFMVTESTS
--solver-package=petsc
--solver=lu
)

if (TARGET mumps)
alien_test(
BENCH refmvhandlers.block
NAME ${REFMVTESTS}.petsc.mumps
PROCS 4
COMMAND refmvhandlers.Block${REFMVTESTS}
OPTIONS
--size=100
--solver-package=petsc
--solver=mumps
)
endif ()

endif ()

if (TARGET hypre)
Expand Down
14 changes: 14 additions & 0 deletions test/Tests/RefSemantic/scalar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,20 @@ foreach (REFMVTESTS
--solver-package=petsc
--solver=lu
)

if (TARGET mumps)
alien_test(
BENCH refmvhandlers.scalar
NAME ${REFMVTESTS}.petsc.mumps
PROCS 4
COMMAND refmvhandlers.Scalar${REFMVTESTS}
OPTIONS
--size=100
--solver-package=petsc
--solver=mumps
)
endif ()

endif (TARGET petsc)

if (TARGET hypre)
Expand Down
15 changes: 15 additions & 0 deletions test/Tests/Solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
#include <ALIEN/axl/PETScSolverConfigBiCGStab_StrongOptions.h>
#include <ALIEN/axl/PETScSolverConfigLU_IOptions.h>
#include <ALIEN/axl/PETScSolverConfigLU_StrongOptions.h>

#include <alien/kernels/petsc/linear_solver/mumps/PETScSolverConfigMUMPSService.h>
#include <ALIEN/axl/PETScSolverConfigMUMPS_IOptions.h>

// root linear solver instance
#include <ALIEN/axl/PETScLinearSolver_IOptions.h>
#include <ALIEN/axl/PETScLinearSolver_StrongOptions.h>
Expand Down Expand Up @@ -120,7 +124,18 @@ createSolver(boost::program_options::variables_map& vm)
// root petsc service
return std::make_shared<Alien::PETScLinearSolverService>(pm, root_options);
}
if (solver.compare("mumps") == 0) {
// solver service mumps
auto options_solver = std::make_shared<IOptionsPETScSolverConfigMUMPS>();
// root petsc option
auto root_options = std::make_shared<StrongOptionsPETScLinearSolver>(
PETScLinearSolverOptionsNames::_solver =
std::make_shared<Alien::PETScSolverConfigMUMPSService>(pm, options_solver));
// root petsc service
return std::make_shared<Alien::PETScLinearSolverService>(pm, root_options);
}
tm->fatal() << "*** solver " << solver << " not available in test!";

#else
tm->fatal() << "*** package " << solver_package << " not available!";
#endif
Expand Down