diff --git a/CMakeLists.txt b/CMakeLists.txt index d1c3b4564..21a8ba62c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,9 +122,6 @@ if ((Omega_h_MEM_SPACE_DEVICE AND Omega_h_MEM_SPACE_HOSTPINNED) OR endif() bob_option(Omega_h_USE_MPI "Use MPI for parallelism" OFF) -if(Omega_h_USE_SimModSuite AND NOT Omega_h_USE_MPI) - message(FATAL_ERROR "Omega_h_USE_MPI must be enabled if Omega_h_USE_SimModSuite is enabled") -endif() bob_option(Omega_h_USE_OpenMP "Whether to use OpenMP" "${Kokkos_HAS_OpenMP}") bob_option(Omega_h_USE_CUDA "Whether to use CUDA" "${Kokkos_HAS_CUDA}") diff --git a/cmake/FindSimModSuite.cmake b/cmake/FindSimModSuite.cmake index 87bc8bccf..81ee656d2 100644 --- a/cmake/FindSimModSuite.cmake +++ b/cmake/FindSimModSuite.cmake @@ -19,11 +19,24 @@ # include/*.h # lib/ARCHOS/*.a -set(SIM_MPI "" CACHE STRING "MPI implementation used for SimPartitionWrapper") -if(SIM_MPI MATCHES "^$") - message(FATAL_ERROR "SIM_MPI is not defined... libSimPartitionWrapper-$SIM_MPI.a should exist in the SimModSuite lib directory") +if (Omega_h_USE_MPI) + set(SIM_MPI "" CACHE STRING "MPI implementation used for SimPartitionWrapper") + if(SIM_MPI MATCHES "^$") + message(FATAL_ERROR "SIM_MPI is not defined... libSimPartitionWrapper-$SIM_MPI.a should exist in the SimModSuite lib directory") + endif() endif() +macro(simLibCheckBootstrap libs) + simLibCheck(${libs} TRUE) + string(FIND "${SIMMODSUITE_LIBS}" "/lib/" archStart) + string(FIND "${SIMMODSUITE_LIBS}" "/libSim" archEnd) + math(EXPR archStart "${archStart}+5") + math(EXPR len "${archEnd}-${archStart}") + string(SUBSTRING "${SIMMODSUITE_LIBS}" "${archStart}" "${len}" SIM_ARCHOS) + message(STATUS "SIM_ARCHOS ${SIM_ARCHOS}") + set(SIMMODSUITE_LIBS "") +endmacro(simLibCheckBootstrap) + macro(simLibCheck libs isRequired) foreach(lib ${libs}) unset(simlib CACHE) @@ -98,17 +111,14 @@ message(STATUS "Building with SimModSuite ${SIM_DOT_VERSION}") set(SIMMODSUITE_LIBS "") -set(SIM_BOOTSTRAP_LIB_NAME - SimPartitionedMesh-mpi) +if (Omega_h_USE_MPI) + set(SIM_BOOTSTRAP_LIB_NAME SimPartitionedMesh-mpi) +else() + set(SIM_BOOTSTRAP_LIB_NAME SimPartitionedMesh) +endif() -simLibCheck("${SIM_BOOTSTRAP_LIB_NAME}" TRUE) +simLibCheckBootstrap("${SIM_BOOTSTRAP_LIB_NAME}") -string(FIND "${SIMMODSUITE_LIBS}" "/lib/" archStart) -string(FIND "${SIMMODSUITE_LIBS}" "/libSim" archEnd) -math(EXPR archStart "${archStart}+5") -math(EXPR len "${archEnd}-${archStart}") -string(SUBSTRING "${SIMMODSUITE_LIBS}" "${archStart}" "${len}" SIM_ARCHOS) -message(STATUS "SIM_ARCHOS ${SIM_ARCHOS}") option(SIM_PARASOLID "Use Parasolid through Simmetrix" OFF) if (SIM_PARASOLID) @@ -157,12 +167,21 @@ set(SIM_OPT_LIB_NAMES simLibCheck("${SIM_OPT_LIB_NAMES}" FALSE) -set(SIM_CORE_LIB_NAMES - SimPartitionedMesh-mpi - SimMeshing - SimMeshTools - SimModel - SimPartitionWrapper-${SIM_MPI}) +if (Omega_h_USE_MPI) + message(STATUS "cake mpi is enabled!") + set(SIM_CORE_LIB_NAMES + SimPartitionedMesh-mpi + SimMeshing + SimMeshTools + SimModel + SimPartitionWrapper-${SIM_MPI}) +else() + message(STATUS "cake mpi is disabled!") + set(SIM_CORE_LIB_NAMES + SimMeshing + SimMeshTools + SimModel) +endif() simLibCheck("${SIM_CORE_LIB_NAMES}" TRUE) diff --git a/src/Omega_h_meshsim.cpp b/src/Omega_h_meshsim.cpp index a764d74c8..e2e445b52 100644 --- a/src/Omega_h_meshsim.cpp +++ b/src/Omega_h_meshsim.cpp @@ -6,7 +6,6 @@ #include "Omega_h_mesh.hpp" #include "Omega_h_adj.hpp" -#include "SimPartitionedMesh.h" #include "SimModel.h" #include "SimUtil.h" #include "SimDiscrete.h" @@ -639,7 +638,6 @@ void read_internal(pMesh m, Mesh* mesh, pMeshNex numbering) { Mesh readImpl(filesystem::path const& mesh_fname, filesystem::path const& mdl_fname, filesystem::path const& numbering_fname, CommPtr comm) { - SimPartitionedMesh_start(NULL,NULL); SimModel_start(); Sim_readLicenseFile(NULL); SimDiscrete_start(0);