From cac85412d757b6054436dc9c63d30db645bc93ea Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 22 Sep 2019 18:35:47 +0200 Subject: Add ArchiveArtifacts ArchiveArtifacts check a downloaded archive against a provided checksum. The Archive is downloaded to cache//.. The only suported format is tar. ArchiveArtifacts can be used as sources of an Allocator. --- src/allocators/all.py | 4 ++-- src/allocators/llalloc.py | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src/allocators') diff --git a/src/allocators/all.py b/src/allocators/all.py index a2b502a..0593c81 100644 --- a/src/allocators/all.py +++ b/src/allocators/all.py @@ -24,12 +24,12 @@ from src.allocators.hoard import hoard from src.allocators.mesh import mesh from src.allocators.scalloc import scalloc from src.allocators.supermalloc import supermalloc -# from src.allocators.llalloc import llalloc +from src.allocators.llalloc import llalloc from src.allocators.tbbmalloc import tbbmalloc from src.allocators.mimalloc import mimalloc from src.allocators.snmalloc import snmalloc allocators = [*src.allocators.glibcs.allocators, tcmalloc, tcmalloc_nofs, - jemalloc, hoard, mesh, supermalloc, scalloc, tbbmalloc, # llalloc, # streamflow, + jemalloc, hoard, mesh, supermalloc, scalloc, tbbmalloc, llalloc, # streamflow, mimalloc, snmalloc] 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) -- cgit v1.2.3