From 3884a7712b74c09d4216b856464d6c3cdd9e3476 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 9 Mar 2020 19:34:31 +0100 Subject: fmt all src/allocators using yapf --- src/allocators/BA_allocators.py | 1 - src/allocators/__init__.py | 1 - src/allocators/all.py | 20 +++++++++++++------ src/allocators/bumpptr.py | 4 ++-- src/allocators/chattymalloc.py | 8 ++++---- src/allocators/glibc.py | 31 ++++++++++++++++-------------- src/allocators/glibcs.py | 2 -- src/allocators/hoard.py | 12 +++++++----- src/allocators/installed_allocators.py | 30 +++++++++++++++++------------ src/allocators/jemalloc.py | 13 +++++++------ src/allocators/llalloc.py | 17 ++++++++--------- src/allocators/malt.py | 5 +++-- src/allocators/mesh.py | 13 +++++++------ src/allocators/mimalloc.py | 7 +++---- src/allocators/no_falsesharing.py | 7 ++++--- src/allocators/paper.py | 8 +++++--- src/allocators/rpmalloc.py | 10 +++++----- src/allocators/scalloc.py | 14 ++++++++------ src/allocators/snmalloc.py | 9 +++++---- src/allocators/speedymalloc.py | 35 ++++++++++++++++++++-------------- src/allocators/speedymallocs.py | 10 ++++------ src/allocators/streamflow.py | 11 ++++++----- src/allocators/supermalloc.py | 15 +++++++++------ src/allocators/tbbmalloc.py | 8 ++++---- src/allocators/tcmallocs.py | 11 ++++------- 25 files changed, 165 insertions(+), 137 deletions(-) (limited to 'src/allocators') diff --git a/src/allocators/BA_allocators.py b/src/allocators/BA_allocators.py index 51e4cfc..9c11873 100644 --- a/src/allocators/BA_allocators.py +++ b/src/allocators/BA_allocators.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Collection containing all allocators used in Florian's BA thesis""" from src.allocators.glibc import glibc, glibc_notc diff --git a/src/allocators/__init__.py b/src/allocators/__init__.py index 2700bbd..d5c6419 100644 --- a/src/allocators/__init__.py +++ b/src/allocators/__init__.py @@ -14,5 +14,4 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """allocbench allocator definitions""" diff --git a/src/allocators/all.py b/src/allocators/all.py index 9dfd563..ed8d01e 100644 --- a/src/allocators/all.py +++ b/src/allocators/all.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Collection containing all available allocators""" import src.allocators.glibcs @@ -30,8 +29,17 @@ from src.allocators.mimalloc import mimalloc from src.allocators.snmalloc import snmalloc from src.allocators.rpmalloc import rpmalloc - -allocators = [*src.allocators.glibcs.allocators, - *src.allocators.tcmallocs.allocators, - jemalloc, hoard, mesh, supermalloc, scalloc, tbbmalloc, llalloc, # streamflow, - mimalloc, snmalloc, rpmalloc] +allocators = [ + *src.allocators.glibcs.allocators, + *src.allocators.tcmallocs.allocators, + jemalloc, + hoard, + mesh, + supermalloc, + scalloc, + tbbmalloc, + llalloc, # streamflow, + mimalloc, + snmalloc, + rpmalloc +] diff --git a/src/allocators/bumpptr.py b/src/allocators/bumpptr.py index 98cba4b..9165352 100644 --- a/src/allocators/bumpptr.py +++ b/src/allocators/bumpptr.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Bumpptr allocator The bumpptr allocator makes the biggest possible tradeoff between speed and @@ -25,5 +24,6 @@ See src/bumpptr.c for the actual implementation. import os from src.allocator import Allocator, BUILDDIR -bumpptr = Allocator("bumpptr", LD_PRELOAD=os.path.join(BUILDDIR, "bumpptr_alloc.so"), +bumpptr = Allocator("bumpptr", + LD_PRELOAD=os.path.join(BUILDDIR, "bumpptr_alloc.so"), color="xkcd:black") diff --git a/src/allocators/chattymalloc.py b/src/allocators/chattymalloc.py index 30106a6..0f893bb 100644 --- a/src/allocators/chattymalloc.py +++ b/src/allocators/chattymalloc.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """chattymalloc allocator This shared library is no functional allocator. It is used to retrieve a trace @@ -26,6 +25,7 @@ See src/chattymalloc.c and chattyparser.py for its implementation and usage. import os from src.allocator import Allocator, BUILDDIR -chattymalloc = Allocator("chattymalloc", - LD_PRELOAD=os.path.join(BUILDDIR, "chattymalloc.so"), - cmd_prefix="env CHATTYMALLOC_FILE={{result_dir}}/{{perm}}.trace") +chattymalloc = Allocator( + "chattymalloc", + LD_PRELOAD=os.path.join(BUILDDIR, "chattymalloc.so"), + cmd_prefix="env CHATTYMALLOC_FILE={{result_dir}}/{{perm}}.trace") diff --git a/src/allocators/glibc.py b/src/allocators/glibc.py index faeadd4..5d2814d 100644 --- a/src/allocators/glibc.py +++ b/src/allocators/glibc.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Glibc definitions""" from multiprocessing import cpu_count @@ -36,10 +35,12 @@ class Glibc(Allocator): configure_args = kwargs["configure_args"] del kwargs["configure_args"] - self.build_cmds = ["mkdir -p glibc-build", - "cd glibc-build; {srcdir}/configure --prefix={dir} " + configure_args, - "cd glibc-build; make", - f"cd glibc-build; make -l {cpu_count()} install"] + self.build_cmds = [ + "mkdir -p glibc-build", + "cd glibc-build; {srcdir}/configure --prefix={dir} " + + configure_args, "cd glibc-build; make", + f"cd glibc-build; make -l {cpu_count()} install" + ] self.cmd_prefix = "{dir}/lib/ld-linux-x86-64.so.2 --library-path {dir}/lib:" + LIBRARY_PATH @@ -53,12 +54,14 @@ glibc_notc = Glibc("glibc-noThreadCache", 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") +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/glibcs.py b/src/allocators/glibcs.py index 936d2c7..8c26493 100644 --- a/src/allocators/glibcs.py +++ b/src/allocators/glibcs.py @@ -14,10 +14,8 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Collection containing all glibc variants""" from src.allocators.glibc import glibc, glibc_notc, glibc_nofs, glibc_nofs_fancy - allocators = [glibc, glibc_notc, glibc_nofs, glibc_nofs_fancy] diff --git a/src/allocators/hoard.py b/src/allocators/hoard.py index 7e94d79..5d0c2ce 100644 --- a/src/allocators/hoard.py +++ b/src/allocators/hoard.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """Hoard allocator definition for allocbench""" from src.allocator import Allocator @@ -28,12 +27,15 @@ class Hoard(Allocator): 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.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", version="aa6d31700d5368a9f5ede3d62731247c8d9f0ebb", 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 d45755a..5e3c78d 100644 --- a/src/allocators/installed_allocators.py +++ b/src/allocators/installed_allocators.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """Collect allocators using installed system libraries""" import subprocess @@ -22,23 +21,30 @@ 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: path = subprocess.run('whereis lib{} | cut -d":" -f2'.format(t), - shell=True, stdout=subprocess.PIPE, + shell=True, + stdout=subprocess.PIPE, universal_newlines=True).stdout.strip() except: continue if path != "": - allocators[t] = {"cmd_prefix": "", - "binary_suffix": "", - "LD_PRELOAD": path, - "LD_LIBRARY_PATH": "", - "color": "C"+str(i+2)} + allocators[t] = { + "cmd_prefix": "", + "binary_suffix": "", + "LD_PRELOAD": path, + "LD_LIBRARY_PATH": "", + "color": "C" + str(i + 2) + } diff --git a/src/allocators/jemalloc.py b/src/allocators/jemalloc.py index 18e3055..ab2528b 100644 --- a/src/allocators/jemalloc.py +++ b/src/allocators/jemalloc.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """jemalloc definition for allocbench""" from src.allocator import Allocator @@ -24,15 +23,17 @@ from src.artifact import GitArtifact class Jemalloc(Allocator): """jemalloc allocator""" - sources = GitArtifact("jemalloc", "https://github.com/jemalloc/jemalloc.git") + 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"] + 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) diff --git a/src/allocators/llalloc.py b/src/allocators/llalloc.py index 8f43f59..d3c5288 100644 --- a/src/allocators/llalloc.py +++ b/src/allocators/llalloc.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """Lockless allocator definition for allocbench""" from src.allocator import Allocator @@ -25,14 +24,15 @@ class LocklessAllocator(Allocator): """Lockless allocator""" def __init__(self, name, **kwargs): - self.sources = ArchiveArtifact("llalloc", - "https://locklessinc.com/downloads/lockless_allocator_src.tgz", - "tar", - "c6cb5a57882fa4775b5227a322333a6126b61f7c") + self.sources = ArchiveArtifact( + "llalloc", + "https://locklessinc.com/downloads/lockless_allocator_src.tgz", + "tar", "c6cb5a57882fa4775b5227a322333a6126b61f7c") - self.build_cmds = ["cd {srcdir}/lockless_allocator; make", - "mkdir -p {dir}", - "ln -f -s {srcdir}/lockless_allocator/libllalloc.so.1.3 {dir}/libllalloc.so"] + self.build_cmds = [ + "cd {srcdir}/lockless_allocator; make", "mkdir -p {dir}", + "ln -f -s {srcdir}/lockless_allocator/libllalloc.so.1.3 {dir}/libllalloc.so" + ] self.LD_PRELOAD = "{dir}/libllalloc.so" @@ -40,4 +40,3 @@ class LocklessAllocator(Allocator): llalloc = LocklessAllocator("llalloc", color="purple") - diff --git a/src/allocators/malt.py b/src/allocators/malt.py index 34fd9cc..8613145 100644 --- a/src/allocators/malt.py +++ b/src/allocators/malt.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """malt allocator definition Malt is a malloc tracker and used to capture and analyse the allocation profile @@ -24,4 +23,6 @@ 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 -malt = Allocator("malt", cmd_prefix="malt -q -o output:name={{result_dir}}/malt.{{perm}}.%3") +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 2391e23..4d99f4d 100644 --- a/src/allocators/mesh.py +++ b/src/allocators/mesh.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """Mesh definition for allocbench""" from src.allocator import Allocator @@ -28,12 +27,14 @@ class Mesh(Allocator): 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"] + 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", version="4a1012cee990cb98cc1ea0294a836f467b29be02", color="xkcd:mint") +mesh = Mesh("Mesh", + version="4a1012cee990cb98cc1ea0294a836f467b29be02", + color="xkcd:mint") diff --git a/src/allocators/mimalloc.py b/src/allocators/mimalloc.py index 6931217..08490ad 100644 --- a/src/allocators/mimalloc.py +++ b/src/allocators/mimalloc.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """mimalloc definition for allocbench""" from src.allocator import Allocator @@ -28,9 +27,9 @@ class Mimalloc(Allocator): 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.build_cmds = [ + "mkdir -p {dir}", "cd {dir}; cmake {srcdir}", "cd {dir}; make" + ] self.requirements = ["cmake"] super().__init__(name, **kwargs) diff --git a/src/allocators/no_falsesharing.py b/src/allocators/no_falsesharing.py index 90f777e..1e04305 100644 --- a/src/allocators/no_falsesharing.py +++ b/src/allocators/no_falsesharing.py @@ -14,11 +14,12 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """Collection containing all no falsesahring patches""" from src.allocators.tcmalloc import tcmalloc, tcmalloc_nofs from src.allocators.glibc import glibc, glibc_nofs, glibc_nofs_fancy - -allocators = [glibc, glibc_nofs, glibc_nofs_fancy, tcmalloc_gperftools, tcmalloc_gperftools_nofs] +allocators = [ + glibc, glibc_nofs, glibc_nofs_fancy, tcmalloc_gperftools, + tcmalloc_gperftools_nofs +] diff --git a/src/allocators/paper.py b/src/allocators/paper.py index 71c81e2..3f36be9 100644 --- a/src/allocators/paper.py +++ b/src/allocators/paper.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Collection containing all available allocators""" from src.allocators.glibc import glibc @@ -27,5 +26,8 @@ from src.allocators.mimalloc import mimalloc from src.allocators.bumpptr import bumpptr from src.allocators.speedymalloc import speedymalloc - -allocators = [glibc, tcmalloc, tcmalloc_align, tcmalloc_gperftools, tcmalloc_gperftools_align, jemalloc, llalloc, mimalloc, bumpptr, speedymalloc] +allocators = [ + glibc, tcmalloc, tcmalloc_align, tcmalloc_gperftools, + tcmalloc_gperftools_align, jemalloc, llalloc, mimalloc, bumpptr, + speedymalloc +] diff --git a/src/allocators/rpmalloc.py b/src/allocators/rpmalloc.py index c10944e..c27f244 100644 --- a/src/allocators/rpmalloc.py +++ b/src/allocators/rpmalloc.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """rpmalloc definition for allocbench""" from src.allocator import Allocator @@ -29,10 +28,11 @@ class Rpmalloc(Allocator): def __init__(self, name, **kwargs): self.LD_PRELOAD = "{dir}/librpmalloc.so" - self.build_cmds = ["cd {srcdir}; ./configure.py", - "cd {srcdir}; ninja", - "mkdir -p {dir}", - 'ln -f -s $(find {srcdir}/bin -path "*release*librpmalloc.so") {dir}/librpmalloc.so'] + self.build_cmds = [ + "cd {srcdir}; ./configure.py", "cd {srcdir}; ninja", + "mkdir -p {dir}", + 'ln -f -s $(find {srcdir}/bin -path "*release*librpmalloc.so") {dir}/librpmalloc.so' + ] super().__init__(name, **kwargs) diff --git a/src/allocators/scalloc.py b/src/allocators/scalloc.py index 82ef8d1..c071f22 100644 --- a/src/allocators/scalloc.py +++ b/src/allocators/scalloc.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """Scalloc definition for allocbench""" from src.allocator import Allocator @@ -24,14 +23,17 @@ from src.artifact import GitArtifact class Scalloc(Allocator): """Scalloc allocator""" - sources = GitArtifact("scalloc", "https://github.com/cksystemsgroup/scalloc") + 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"] + self.prepare_cmds = [ + "tools/make_deps.sh", "build/gyp/gyp --depth=. scalloc.gyp" + ] - self.build_cmds = ["cd {srcdir}; BUILDTYPE=Release make", - "mkdir -p {dir}"] + self.build_cmds = [ + "cd {srcdir}; BUILDTYPE=Release make", "mkdir -p {dir}" + ] self.LD_PRELOAD = "{srcdir}/out/Release/lib.target/libscalloc.so" diff --git a/src/allocators/snmalloc.py b/src/allocators/snmalloc.py index 7f27e4b..2c5dfa8 100644 --- a/src/allocators/snmalloc.py +++ b/src/allocators/snmalloc.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """Snmalloc definition for allocbench""" from src.allocator import Allocator @@ -28,9 +27,11 @@ class Snmalloc(Allocator): 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.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) diff --git a/src/allocators/speedymalloc.py b/src/allocators/speedymalloc.py index 48b19cb..6e37b6c 100644 --- a/src/allocators/speedymalloc.py +++ b/src/allocators/speedymalloc.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Bumpptr allocator The bumpptr allocator makes the biggest possible tradeoff between speed and @@ -27,10 +26,12 @@ from src.allocator import Allocator VERSION = "7b73dc51bba043d6b3269dd497263f03d52fc1ca" + class Speedymalloc(Allocator): """ Speedymalloc definition for allocbench""" - sources = GitArtifact("speedymalloc", "https://gitlab.cs.fau.de/flow/speedymalloc.git") + sources = GitArtifact("speedymalloc", + "https://gitlab.cs.fau.de/flow/speedymalloc.git") def __init__(self, name, **kwargs): @@ -38,27 +39,33 @@ class Speedymalloc(Allocator): for option, value in kwargs.get("options", {}).items(): configuration += f"-D{option}={value} " - self.build_cmds = [f"meson {{srcdir}} {{dir}} {configuration}", - "ninja -C {dir}"] + self.build_cmds = [ + f"meson {{srcdir}} {{dir}} {configuration}", "ninja -C {dir}" + ] self.LD_PRELOAD = "{dir}/libspeedymalloc.so" super().__init__(name, **kwargs) + speedymalloc = Speedymalloc("speedymalloc", version=VERSION) speedymalloc_dont_madv_free = Speedymalloc("speedymalloc_dont_madv_free", - options = {"madvise_free": "false"}, - version=VERSION) + options={"madvise_free": "false"}, + version=VERSION) -speedymalloc_dont_madv_willneed = Speedymalloc("speedymalloc_dont_madv_willneed", - options = {"madvise_willneed": "false"}, - version=VERSION) +speedymalloc_dont_madv_willneed = Speedymalloc( + "speedymalloc_dont_madv_willneed", + options={"madvise_willneed": "false"}, + version=VERSION) speedymalloc_4095_sc_32 = Speedymalloc("speedymalloc_dont_madv_willneed", - options = {"cache_bins": 4095, - "cache_bin_seperation": 32}, + options={ + "cache_bins": 4095, + "cache_bin_seperation": 32 + }, version=VERSION) -speedymalloc_no_glab = Speedymalloc("speedymalloc_dont_madv_willneed", - options = {"max_local_allocation_buffer_size": 0}, - version=VERSION) +speedymalloc_no_glab = Speedymalloc( + "speedymalloc_dont_madv_willneed", + options={"max_local_allocation_buffer_size": 0}, + version=VERSION) diff --git a/src/allocators/speedymallocs.py b/src/allocators/speedymallocs.py index 8961fe8..73923f7 100644 --- a/src/allocators/speedymallocs.py +++ b/src/allocators/speedymallocs.py @@ -14,13 +14,11 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Collection containing all glibc variants""" import src.allocators.speedymalloc as sm - -allocators = [sm.speedymalloc, - sm.speedymalloc_dont_madv_free, - sm.speedymalloc_dont_madv_willneed, - sm.speedymalloc_4095_sc_32] +allocators = [ + sm.speedymalloc, sm.speedymalloc_dont_madv_free, + sm.speedymalloc_dont_madv_willneed, sm.speedymalloc_4095_sc_32 +] diff --git a/src/allocators/streamflow.py b/src/allocators/streamflow.py index 005b9cb..3b04a21 100644 --- a/src/allocators/streamflow.py +++ b/src/allocators/streamflow.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """Streamflow allocator definition for allocbench""" from src.allocator import Allocator @@ -29,12 +28,14 @@ class Streamflow(Allocator): def __init__(self, name, **kwargs): self.LD_PRELOAD = "{dir}/libstreamflow.so" - self.build_cmds = ["cd {srcdir}; make", - "mkdir -p {dir}", - "ln -f -s {srcdir}/libstreamflow.so {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", version="8ac345c0f69ec9e7af02f3555c2c97eaa07a442e", +streamflow = Streamflow("Streamflow", + version="8ac345c0f69ec9e7af02f3555c2c97eaa07a442e", color="xkcd:light brown") diff --git a/src/allocators/supermalloc.py b/src/allocators/supermalloc.py index f0a192a..32f9588 100644 --- a/src/allocators/supermalloc.py +++ b/src/allocators/supermalloc.py @@ -14,26 +14,29 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """SuperMalloc definition for allocbench""" from src.allocator import Allocator from src.artifact import GitArtifact + class SuperMalloc(Allocator): """SuperMalloc allocator""" - sources = GitArtifact("SuperMalloc", "https://github.com/kuszmaul/SuperMalloc") + 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.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/tbbmalloc.py b/src/allocators/tbbmalloc.py index a7af5a5..6580939 100644 --- a/src/allocators/tbbmalloc.py +++ b/src/allocators/tbbmalloc.py @@ -14,7 +14,6 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. - """tbbmalloc definition for allocbench""" from src.allocator import Allocator @@ -28,9 +27,10 @@ class TBBMalloc(Allocator): 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'] + 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) diff --git a/src/allocators/tcmallocs.py b/src/allocators/tcmallocs.py index 3d61226..980c566 100644 --- a/src/allocators/tcmallocs.py +++ b/src/allocators/tcmallocs.py @@ -14,14 +14,11 @@ # # You should have received a copy of the GNU General Public License # along with allocbench. If not, see . - """Collection containing all glibc variants""" import src.allocators.tcmalloc as tcm - -allocators = [tcm.tcmalloc, - tcm.tcmalloc_align, - tcm.tcmalloc_gperftools_nofs, - tcm.tcmalloc_gperftools_align, - tcm.tcmalloc_gperftools_cacheline_exclusive] +allocators = [ + tcm.tcmalloc, tcm.tcmalloc_align, tcm.tcmalloc_gperftools_nofs, + tcm.tcmalloc_gperftools_align, tcm.tcmalloc_gperftools_cacheline_exclusive +] -- cgit v1.2.3