aboutsummaryrefslogtreecommitdiff
path: root/src/allocators/llalloc.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-09-22 18:35:47 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-09-22 18:35:47 +0200
commitcac85412d757b6054436dc9c63d30db645bc93ea (patch)
tree1858c4eefee907a1cc7c2031fdf7d0fd4f0fdb4c /src/allocators/llalloc.py
parentcbc497138d1c4b77860e54304705cc157c2b800a (diff)
downloadallocbench-cac85412d757b6054436dc9c63d30db645bc93ea.tar.gz
allocbench-cac85412d757b6054436dc9c63d30db645bc93ea.zip
Add ArchiveArtifacts
ArchiveArtifacts check a downloaded archive against a provided checksum. The Archive is downloaded to cache/<name>/<name>.<format>. The only suported format is tar. ArchiveArtifacts can be used as sources of an Allocator.
Diffstat (limited to 'src/allocators/llalloc.py')
-rw-r--r--src/allocators/llalloc.py21
1 files changed, 10 insertions, 11 deletions
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)