diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 947aa693..0c127570 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -42,8 +42,11 @@ endfunction() add_lcit_benchmarks(lcitb_pt2pt.cpp) -find_package(MPI) -if(MPI_FOUND) - add_lcit_benchmark(mpi_pt2pt.cpp) - target_link_libraries(mpi_pt2pt PRIVATE MPI::MPI_CXX) +option(LCI_WITH_MPI_BENCHMARKS "Build MPI Benchmarks by default" ON) +if(LCI_WITH_MPI_BENCHMARKS) + find_package(MPI) + if(MPI_FOUND) + add_lcit_benchmark(mpi_pt2pt.cpp) + target_link_libraries(mpi_pt2pt PRIVATE MPI::MPI_CXX) + endif() endif() diff --git a/contrib/spack/packages/lci/package.py b/contrib/spack/packages/lci/package.py index fd6c8cc8..de5cf2cd 100644 --- a/contrib/spack/packages/lci/package.py +++ b/contrib/spack/packages/lci/package.py @@ -80,6 +80,7 @@ def is_positive_int(val): ('auto',), ('pmix', 'pmi2', 'pmi1', 'mpi', 'local'), ).prohibit_empty_set( ).with_default('auto').with_non_feature_values('auto')) + variant('mpi-benchmarks', default=False, description='Enable MPI benchmark', when="@1.7.8:") generator('ninja', 'make', default='ninja') @@ -87,8 +88,8 @@ def is_positive_int(val): depends_on('libfabric', when='fabric=ofi') depends_on('rdma-core', when='fabric=ibv') depends_on('ucx', when='fabric=ucx') - depends_on('mpi', when='default-pm=mpi') depends_on('mpi', when='enable-pm=mpi') + depends_on('mpi', when='+mpi-benchmarks') depends_on('papi', when='+papi') depends_on('doxygen', when='+docs') depends_on('cray-mpich', when='platform=cray') @@ -103,6 +104,7 @@ def cmake_args(self): self.define_from_variant('LCI_WITH_EXAMPLES', 'examples'), self.define_from_variant('LCI_WITH_TESTS', 'tests'), self.define_from_variant('LCI_WITH_BENCHMARKS', 'benchmarks'), + self.define_from_variant('LCI_WITH_MPI_BENCHMARKS', 'mpi-benchmarks'), self.define_from_variant('LCI_WITH_DOC', 'docs'), self.define_from_variant('LCI_USE_AVX', 'vector'), self.define_from_variant('LCI_CONFIG_USE_ALIGNED_ALLOC', 'aligned'), diff --git a/lct/pmi/CMakeLists.txt b/lct/pmi/CMakeLists.txt index f5448de2..821f4558 100644 --- a/lct/pmi/CMakeLists.txt +++ b/lct/pmi/CMakeLists.txt @@ -35,10 +35,10 @@ if(LCT_PMI_BACKEND_ENABLE_PMI2) target_sources_relative(${LIBRARY_NAME} PRIVATE pmi_wrapper_pmi2.cpp) endif() -find_package(MPI COMPONENTS CXX) option(LCT_PMI_BACKEND_ENABLE_MPI - "Enable MPI as the process management backend" ${MPI_FOUND}) + "Enable MPI as the process management backend" OFF) if(LCT_PMI_BACKEND_ENABLE_MPI) + find_package(MPI COMPONENTS CXX) if(MPI_FOUND) target_sources_relative(${LIBRARY_NAME} PRIVATE pmi_wrapper_mpi.cpp) target_link_libraries(${LIBRARY_NAME} PRIVATE MPI::MPI_CXX)