Skip to content

Commit

Permalink
Update spack package.py: rename options; remove pure mpi benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
JiakunYan committed May 7, 2024
1 parent 1703bb5 commit d9b81a0
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 201 deletions.
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ if(NOT LCI_WITH_LCT_ONLY)

find_package(IBV)
find_package(OFI)
find_package(UCX)
find_package(UCX CONFIG)
string(TOUPPER ${LCI_SERVER} LCI_SERVER_UPPER)
if(${LCI_SERVER_UPPER}_FOUND)
# If the user-specified server are found, just use it.
Expand Down Expand Up @@ -175,13 +175,6 @@ if(NOT LCI_WITH_LCT_ONLY)
option(LCI_ENABLE_PRG_NET_ENDPOINT_DEFAULT
"Enable the progress specific network endpoint by default." ON)

option(LCI_USE_GPROF "Enable GPROF" OFF)
if(LCI_USE_GPROF)
add_compile_options(-pg -fno-inline)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
endif()

include(CheckCCompilerFlag)
check_c_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
option(LCI_OPTIMIZE_FOR_NATIVE "Build with -march=native"
Expand Down
9 changes: 0 additions & 9 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,3 @@ function(add_lcit_benchmarks)
endfunction()

add_lcit_benchmarks(lcitb_pt2pt.cpp)

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()
File renamed without changes.
262 changes: 138 additions & 124 deletions contrib/spack/packages/lci/package.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from spack import *
import os
from spack.package import *


class Lci(CMakePackage):
"""LCI: the Lightweight Communication Interface"""

homepage = 'https://github.com/uiuc-hpc/lci'
url = 'https://github.com/uiuc-hpc/lci/archive/refs/tags/v1.7.7.tar.gz'
git = 'https://github.com/uiuc-hpc/lci.git'
homepage = "https://github.com/uiuc-hpc/lci"
url = "https://github.com/uiuc-hpc/lci/archive/refs/tags/v1.7.7.tar.gz"
git = "https://github.com/uiuc-hpc/lci.git"

maintainers('omor1', 'JiakunYan')
maintainers("omor1", "JiakunYan")

version('master', branch='master')
version('coll', branch='topic/coll')
version("master", branch="master")
version("1.7.7", sha256="c310f699b7b4317a2f5c3557f85c240fe3c85d2d06618dd248434ef807d53779")
version("1.7.6", sha256="c88ccea2ad277ed38fc23187771b52b6fb212ed4429114717bfa8887ed21665c")
version("1.7.5", sha256="13e4084c9e7aaf55966ba5aa0423164b8fd21ee7526fc62017b3c9b3db99cb83")
Expand All @@ -22,146 +21,161 @@ def is_positive_int(val):
try:
return int(val) > 0
except ValueError:
return val == 'auto'

variant('fabric', default='ibv', values=('ofi', 'ibv', 'ucx'), multi=False,
description='Communication fabric')
variant('completion', default='sync,cq,am',
values=('sync', 'cq', 'am', 'glob'), multi=True,
description='Completion mechanism')

variant('shared', default=True, description='Build with shared libraries')
variant('examples', default=False, description='Build LCI examples')
variant('tests', default=False, description='Build LCI tests')
variant('benchmarks', default=False, description='Build LCI benchmarks')
variant('docs', default=False, description='Build LCI documentation')

variant('vector', default=True,
description='Use GCC vector extension for the immediate field')
variant('aligned', default=True, description='Enable memory alignment')
variant('cache-line', default='auto', values=is_positive_int,
description='Cache line size, in bytes')
variant('native', default=True, description='Build with -march=native')

variant('inline-cq', default=False,
description='Use the inline C completion queue implementation')
variant('ibv-td', default=True,
description='Enable IBV thread domain')

variant('default-pm', description='Default: Process management backend',
values=disjoint_sets(
('auto',), ('pmix', 'pmi2', 'pmi1', 'mpi', 'local'), ('cray',),
).prohibit_empty_set(
).with_default('auto').with_non_feature_values('auto'))
variant('multithread-progress', default=True,
description='Enable thread-safe LCI_progress function')
variant('default-dreg', default='auto',
description='Default: Whether to use registration cache')
variant('default-packet-size', default='auto', values=is_positive_int,
description='Default: Size of packet')
variant('default-packets', default='auto', values=is_positive_int,
description='Default: Number of packets')
variant('default-max-sends', default='auto', values=is_positive_int,
description='Default: Max posted sends')
variant('default-max-recvs', default='auto', values=is_positive_int,
description='Default: Max posted recvs')
variant('default-max-cqe', default='auto', values=is_positive_int,
description='Default: Max posted cqes')

variant('debug', default=False, description='Enable debug mode')
variant('pcounter', default=False,
description='Use performance counter')
variant('debug-slow', default=False, description='Enable manual slowdown')
variant('papi', default=False,
description='Use PAPI to collect hardware counters')
variant('gprof', default=False, description='Enable GPROF')
variant('enable-pm', description='Which process management backend to enable',
values=disjoint_sets(
('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')

depends_on('[email protected]:', type='build')
depends_on('libfabric', when='fabric=ofi')
depends_on('rdma-core', when='fabric=ibv')
depends_on('ucx', when='fabric=ucx')
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')
depends_on('cray-pmi', when='default-pm=cray')
return val == "auto"

variant(
"fabric",
default="ibv",
values=("ofi", "ibv", "ucx"),
multi=False,
description="Communication fabric",
)

variant("examples", default=False, description="Build LCI examples")
variant("tests", default=False, description="Build LCI tests")
variant("benchmarks", default=False, description="Build LCI benchmarks")
variant("docs", default=False, description="Build LCI documentation")

variant(
"cache-line",
default="auto",
values=is_positive_int,
description="Cache line size, in bytes",
)

variant(
"multithread-progress",
default=True,
description="Enable thread-safe LCI_progress function",
)
variant("dreg", default="auto", description="Whether to use registration cache by default")
variant(
"packet-size",
default="auto",
values=is_positive_int,
description="Size of packet by default",
)
variant(
"npackets",
default="auto",
values=is_positive_int,
description="Number of packets by default",
)
variant(
"fabric-nsends-max",
default="auto",
values=is_positive_int,
description="Max number of send descriptors that can be posted (send queue length) "
"at the fabric layer by default",
)
variant(
"fabric-nrecvs-max",
default="auto",
values=is_positive_int,
description="Max number of receive descriptors that can be posted (receive queue length) "
"at the fabric layer by default",
)
variant(
"fabric-ncqes-max",
default="auto",
values=is_positive_int,
description="Max number of completion queue entries that can be posted "
"(completion queue length) at the fabric layer by default",
)

variant("debug", default=False, description="Enable the debug mode")
variant("pcounter", default=False, description="Enable the performance counters")
variant(
"papi", default=False, description="Enable the PAPI plugin to collect hardware counters"
)

variant(
"enable-pm",
description="Process management backends to enable",
values=disjoint_sets(("auto",), ("pmix", "pmi2", "pmi1", "mpi", "local"))
.prohibit_empty_set()
.with_default("auto")
.with_non_feature_values("auto"),
)
variant(
"default-pm",
description="Order of process management backends to try by default",
values=disjoint_sets(("auto",), ("pmix", "pmi2", "pmi1", "mpi", "local"), ("cray",))
.prohibit_empty_set()
.with_default("auto")
.with_non_feature_values("auto"),
)

generator("ninja", "make", default="ninja")

depends_on("[email protected]:", type="build")
depends_on("libfabric", when="fabric=ofi")
depends_on("rdma-core", when="fabric=ibv")
depends_on("ucx", when="fabric=ucx")
depends_on("mpi", when="enable-pm=mpi")
depends_on("papi", when="+papi")
depends_on("doxygen", when="+docs")
depends_on("cray-pmi", when="default-pm=cray")

def cmake_args(self):
args = [
self.define_from_variant('LCI_SERVER', 'fabric'),
self.define('LCI_FORCE_SERVER', True),
self.define_from_variant('LCI_EP_CE', 'completion'),
self.define_from_variant('BUILD_SHARED_LIBS', 'shared'),
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'),
self.define_from_variant('LCI_OPTIMIZE_FOR_NATIVE', 'native'),
self.define_from_variant('LCI_USE_INLINE_CQ', 'inline-cq'),
self.define_from_variant('LCI_IBV_ENABLE_TD', 'ibv-td'),
self.define_from_variant('LCI_ENABLE_MULTITHREAD_PROGRESS', 'multithread-progress'),
self.define_from_variant('LCI_DEBUG', 'debug'),
self.define_from_variant('LCI_USE_PERFORMANCE_COUNTER', 'pcounter'),
self.define_from_variant('LCI_ENABLE_SLOWDOWN', 'debug-slow'),
self.define_from_variant('LCI_USE_PAPI', 'papi'),
self.define_from_variant('LCI_USE_GPROF', 'gprof'),
self.define_from_variant("LCI_SERVER", "fabric"),
self.define("LCI_FORCE_SERVER", True),
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_DOC", "docs"),
self.define_from_variant("LCI_ENABLE_MULTITHREAD_PROGRESS", "multithread-progress"),
self.define_from_variant("LCI_DEBUG", "debug"),
self.define_from_variant("LCI_USE_PERFORMANCE_COUNTER", "pcounter"),
self.define_from_variant("LCI_USE_PAPI", "papi"),
]

if not self.spec.satisfies('default-dreg=auto'):
arg = self.define_from_variant('LCI_USE_DREG_DEFAULT', 'default-dreg')
if not self.spec.satisfies("dreg=auto"):
arg = self.define_from_variant("LCI_USE_DREG_DEFAULT", "dreg")
args.append(arg)

if not self.spec.satisfies('enable-pm=auto'):
arg = self.define('LCT_PMI_BACKEND_ENABLE_PMI1', 'enable-pm=pmi1' in self.spec)
if not self.spec.satisfies("enable-pm=auto"):
arg = self.define("LCT_PMI_BACKEND_ENABLE_PMI1", "enable-pm=pmi1" in self.spec)
args.append(arg)
arg = self.define('LCT_PMI_BACKEND_ENABLE_PMI2', 'enable-pm=pmi2' in self.spec)
arg = self.define("LCT_PMI_BACKEND_ENABLE_PMI2", "enable-pm=pmi2" in self.spec)
args.append(arg)
arg = self.define('LCT_PMI_BACKEND_ENABLE_MPI', 'enable-pm=mpi' in self.spec)
arg = self.define("LCT_PMI_BACKEND_ENABLE_MPI", "enable-pm=mpi" in self.spec)
args.append(arg)
arg = self.define('LCT_PMI_BACKEND_ENABLE_PMIX', 'enable-pm=pmix' in self.spec)
arg = self.define("LCT_PMI_BACKEND_ENABLE_PMIX", "enable-pm=pmix" in self.spec)
args.append(arg)

if not self.spec.satisfies('cache-line=auto'):
arg = self.define_from_variant('LCI_CACHE_LINE', 'cache-line')
if self.spec.satisfies("default-pm=cray"):
arg = self.define("LCI_PMI_BACKEND_DEFAULT", "pmi1")
args.append(arg)

if self.spec.satisfies('platform=cray') or self.spec.satisfies('default-pm=cray'):
arg = self.define('LCI_PMI_BACKEND_DEFAULT', 'pmi1')
arg = self.define("LCT_PMI_BACKEND_ENABLE_PMI1", True)
args.append(arg)
elif not self.spec.satisfies('default-pm=auto'):
arg = self.define_from_variant('LCI_PMI_BACKEND_DEFAULT', 'default-pm')
elif not self.spec.satisfies("default-pm=auto"):
arg = self.define_from_variant("LCI_PMI_BACKEND_DEFAULT", "default-pm")
args.append(arg)

if not self.spec.satisfies("cache-line=auto"):
arg = self.define_from_variant("LCI_CACHE_LINE", "cache-line")
args.append(arg)

if not self.spec.satisfies('default-packet-size=auto'):
arg = self.define_from_variant('LCI_PACKET_SIZE_DEFAULT', 'default-packet-size')
if not self.spec.satisfies("packet-size=auto"):
arg = self.define_from_variant("LCI_PACKET_SIZE_DEFAULT", "packet-size")
args.append(arg)

if not self.spec.satisfies('default-packets=auto'):
arg = self.define_from_variant('LCI_SERVER_NUM_PKTS_DEFAULT', 'default-packets')
if not self.spec.satisfies("npackets=auto"):
arg = self.define_from_variant("LCI_SERVER_NUM_PKTS_DEFAULT", "npackets")
args.append(arg)

if not self.spec.satisfies('default-max-sends=auto'):
arg = self.define_from_variant('LCI_SERVER_MAX_SENDS_DEFAULT', 'default-max-sends')
if not self.spec.satisfies("fabric-nsends-max=auto"):
arg = self.define_from_variant("LCI_SERVER_MAX_SENDS_DEFAULT", "fabric-nsends-max")
args.append(arg)

if not self.spec.satisfies('default-max-recvs=auto'):
arg = self.define_from_variant('LCI_SERVER_MAX_RECVS_DEFAULT', 'default-max-recvs')
if not self.spec.satisfies("fabric-nrecvs-max=auto"):
arg = self.define_from_variant("LCI_SERVER_MAX_RECVS_DEFAULT", "fabric-nrecvs-max")
args.append(arg)

if not self.spec.satisfies('default-max-cqe=auto'):
arg = self.define_from_variant('LCI_SERVER_MAX_CQES_DEFAULT', 'default-max-cqe')
if not self.spec.satisfies("fabric-ncqes-max=auto"):
arg = self.define_from_variant("LCI_SERVER_MAX_CQES_DEFAULT", "fabric-ncqes-max")
args.append(arg)

return args
27 changes: 0 additions & 27 deletions examples/MPI_LCI/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit d9b81a0

Please sign in to comment.