diff --git a/src/allocators/all.py b/src/allocators/all.py index bf2babdfb2f282b82514a076682be47b9633e7a2..f68863dc128cc49e7b0771da31e789213ff51eef 100644 --- a/src/allocators/all.py +++ b/src/allocators/all.py @@ -6,6 +6,7 @@ from src.allocators.tcmalloc import tcmalloc, tcmalloc_nofs from src.allocators.jemalloc import jemalloc from src.allocators.hoard import hoard from src.allocators.supermalloc import supermalloc +from src.allocators.llalloc import llalloc mesh = Alloc("Mesh", sources=Alloc_Src("Mesh", @@ -18,4 +19,4 @@ mesh = Alloc("Mesh", sources=Alloc_Src("Mesh", "mkdir {dir}"]) allocators = [*src.allocators.glibcs.allocators, tcmalloc, tcmalloc_nofs, - jemalloc, hoard, mesh, supermalloc] + jemalloc, hoard, mesh, supermalloc, llalloc] diff --git a/src/allocators/llalloc.py b/src/allocators/llalloc.py new file mode 100644 index 0000000000000000000000000000000000000000..073899c6c1603cc2ae3652ea5969aadcf434b1d5 --- /dev/null +++ b/src/allocators/llalloc.py @@ -0,0 +1,25 @@ +from src.allocator import Allocator, Allocator_Sources, library_path + + +source = Allocator_Sources("lockless_allocator", + retrieve_cmds=["wget https://locklessinc.com/downloads/lockless_allocator_src.tgz", + "tar xf lockless_allocator_src.tgz"], + prepare_cmds=[], + reset_cmds=[]) + + +class Lockless_Allocator (Allocator): + """Lockless allocator definition for allocbench""" + def __init__(self, name, **kwargs): + + kwargs["sources"] = source + + kwargs["build_cmds"] = ["cd {srcdir}; make", "mkdir -p {dir}"] + + kwargs["LD_PRELOAD"] = "{srcdir}/libllalloc.so.1.3" + + super().__init__(name, **kwargs) + + +llalloc = Lockless_Allocator("llalloc") + diff --git a/src/allocators/mesh.py b/src/allocators/mesh.py new file mode 100644 index 0000000000000000000000000000000000000000..843685bed57bbe32ee4b00ebbb0b9437d0006b34 --- /dev/null +++ b/src/allocators/mesh.py @@ -0,0 +1,22 @@ +import src.allocator + +sources = src.allocator.Allocator_Sources("Mesh", + retrieve_cmds=["git clone https://github.com/plasma-umass/Mesh"], + reset_cmds=["git stash"]) + + +class Mesh (src.allocator.Allocator): + """Mesh definition for allocbench""" + 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}"] + + super().__init__(name, **kwargs) + + +mesh = Mesh("Mesh") diff --git a/src/allocators/supermalloc.py b/src/allocators/supermalloc.py index 24fbb155bff9e860cf5de6a7a82bfeaa573d4811..a8b5789d62b935db7748127bb36d77e2badbd90a 100644 --- a/src/allocators/supermalloc.py +++ b/src/allocators/supermalloc.py @@ -19,4 +19,4 @@ class SuperMalloc (src.allocator.Allocator): super().__init__(name, **kwargs) -supermalloc = SuperMalloc("SuperMalloc", color="C1") +supermalloc = SuperMalloc("SuperMalloc")