Add mimalloc package with use in HPX and pika (#30457)

* Add mimalloc package

* Add mimalloc as allocator option to pika

* Add mimalloc as allocator option to hpx

* Set git property globally instead of per-version in pika, hpx, and mimalloc packages

Co-authored-by: Mikael Simberg <mikael.simberg@iki.if>
This commit is contained in:
Mikael Simberg 2022-05-04 18:19:15 +02:00 committed by GitHub
parent 4d03a2768e
commit 5b68fa1ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 5 deletions

View File

@ -15,12 +15,13 @@ class Hpx(CMakePackage, CudaPackage, ROCmPackage):
homepage = "https://hpx.stellar-group.org/"
url = "https://github.com/STEllAR-GROUP/hpx/archive/1.2.1.tar.gz"
git = "https://github.com/STEllAR-GROUP/hpx.git"
maintainers = ['msimberg', 'albestro', 'teonnik']
tags = ['e4s']
version('master', git='https://github.com/STEllAR-GROUP/hpx.git', branch='master')
version('stable', git='https://github.com/STEllAR-GROUP/hpx.git', tag='stable')
version('master', branch='master')
version('stable', tag='stable')
version('1.7.1', sha256='008a0335def3c551cba31452eda035d7e914e3e4f77eec679eea070ac71bd83b')
version('1.7.0', sha256='05099b860410aa5d8a10d6915b1a8818733aa1aa2d5f2b9774730ca7e6de5fac')
version('1.6.0', sha256='4ab715613c1e1808edc93451781cc9bc98feec4e422ccd4322858a680f6d9017')
@ -45,7 +46,7 @@ class Hpx(CMakePackage, CudaPackage, ROCmPackage):
variant(
'malloc', default='tcmalloc',
description='Define which allocator will be linked in',
values=('system', 'tcmalloc', 'jemalloc', 'tbbmalloc')
values=('system', 'jemalloc', 'mimalloc', 'tbbmalloc', 'tcmalloc')
)
variant('max_cpu_count', default='64',
@ -100,6 +101,7 @@ class Hpx(CMakePackage, CudaPackage, ROCmPackage):
depends_on('gperftools', when='malloc=tcmalloc')
depends_on('jemalloc', when='malloc=jemalloc')
depends_on('mimalloc@1', when='malloc=mimalloc')
depends_on('tbb', when='malloc=tbbmalloc')
depends_on('mpi', when='networking=mpi')

View File

@ -0,0 +1,23 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Mimalloc(CMakePackage):
"""mimalloc is a compact general purpose allocator with excellent performance."""
homepage = "https://microsoft.github.io/mimalloc"
url = "https://github.com/microsoft/mimalloc/archive/v0.0.0.tar.gz"
git = "https://github.com/microsoft/mimalloc.git"
maintainers = ['msimberg']
version('dev-slice', branch='dev-slice')
version('dev', branch='dev')
version('master', branch='master')
version('2.0.6', sha256='9f05c94cc2b017ed13698834ac2a3567b6339a8bde27640df5a1581d49d05ce5')
version('1.7.6', sha256='d74f86ada2329016068bc5a243268f1f555edd620b6a7d6ce89295e7d6cf18da')
depends_on('cmake@3.0:', type='build')

View File

@ -14,13 +14,14 @@ class Pika(CMakePackage, CudaPackage, ROCmPackage):
homepage = "https://github.com/pika-org/pika/"
url = "https://github.com/pika-org/pika/archive/0.0.0.tar.gz"
git = "https://github.com/pika-org/pika.git"
maintainers = ['msimberg', 'albestro', 'teonnik', 'aurianer']
version('0.4.0', sha256='31084a0a61103ee9574aaa427f879682e3e37cb11e8d147f2649949bee324591')
version('0.3.0', sha256='bbb89f9824c58154ed59e2e14276c0ad132fd7b90b2be64ddd0e284f3b57cc0f')
version('0.2.0', sha256='712bb519f22bdc9d5ee4ac374d251a54a0af4c9e4e7f62760b8ab9a177613d12')
version('0.1.0', sha256='aa0ae2396cd264d821a73c4c7ecb118729bb3de042920c9248909d33755e7327')
version('main', git='https://github.com/pika-org/pika.git', branch='main')
version('main', branch='main')
generator = 'Ninja'
@ -34,7 +35,7 @@ class Pika(CMakePackage, CudaPackage, ROCmPackage):
variant(
'malloc', default='tcmalloc',
description='Define which allocator will be linked in',
values=('system', 'tcmalloc', 'jemalloc', 'tbbmalloc')
values=('system', 'jemalloc', 'mimalloc', 'tbbmalloc', 'tcmalloc')
)
default_generic_coroutines = True
@ -66,6 +67,7 @@ class Pika(CMakePackage, CudaPackage, ROCmPackage):
depends_on('gperftools', when='malloc=tcmalloc')
depends_on('jemalloc', when='malloc=jemalloc')
depends_on('mimalloc@1', when='malloc=mimalloc')
depends_on('tbb', when='malloc=tbbmalloc')
depends_on('mpi', when='+mpi')