aboutsummaryrefslogtreecommitdiff
path: root/src/allocators
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-09-29 15:35:02 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-09-29 15:35:02 +0200
commit059d263a6b944c4cfc5a5a0f2716e6a85116cfc1 (patch)
tree8169cefa09e08dab87f2f94967dc5a80ee2b425a /src/allocators
parente9f41e9e3ef8f6d35dda10c6c58d77b52d577e8a (diff)
parent3f43d0f464b8da5829ff652a3208720c74d1882b (diff)
downloadallocbench-059d263a6b944c4cfc5a5a0f2716e6a85116cfc1.tar.gz
allocbench-059d263a6b944c4cfc5a5a0f2716e6a85116cfc1.zip
Merge branch 'artifact'
Diffstat (limited to 'src/allocators')
-rw-r--r--src/allocators/all.py2
-rw-r--r--src/allocators/glibc.py34
-rw-r--r--src/allocators/hoard.py25
-rw-r--r--src/allocators/installed_allocators.py10
-rw-r--r--src/allocators/jemalloc.py26
-rw-r--r--src/allocators/llalloc.py21
-rw-r--r--src/allocators/malt.py4
-rw-r--r--src/allocators/mesh.py28
-rw-r--r--src/allocators/mimalloc.py27
-rw-r--r--src/allocators/scalloc.py31
-rw-r--r--src/allocators/snmalloc.py27
-rw-r--r--src/allocators/speedymalloc.py2
-rw-r--r--src/allocators/streamflow.py23
-rw-r--r--src/allocators/supermalloc.py30
-rw-r--r--src/allocators/supermalloc/remove_faulty_aligned_alloc_test.patch (renamed from src/allocators/SuperMalloc/remove_faulty_aligned_alloc_test.patch)0
-rw-r--r--src/allocators/tbbmalloc.py25
-rw-r--r--src/allocators/tcmalloc.py24
17 files changed, 145 insertions, 194 deletions
diff --git a/src/allocators/all.py b/src/allocators/all.py
index 6b3b46a..0593c81 100644
--- a/src/allocators/all.py
+++ b/src/allocators/all.py
@@ -31,5 +31,5 @@ from src.allocators.snmalloc import snmalloc
allocators = [*src.allocators.glibcs.allocators, tcmalloc, tcmalloc_nofs,
- jemalloc, hoard, mesh, supermalloc, scalloc, llalloc, tbbmalloc,
+ jemalloc, hoard, mesh, supermalloc, scalloc, tbbmalloc, llalloc, # streamflow,
mimalloc, snmalloc]
diff --git a/src/allocators/glibc.py b/src/allocators/glibc.py
index c322427..3c739fe 100644
--- a/src/allocators/glibc.py
+++ b/src/allocators/glibc.py
@@ -17,52 +17,48 @@
"""Glibc definitions"""
-from src.allocator import Allocator, AllocatorSources, LIBRARY_PATH
-
-VERSION = 2.29
-
-GLIBC_SRC = AllocatorSources("glibc",
- retrieve_cmds=["git clone git://sourceware.org/git/glibc.git"],
- prepare_cmds=[f"git checkout glibc-{VERSION}"],
- reset_cmds=["git reset --hard"])
+from src.allocator import Allocator, LIBRARY_PATH
+from src.artifact import GitArtifact
class Glibc(Allocator):
"""Glibc definition for allocbench
Glibcs are loaded using their own supplied loader"""
+
+ sources = GitArtifact("glibc", "git://sourceware.org/git/glibc.git")
+
def __init__(self, name, **kwargs):
- kwargs["sources"] = GLIBC_SRC
configure_args = ""
if "configure_args" in kwargs:
configure_args = kwargs["configure_args"]
- del(kwargs["configure_args"])
-
- kwargs["build_cmds"] = ["mkdir -p glibc-build",
- "cd glibc-build; {srcdir}/configure --prefix={dir} " + configure_args,
- "cd glibc-build; make",
- "cd glibc-build; make install"]
+ del kwargs["configure_args"]
- kwargs["cmd_prefix"] = ("{dir}/lib/ld-linux-x86-64.so.2 --library-path {dir}/lib:"
- + LIBRARY_PATH)
+ self.build_cmds = ["mkdir -p glibc-build",
+ "cd glibc-build; {srcdir}/configure --prefix={dir} " + configure_args,
+ "cd glibc-build; make",
+ "cd glibc-build; make install"]
- # kwargs["LD_LIBRARY_PATH"] = "{dir}/lib:" + library_path
+ self.cmd_prefix = "{dir}/lib/ld-linux-x86-64.so.2 --library-path {dir}/lib:" + LIBRARY_PATH
super().__init__(name, **kwargs)
-glibc = Glibc("glibc", color="xkcd:red")
+glibc = Glibc("glibc", version="glibc-2.29", color="xkcd:red")
glibc_notc = Glibc("glibc-noThreadCache",
configure_args="--disable-experimental-malloc",
+ version="glibc-2.29",
color="xkcd:maroon")
glibc_nofs = Glibc("glibc-noFalsesharing",
patches=["{patchdir}/glibc_2.29_no_passive_falsesharing.patch"],
+ version="glibc-2.29",
color="xkcd:pink")
glibc_nofs_fancy = Glibc("glibc-noFalsesharingClever",
patches=["{patchdir}/glibc_2.29_no_passive_falsesharing_fancy.patch"],
+ version="glibc-2.29",
color="xkcd:orange")
diff --git a/src/allocators/hoard.py b/src/allocators/hoard.py
index cc2061a..7e94d79 100644
--- a/src/allocators/hoard.py
+++ b/src/allocators/hoard.py
@@ -17,26 +17,23 @@
"""Hoard allocator definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-
-
-sources = AllocatorSources("Hoard",
- retrieve_cmds=["git clone https://github.com/emeryberger/Hoard.git"],
- reset_cmds=["git reset --hard"])
+from src.allocator import Allocator
+from src.artifact import GitArtifact
class Hoard(Allocator):
"""Hoard allocator"""
- def __init__(self, name, **kwargs):
- kwargs["sources"] = sources
- kwargs["LD_PRELOAD"] = "{dir}/libhoard.so"
- kwargs["build_cmds"] = ["cd {srcdir}/src; make",
- "mkdir -p {dir}",
- "ln -f -s {srcdir}/src/libhoard.so {dir}/libhoard.so"]
- kwargs["requirements"] = ["clang"]
+ sources = GitArtifact("Hoard", "https://github.com/emeryberger/Hoard.git")
+
+ def __init__(self, name, **kwargs):
+ self.LD_PRELOAD = "{dir}/libhoard.so"
+ self.build_cmds = ["cd {srcdir}/src; make",
+ "mkdir -p {dir}",
+ "ln -f -s {srcdir}/src/libhoard.so {dir}/libhoard.so"]
+ self.requirements = ["clang"]
super().__init__(name, **kwargs)
-hoard = Hoard("Hoard", color="xkcd:brown")
+hoard = Hoard("Hoard", version="aa6d31700d5368a9f5ede3d62731247c8d9f0ebb", color="xkcd:brown")
diff --git a/src/allocators/installed_allocators.py b/src/allocators/installed_allocators.py
index 9a11d04..d45755a 100644
--- a/src/allocators/installed_allocators.py
+++ b/src/allocators/installed_allocators.py
@@ -22,11 +22,11 @@ import subprocess
# TODO: add more allocators
MAYBE_ALLOCATORS = ["tcmalloc", "jemalloc", "hoard"]
-allocators = {"libc": {"cmd_prefix": "",
- "binary_suffix": "",
- "LD_PRELOAD": "",
- "LD_LIBRARY_PATH": "",
- "color": "C1"}}
+allocators = {"libc": {"cmd_prefix": "",
+ "binary_suffix": "",
+ "LD_PRELOAD": "",
+ "LD_LIBRARY_PATH": "",
+ "color": "C1"}}
for i, t in enumerate(MAYBE_ALLOCATORS):
try:
diff --git a/src/allocators/jemalloc.py b/src/allocators/jemalloc.py
index 4484362..18e3055 100644
--- a/src/allocators/jemalloc.py
+++ b/src/allocators/jemalloc.py
@@ -17,26 +17,24 @@
"""jemalloc definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-
-VERSION = "5.1.0"
-
-sources = AllocatorSources("jemalloc",
- retrieve_cmds=["git clone https://github.com/jemalloc/jemalloc.git"],
- prepare_cmds=[f"git checkout {VERSION}", "./autogen.sh"])
+from src.allocator import Allocator
+from src.artifact import GitArtifact
class Jemalloc(Allocator):
"""jemalloc allocator"""
- def __init__(self, name, **kwargs):
- kwargs["sources"] = sources
- kwargs["LD_PRELOAD"] = "{srcdir}/lib/libjemalloc.so"
- kwargs["build_cmds"] = ["cd {srcdir}; ./configure --prefix={dir}",
- "cd {srcdir}; make -j4",
- "mkdir -p {dir}"]
+ sources = GitArtifact("jemalloc", "https://github.com/jemalloc/jemalloc.git")
+
+ def __init__(self, name, **kwargs):
+ self.LD_PRELOAD = "{dir}/libjemalloc.so"
+ self.prepare_cmds = ["./autogen.sh"]
+ self.build_cmds = ["cd {srcdir}; ./configure --prefix={dir}",
+ "cd {srcdir}; make -j4",
+ "mkdir -p {dir}",
+ "ln -f -s {srcdir}/lib/libjemalloc.so {dir}/libjemalloc.so"]
super().__init__(name, **kwargs)
-jemalloc = Jemalloc("jemalloc", color="xkcd:yellow")
+jemalloc = Jemalloc("jemalloc", version="5.1.0", color="xkcd:yellow")
diff --git a/src/allocators/llalloc.py b/src/allocators/llalloc.py
index b0da505..8f43f59 100644
--- a/src/allocators/llalloc.py
+++ b/src/allocators/llalloc.py
@@ -17,25 +17,24 @@
"""Lockless allocator definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-
-
-LLALLOC_SOURCE = AllocatorSources("lockless_allocator",
- retrieve_cmds=["wget https://locklessinc.com/downloads/lockless_allocator_src.tgz",
- "tar xf lockless_allocator_src.tgz"],
- prepare_cmds=[],
- reset_cmds=[])
+from src.allocator import Allocator
+from src.artifact import ArchiveArtifact
class LocklessAllocator(Allocator):
"""Lockless allocator"""
def __init__(self, name, **kwargs):
- kwargs["sources"] = LLALLOC_SOURCE
+ self.sources = ArchiveArtifact("llalloc",
+ "https://locklessinc.com/downloads/lockless_allocator_src.tgz",
+ "tar",
+ "c6cb5a57882fa4775b5227a322333a6126b61f7c")
- kwargs["build_cmds"] = ["cd {srcdir}; make", "mkdir -p {dir}"]
+ self.build_cmds = ["cd {srcdir}/lockless_allocator; make",
+ "mkdir -p {dir}",
+ "ln -f -s {srcdir}/lockless_allocator/libllalloc.so.1.3 {dir}/libllalloc.so"]
- kwargs["LD_PRELOAD"] = "{srcdir}/libllalloc.so.1.3"
+ self.LD_PRELOAD = "{dir}/libllalloc.so"
super().__init__(name, **kwargs)
diff --git a/src/allocators/malt.py b/src/allocators/malt.py
index 599e8ff..34fd9cc 100644
--- a/src/allocators/malt.py
+++ b/src/allocators/malt.py
@@ -24,6 +24,4 @@ of a program. See https://github.com/memtt/malt for more details
from src.allocator import Allocator
# result_dir and perm are substituted during Benchmark.run
-cmd = "malt -q -o output:name={{result_dir}}/malt.{{perm}}.%3"
-
-malt = Allocator("malt", cmd_prefix=cmd)
+malt = Allocator("malt", cmd_prefix="malt -q -o output:name={{result_dir}}/malt.{{perm}}.%3")
diff --git a/src/allocators/mesh.py b/src/allocators/mesh.py
index f8b7c16..2391e23 100644
--- a/src/allocators/mesh.py
+++ b/src/allocators/mesh.py
@@ -17,29 +17,23 @@
"""Mesh definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-
-sources = AllocatorSources("Mesh",
- retrieve_cmds=["git clone https://github.com/plasma-umass/Mesh"],
- reset_cmds=["git reset --hard"])
-
-# sources = src.allocator.GitAllocatorSources("Mesh",
-# "https://github.com/plasma-umass/Mesh",
-# "adsf0982345")
+from src.allocator import Allocator
+from src.artifact import GitArtifact
class Mesh(Allocator):
"""Mesh allocator"""
- def __init__(self, name, **kwargs):
- kwargs["sources"] = sources
- kwargs["LD_PRELOAD"] = "{srcdir}/libmesh.so"
- kwargs["build_cmds"] = ["cd {srcdir}; git submodule update --init",
- "cd {srcdir}; ./configure",
- "cd {srcdir}; make -j 4",
- "mkdir -p {dir}"]
+ sources = GitArtifact("Mesh", "https://github.com/plasma-umass/Mesh")
+
+ def __init__(self, name, **kwargs):
+ self.LD_PRELOAD = "{dir}/libmesh.so"
+ self.build_cmds = ["cd {srcdir}; ./configure",
+ "cd {srcdir}; make -j 4",
+ "mkdir -p {dir}",
+ "ln -f -s {srcdir}/libmesh.so {dir}/libmesh.so"]
super().__init__(name, **kwargs)
-mesh = Mesh("Mesh", color="xkcd:mint")
+mesh = Mesh("Mesh", version="4a1012cee990cb98cc1ea0294a836f467b29be02", color="xkcd:mint")
diff --git a/src/allocators/mimalloc.py b/src/allocators/mimalloc.py
index 2f84fe1..6931217 100644
--- a/src/allocators/mimalloc.py
+++ b/src/allocators/mimalloc.py
@@ -17,28 +17,23 @@
"""mimalloc definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-
-VERSION = "master"
-
-MIMALLOC_SRC = AllocatorSources("mimalloc",
- ["git clone https://github.com/microsoft/mimalloc"],
- [f"git checkout {VERSION}"],
- ["git reset --hard"])
+from src.allocator import Allocator
+from src.artifact import GitArtifact
class Mimalloc(Allocator):
"""mimalloc allocator"""
- def __init__(self, name, **kwargs):
- kwargs["sources"] = MIMALLOC_SRC
- kwargs["LD_PRELOAD"] = "{dir}/libmimalloc.so"
- kwargs["build_cmds"] = ["mkdir -p {dir}",
- "cd {dir}; cmake {srcdir}",
- "cd {dir}; make"]
- kwargs["requirements"] = ["cmake"]
+ sources = GitArtifact("mimalloc", "https://github.com/microsoft/mimalloc")
+
+ def __init__(self, name, **kwargs):
+ self.LD_PRELOAD = "{dir}/libmimalloc.so"
+ self.build_cmds = ["mkdir -p {dir}",
+ "cd {dir}; cmake {srcdir}",
+ "cd {dir}; make"]
+ self.requirements = ["cmake"]
super().__init__(name, **kwargs)
-mimalloc = Mimalloc("mimalloc")
+mimalloc = Mimalloc("mimalloc", version="v1.0.8")
diff --git a/src/allocators/scalloc.py b/src/allocators/scalloc.py
index 0b3d3cf..82ef8d1 100644
--- a/src/allocators/scalloc.py
+++ b/src/allocators/scalloc.py
@@ -17,32 +17,25 @@
"""Scalloc definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-from src.util import print_error
-
-
-VERSION = "v1.0.0"
-
-SCALLOC_SRC = AllocatorSources("scalloc",
- retrieve_cmds=["git clone https://github.com/cksystemsgroup/scalloc"],
- prepare_cmds=[f"git checkout {VERSION}",
- "cd {srcdir}; tools/make_deps.sh",
- "cd {srcdir}; build/gyp/gyp --depth=. scalloc.gyp"],
- reset_cmds=["git reset --hard"])
+from src.allocator import Allocator
+from src.artifact import GitArtifact
class Scalloc(Allocator):
"""Scalloc allocator"""
- def __init__(self, name, **kwargs):
- kwargs["sources"] = SCALLOC_SRC
+ sources = GitArtifact("scalloc", "https://github.com/cksystemsgroup/scalloc")
+
+ def __init__(self, name, **kwargs):
+ self.prepare_cmds = ["tools/make_deps.sh",
+ "build/gyp/gyp --depth=. scalloc.gyp"]
- kwargs["build_cmds"] = ["cd {srcdir}; BUILDTYPE=Release make",
- "mkdir -p {dir}"]
+ self.build_cmds = ["cd {srcdir}; BUILDTYPE=Release make",
+ "mkdir -p {dir}"]
- kwargs["LD_PRELOAD"] = "{srcdir}/out/Release/lib.target/libscalloc.so"
+ self.LD_PRELOAD = "{srcdir}/out/Release/lib.target/libscalloc.so"
- kwargs["patches"] = ["{patchdir}/scalloc_fix_log.patch"]
+ self.patches = ["{patchdir}/scalloc_fix_log.patch"]
super().__init__(name, **kwargs)
@@ -57,4 +50,4 @@ sysctl vm.overcommit_memory=1
return super().build()
-scalloc = Scalloc("scalloc", color="xkcd:magenta")
+scalloc = Scalloc("scalloc", color="xkcd:magenta", version="v1.0.0")
diff --git a/src/allocators/snmalloc.py b/src/allocators/snmalloc.py
index 0496196..7f27e4b 100644
--- a/src/allocators/snmalloc.py
+++ b/src/allocators/snmalloc.py
@@ -17,28 +17,23 @@
"""Snmalloc definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-
-VERSION = "master"
-
-SNMALLOC_SRC = AllocatorSources("snmalloc",
- ["git clone https://github.com/microsoft/snmalloc"],
- [f"git checkout {VERSION}"],
- ["git reset --hard"])
+from src.allocator import Allocator
+from src.artifact import GitArtifact
class Snmalloc(Allocator):
"""snmalloc allocator"""
- def __init__(self, name, **kwargs):
- kwargs["sources"] = SNMALLOC_SRC
- kwargs["LD_PRELOAD"] = "{dir}/libsnmallocshim.so"
- kwargs["build_cmds"] = ["mkdir -p {dir}",
- "cd {dir}; cmake -G Ninja {srcdir} -DCMAKE_BUILD_TYPE=Release",
- "cd {dir}; ninja"]
- kwargs["requirements"] = ["cmake", "ninja", "clang"]
+ sources = GitArtifact("snmalloc", "https://github.com/microsoft/snmalloc")
+
+ def __init__(self, name, **kwargs):
+ self.LD_PRELOAD = "{dir}/libsnmallocshim.so"
+ self.build_cmds = ["mkdir -p {dir}",
+ "cd {dir}; cmake -G Ninja {srcdir} -DCMAKE_BUILD_TYPE=Release",
+ "cd {dir}; ninja"]
+ self.requirements = ["cmake", "ninja", "clang"]
super().__init__(name, **kwargs)
-snmalloc = Snmalloc("snmalloc")
+snmalloc = Snmalloc("snmalloc", version="0.2")
diff --git a/src/allocators/speedymalloc.py b/src/allocators/speedymalloc.py
index 9df3d7d..0cf6836 100644
--- a/src/allocators/speedymalloc.py
+++ b/src/allocators/speedymalloc.py
@@ -26,4 +26,4 @@ import os
from src.allocator import Allocator, BUILDDIR
speedymalloc = Allocator("speedymalloc", LD_PRELOAD=os.path.join(BUILDDIR, "speedymalloc.so"),
- color="xkcd:dark")
+ color="xkcd:dark")
diff --git a/src/allocators/streamflow.py b/src/allocators/streamflow.py
index 73aede9..005b9cb 100644
--- a/src/allocators/streamflow.py
+++ b/src/allocators/streamflow.py
@@ -17,25 +17,24 @@
"""Streamflow allocator definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-
-
-sources = AllocatorSources("streamflow",
- retrieve_cmds=["git clone https://github.com/scotts/streamflow"],
- reset_cmds=["git reset --hard"])
+from src.allocator import Allocator
+from src.artifact import GitArtifact
class Streamflow(Allocator):
"""Streamflow allocator"""
+
+ sources = GitArtifact("streamflow", "https://github.com/scotts/streamflow")
+
def __init__(self, name, **kwargs):
- kwargs["sources"] = sources
- kwargs["LD_PRELOAD"] = "{dir}/libstreamflow.so"
- kwargs["build_cmds"] = ["cd {srcdir}; make",
- "mkdir -p {dir}",
- "ln -f -s {srcdir}/libstreamflow.so {dir}/libstreamflow.so"]
+ self.LD_PRELOAD = "{dir}/libstreamflow.so"
+ self.build_cmds = ["cd {srcdir}; make",
+ "mkdir -p {dir}",
+ "ln -f -s {srcdir}/libstreamflow.so {dir}/libstreamflow.so"]
super().__init__(name, **kwargs)
-streamflow = Streamflow("Streamflow", color="xkcd:light brown")
+streamflow = Streamflow("Streamflow", version="8ac345c0f69ec9e7af02f3555c2c97eaa07a442e",
+ color="xkcd:light brown")
diff --git a/src/allocators/supermalloc.py b/src/allocators/supermalloc.py
index 130dd47..f0a192a 100644
--- a/src/allocators/supermalloc.py
+++ b/src/allocators/supermalloc.py
@@ -17,29 +17,23 @@
"""SuperMalloc definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-
-import src.allocator
-
-VERSION = "709663fb81ba091b0a78058869a644a272f4163d"
-
-sources = AllocatorSources("SuperMalloc",
- retrieve_cmds=["git clone https://github.com/kuszmaul/SuperMalloc"],
- prepare_cmds=[f"git checkout {VERSION}"],
- reset_cmds=["git reset --hard"])
-
+from src.allocator import Allocator
+from src.artifact import GitArtifact
class SuperMalloc(Allocator):
"""SuperMalloc allocator"""
- def __init__(self, name, **kwargs):
- kwargs["sources"] = sources
- kwargs["LD_PRELOAD"] = "{srcdir}/release/lib/libsupermalloc.so"
- kwargs["build_cmds"] = ["cd {srcdir}/release; make",
- "mkdir -p {dir}"]
- kwargs["patches"] = ["{patchdir}/remove_faulty_aligned_alloc_test.patch"]
+ sources = GitArtifact("SuperMalloc", "https://github.com/kuszmaul/SuperMalloc")
+
+ def __init__(self, name, **kwargs):
+ self.LD_PRELOAD = "{dir}/libsupermalloc.so"
+ self.build_cmds = ["cd {srcdir}/release; make",
+ "mkdir -p {dir}",
+ "ln -f -s {srcdir}/release/lib/libsupermalloc.so {dir}/libsupermalloc.so"]
+ self.patches = ["{patchdir}/remove_faulty_aligned_alloc_test.patch"]
super().__init__(name, **kwargs)
-supermalloc = SuperMalloc("SuperMalloc", color="xkcd:lime")
+supermalloc = SuperMalloc("SuperMalloc", color="xkcd:lime",
+ version="709663fb81ba091b0a78058869a644a272f4163d")
diff --git a/src/allocators/SuperMalloc/remove_faulty_aligned_alloc_test.patch b/src/allocators/supermalloc/remove_faulty_aligned_alloc_test.patch
index dc7f7c4..dc7f7c4 100644
--- a/src/allocators/SuperMalloc/remove_faulty_aligned_alloc_test.patch
+++ b/src/allocators/supermalloc/remove_faulty_aligned_alloc_test.patch
diff --git a/src/allocators/tbbmalloc.py b/src/allocators/tbbmalloc.py
index aa50253..a7af5a5 100644
--- a/src/allocators/tbbmalloc.py
+++ b/src/allocators/tbbmalloc.py
@@ -17,27 +17,22 @@
"""tbbmalloc definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-
-VERSION = "2019_U8"
-
-source = AllocatorSources("tbb",
- ["git clone https://github.com/intel/tbb.git"],
- [f"git checkout {VERSION}"],
- ["git reset --hard"])
+from src.allocator import Allocator
+from src.artifact import GitArtifact
class TBBMalloc(Allocator):
"""tbbmalloc allocator"""
- def __init__(self, name, **kwargs):
- kwargs["sources"] = source
- kwargs["LD_PRELOAD"] = "{dir}/libtbbmalloc.so"
- kwargs["build_cmds"] = ["cd {srcdir}; make tbbmalloc -j4",
- "mkdir -p {dir}",
- 'ln -f -s $(find {srcdir} -executable -name "*libtbbmalloc_proxy.so*" | head -1) {dir}/libtbbmalloc.so']
+ sources = GitArtifact("tbb", "https://github.com/intel/tbb.git")
+
+ def __init__(self, name, **kwargs):
+ self.LD_PRELOAD = "{dir}/libtbbmalloc.so"
+ self.build_cmds = ["cd {srcdir}; make tbbmalloc -j4",
+ "mkdir -p {dir}",
+ 'ln -f -s $(find {srcdir} -executable -name "*libtbbmalloc_proxy.so*" | head -1) {dir}/libtbbmalloc.so']
super().__init__(name, **kwargs)
-tbbmalloc = TBBMalloc("tbbmalloc", color="xkcd:green")
+tbbmalloc = TBBMalloc("tbbmalloc", color="xkcd:green", version="2019_U8")
diff --git a/src/allocators/tcmalloc.py b/src/allocators/tcmalloc.py
index 916da88..f81f88b 100644
--- a/src/allocators/tcmalloc.py
+++ b/src/allocators/tcmalloc.py
@@ -17,30 +17,28 @@
"""TCMalloc definition for allocbench"""
-from src.allocator import Allocator, AllocatorSources
-
-VERSION = 2.7
-
-TCMALLOC_SRC = AllocatorSources("tcmalloc",
- ["git clone https://github.com/gperftools/gperftools.git tcmalloc"],
- [f"git checkout gperftools-{VERSION}", "./autogen.sh"],
- ["git reset --hard"])
+from src.allocator import Allocator
+from src.artifact import GitArtifact
class TCMalloc(Allocator):
"""TCMalloc allocator"""
+
+ sources = GitArtifact("tcmalloc", "https://github.com/gperftools/gperftools.git")
+
def __init__(self, name, **kwargs):
- kwargs["sources"] = TCMALLOC_SRC
- kwargs["LD_PRELOAD"] = "{dir}/lib/libtcmalloc.so"
- kwargs["build_cmds"] = ["cd {srcdir}; ./configure --prefix={dir}",
- "cd {srcdir}; make install -j4"]
+ self.LD_PRELOAD = "{dir}/lib/libtcmalloc.so"
+ self.prepare_cmds = ["./autogen.sh"]
+ self.build_cmds = ["cd {srcdir}; ./configure --prefix={dir}",
+ "cd {srcdir}; make install -j4"]
super().__init__(name, **kwargs)
-tcmalloc = TCMalloc("TCMalloc", color="xkcd:blue")
+tcmalloc = TCMalloc("TCMalloc", color="xkcd:blue", version="gperftools-2.7")
tcmalloc_nofs = TCMalloc("TCMalloc-NoFalsesharing",
patches=["{patchdir}/tcmalloc_2.7_no_active_falsesharing.patch"],
+ version="gperftools-2.7",
color="xkcd:navy")