mesh-rb 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/ext/mesh/extconf.rb +22 -4
- data/ext/mesh/mesh.tar.gz +0 -0
- data/lib/mesh/version.rb +1 -1
- data/mesh.gemspec +3 -2
- metadata +4 -120
- data/ext/mesh/mesh/.bazelrc +0 -20
- data/ext/mesh/mesh/.bazelversion +0 -1
- data/ext/mesh/mesh/.clang-format +0 -15
- data/ext/mesh/mesh/.dockerignore +0 -5
- data/ext/mesh/mesh/.editorconfig +0 -16
- data/ext/mesh/mesh/.gitattributes +0 -4
- data/ext/mesh/mesh/.github/workflows/main.yml +0 -144
- data/ext/mesh/mesh/.gitignore +0 -51
- data/ext/mesh/mesh/AUTHORS +0 -5
- data/ext/mesh/mesh/CMakeLists.txt +0 -270
- data/ext/mesh/mesh/CODE_OF_CONDUCT.md +0 -77
- data/ext/mesh/mesh/Dockerfile +0 -30
- data/ext/mesh/mesh/LICENSE +0 -201
- data/ext/mesh/mesh/Makefile +0 -81
- data/ext/mesh/mesh/README.md +0 -97
- data/ext/mesh/mesh/WORKSPACE +0 -50
- data/ext/mesh/mesh/bazel +0 -350
- data/ext/mesh/mesh/mesh-pldi19-powers.pdf +0 -0
- data/ext/mesh/mesh/src/BUILD +0 -222
- data/ext/mesh/mesh/src/CMakeLists.txt +0 -85
- data/ext/mesh/mesh/src/bitmap.h +0 -590
- data/ext/mesh/mesh/src/cheap_heap.h +0 -170
- data/ext/mesh/mesh/src/common.h +0 -377
- data/ext/mesh/mesh/src/copts.bzl +0 -31
- data/ext/mesh/mesh/src/d_assert.cc +0 -75
- data/ext/mesh/mesh/src/fixed_array.h +0 -124
- data/ext/mesh/mesh/src/global_heap.cc +0 -547
- data/ext/mesh/mesh/src/global_heap.h +0 -569
- data/ext/mesh/mesh/src/gnu_wrapper.cc +0 -75
- data/ext/mesh/mesh/src/internal.h +0 -356
- data/ext/mesh/mesh/src/libmesh.cc +0 -239
- data/ext/mesh/mesh/src/mac_wrapper.cc +0 -528
- data/ext/mesh/mesh/src/measure_rss.cc +0 -44
- data/ext/mesh/mesh/src/measure_rss.h +0 -20
- data/ext/mesh/mesh/src/meshable_arena.cc +0 -776
- data/ext/mesh/mesh/src/meshable_arena.h +0 -309
- data/ext/mesh/mesh/src/meshing.h +0 -60
- data/ext/mesh/mesh/src/mini_heap.h +0 -532
- data/ext/mesh/mesh/src/mmap_heap.h +0 -104
- data/ext/mesh/mesh/src/one_way_mmap_heap.h +0 -77
- data/ext/mesh/mesh/src/partitioned_heap.h +0 -111
- data/ext/mesh/mesh/src/plasma/mesh.h +0 -33
- data/ext/mesh/mesh/src/real.cc +0 -52
- data/ext/mesh/mesh/src/real.h +0 -36
- data/ext/mesh/mesh/src/rng/mwc.h +0 -296
- data/ext/mesh/mesh/src/rng/mwc64.h +0 -58
- data/ext/mesh/mesh/src/rpl_printf.c +0 -1991
- data/ext/mesh/mesh/src/runtime.cc +0 -393
- data/ext/mesh/mesh/src/runtime.h +0 -114
- data/ext/mesh/mesh/src/shuffle_vector.h +0 -287
- data/ext/mesh/mesh/src/size_classes.def +0 -251
- data/ext/mesh/mesh/src/static/if.h +0 -36
- data/ext/mesh/mesh/src/static/log.h +0 -43
- data/ext/mesh/mesh/src/testing/benchmark/local_refill.cc +0 -103
- data/ext/mesh/mesh/src/testing/big-alloc.c +0 -28
- data/ext/mesh/mesh/src/testing/fragmenter.cc +0 -128
- data/ext/mesh/mesh/src/testing/global-large-stress.cc +0 -25
- data/ext/mesh/mesh/src/testing/local-alloc.c +0 -16
- data/ext/mesh/mesh/src/testing/meshing_benchmark.cc +0 -189
- data/ext/mesh/mesh/src/testing/thread.cc +0 -35
- data/ext/mesh/mesh/src/testing/unit/alignment.cc +0 -56
- data/ext/mesh/mesh/src/testing/unit/bitmap_test.cc +0 -274
- data/ext/mesh/mesh/src/testing/unit/concurrent_mesh_test.cc +0 -185
- data/ext/mesh/mesh/src/testing/unit/mesh_test.cc +0 -143
- data/ext/mesh/mesh/src/testing/unit/rng_test.cc +0 -22
- data/ext/mesh/mesh/src/testing/unit/size_class_test.cc +0 -66
- data/ext/mesh/mesh/src/testing/unit/triple_mesh_test.cc +0 -285
- data/ext/mesh/mesh/src/testing/userfaultfd-kernel-copy.cc +0 -164
- data/ext/mesh/mesh/src/thread_local_heap.cc +0 -163
- data/ext/mesh/mesh/src/thread_local_heap.h +0 -268
- data/ext/mesh/mesh/src/wrapper.cc +0 -433
- data/ext/mesh/mesh/support/export_mesh.cmake +0 -28
- data/ext/mesh/mesh/support/gen-size-classes +0 -57
- data/ext/mesh/mesh/support/install_all_configs +0 -33
- data/ext/mesh/mesh/support/remove_export_mesh.cmake +0 -48
- data/ext/mesh/mesh/support/update-bazelisk +0 -8
- data/ext/mesh/mesh/theory/32m80.png +0 -0
- data/ext/mesh/mesh/theory/64m80ind.png +0 -0
- data/ext/mesh/mesh/theory/bound_comparison.py +0 -67
- data/ext/mesh/mesh/theory/bounds/impdeg+1 +0 -135
- data/ext/mesh/mesh/theory/choose.py +0 -43
- data/ext/mesh/mesh/theory/common.py +0 -42
- data/ext/mesh/mesh/theory/compute_exp_Y.py +0 -134
- data/ext/mesh/mesh/theory/createRandomString.py +0 -69
- data/ext/mesh/mesh/theory/deg_bound_check.py +0 -100
- data/ext/mesh/mesh/theory/degcheck.py +0 -47
- data/ext/mesh/mesh/theory/dumps/32,1,80,dumb.txt +0 -81
- data/ext/mesh/mesh/theory/dumps/32,2,80,dumb.txt +0 -81
- data/ext/mesh/mesh/theory/dumps/32,3,80,dumb.txt +0 -81
- data/ext/mesh/mesh/theory/dumps/32,4,80,dumb.txt +0 -81
- data/ext/mesh/mesh/theory/dumps/32,5,80,dumb.txt +0 -81
- data/ext/mesh/mesh/theory/dumps/32,6,80,dumb.txt +0 -81
- data/ext/mesh/mesh/theory/dumps/32,7,80,dumb.txt +0 -81
- data/ext/mesh/mesh/theory/dumps/32,8,80,dumb.txt +0 -81
- data/ext/mesh/mesh/theory/dumps/32,9,80,dumb.txt +0 -81
- data/ext/mesh/mesh/theory/experiment.py +0 -303
- data/ext/mesh/mesh/theory/experiment_raw_results/.gitignore +0 -0
- data/ext/mesh/mesh/theory/greedy_experiment.py +0 -66
- data/ext/mesh/mesh/theory/greedy_experiment_copy.py +0 -46
- data/ext/mesh/mesh/theory/greedy_experiment_q.py +0 -75
- data/ext/mesh/mesh/theory/makeGraph.py +0 -64
- data/ext/mesh/mesh/theory/manyreps.png +0 -0
- data/ext/mesh/mesh/theory/manystrings.png +0 -0
- data/ext/mesh/mesh/theory/match_vs_color_experiment.py +0 -94
- data/ext/mesh/mesh/theory/maxmatch_vs_E[Y].py +0 -162
- data/ext/mesh/mesh/theory/maxmatch_vs_greedymatch.py +0 -96
- data/ext/mesh/mesh/theory/maxvdeg+1imp++32,80.png +0 -0
- data/ext/mesh/mesh/theory/mesh_util.py +0 -322
- data/ext/mesh/mesh/theory/meshers.py +0 -452
- data/ext/mesh/mesh/theory/meshingBenchmark.py +0 -96
- data/ext/mesh/mesh/theory/occupancyComparison.py +0 -133
- data/ext/mesh/mesh/theory/randmatch_vs_greedymatch.py +0 -97
- data/ext/mesh/mesh/theory/randmatch_vs_greedymatch_q.py +0 -103
- data/ext/mesh/mesh/theory/randmatch_vs_greedymatch_time.py +0 -117
- data/ext/mesh/mesh/theory/read_mesh_dump.py +0 -82
- data/ext/mesh/mesh/theory/test.py +0 -70
- data/ext/mesh/mesh/tools/bazel +0 -1
@@ -1,82 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
|
4
|
-
import json
|
5
|
-
import sys
|
6
|
-
import argparse
|
7
|
-
from collections import defaultdict
|
8
|
-
|
9
|
-
import meshers
|
10
|
-
|
11
|
-
MB = 1/1024.0/1024.0
|
12
|
-
|
13
|
-
class Span(object):
|
14
|
-
def __init__(self, obj):
|
15
|
-
self.name = obj['name']
|
16
|
-
self.size = obj['object-size']
|
17
|
-
self.length = obj['length']
|
18
|
-
self.bitmap = obj['bitmap']
|
19
|
-
|
20
|
-
|
21
|
-
def read_data(json_path):
|
22
|
-
'''
|
23
|
-
Reads a dict of size -> span list from a mesh dump file at `json_path`
|
24
|
-
'''
|
25
|
-
size_classes = defaultdict(list)
|
26
|
-
|
27
|
-
with open(json_path) as f:
|
28
|
-
for l in f.readlines():
|
29
|
-
obj = json.loads(l)
|
30
|
-
span = Span(obj)
|
31
|
-
size_classes[span.size].append(span)
|
32
|
-
|
33
|
-
return size_classes
|
34
|
-
|
35
|
-
|
36
|
-
def count_meshes(mesher, spans):
|
37
|
-
bitmaps = [s.bitmap for s in spans]
|
38
|
-
if len(bitmaps) % 2 == 1:
|
39
|
-
bitmaps.append('1' * len(s.bitmap))
|
40
|
-
|
41
|
-
return mesher(bitmaps)
|
42
|
-
|
43
|
-
|
44
|
-
def main():
|
45
|
-
parser = argparse.ArgumentParser()
|
46
|
-
parser.add_argument('--size', type=int, help='size to dump graph')
|
47
|
-
parser.add_argument('json_file', nargs=1, help='A JSON dump from libmesh')
|
48
|
-
args = parser.parse_args()
|
49
|
-
|
50
|
-
if not args.json_file:
|
51
|
-
parser.print_help()
|
52
|
-
return 1
|
53
|
-
|
54
|
-
size_classes = read_data(args.json_file[0])
|
55
|
-
|
56
|
-
sizes = sorted(size_classes.keys(), reverse=True)
|
57
|
-
|
58
|
-
total_size = 0
|
59
|
-
for size in sizes:
|
60
|
-
spans = size_classes[size]
|
61
|
-
total_size += sum([s.size * s.length for s in spans])
|
62
|
-
|
63
|
-
print('Total heap size: %.1f MiB' % (total_size * MB,))
|
64
|
-
|
65
|
-
saved = 0
|
66
|
-
for size in sizes:
|
67
|
-
if size >= 4096:
|
68
|
-
continue
|
69
|
-
spans = size_classes[size]
|
70
|
-
# n = count_meshes(meshers.optimalMesher, spans)
|
71
|
-
# n = count_meshes(meshers.optimalMesher, spans)
|
72
|
-
n = count_meshes(meshers.greedyMesher, spans)
|
73
|
-
print('\t%5d: %d spans (%d meshes)' % (size, len(spans), len(n)))
|
74
|
-
saved += (size * spans[0].length) * len(n)
|
75
|
-
|
76
|
-
print('Saved size: %.1f MiB' % (saved * MB,))
|
77
|
-
|
78
|
-
return 0
|
79
|
-
|
80
|
-
|
81
|
-
if __name__ == '__main__':
|
82
|
-
sys.exit(main())
|
@@ -1,70 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
"""
|
3
|
-
Created on Mon Apr 25 14:34:04 2016
|
4
|
-
|
5
|
-
@author: devd
|
6
|
-
"""
|
7
|
-
from __future__ import division
|
8
|
-
import logging
|
9
|
-
import math
|
10
|
-
from choose import nCr
|
11
|
-
import numpy as np
|
12
|
-
from scipy.misc import comb
|
13
|
-
import createRandomString as c
|
14
|
-
import meshers
|
15
|
-
import time
|
16
|
-
import random
|
17
|
-
import functools
|
18
|
-
import json
|
19
|
-
import pickle
|
20
|
-
import os
|
21
|
-
from mesh_util import occupancySort, formatStrings, fast_q
|
22
|
-
from createRandomString import createIndependentRandomStrings
|
23
|
-
|
24
|
-
#logging.getLogger('').handlers = []
|
25
|
-
#logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
|
26
|
-
#logging.debug('This is a log message.')
|
27
|
-
#logging.info('test')
|
28
|
-
#logging.warning('double test')
|
29
|
-
#
|
30
|
-
|
31
|
-
#strings = createIndependentRandomStrings(4,10,numOnes = 2)
|
32
|
-
#new_strings = []
|
33
|
-
#for string in strings:
|
34
|
-
# new_strings.append((string, long(string, base=2)))
|
35
|
-
#print new_strings
|
36
|
-
#print "\n \n \n"
|
37
|
-
##occupancySort(strings)
|
38
|
-
#new_strings.sort(key = lambda x: x[0].count("1"))
|
39
|
-
#print new_strings
|
40
|
-
|
41
|
-
strings = createIndependentRandomStrings(256, 10000, numOnes = 5)
|
42
|
-
strings = formatStrings(strings)
|
43
|
-
occs = [x[2] for x in strings]
|
44
|
-
print np.mean(occs)
|
45
|
-
print np.std(occs)
|
46
|
-
|
47
|
-
def faster_q(length, occ1, occ2):
|
48
|
-
numerator = 1
|
49
|
-
for i in range(length-occ1, length-occ1-occ2, -1):
|
50
|
-
numerator *= i
|
51
|
-
denominator = 1
|
52
|
-
for i in range(length, length-occ2, -1):
|
53
|
-
denominator *= i
|
54
|
-
return float(numerator)/float(denominator)
|
55
|
-
|
56
|
-
length = 128
|
57
|
-
|
58
|
-
start = time.time()
|
59
|
-
for occ1 in range(0,50):
|
60
|
-
for occ2 in range(0,50):
|
61
|
-
result1 = fast_q(length, occ1, occ2)
|
62
|
-
t1 = time.time() - start
|
63
|
-
|
64
|
-
start = time.time()
|
65
|
-
for occ1 in range(0,50):
|
66
|
-
for occ2 in range(0,50):
|
67
|
-
result2 = faster_q(length, occ1, occ2)
|
68
|
-
t2 = time.time()-start
|
69
|
-
print 'fast_q got {} in {} ms'.format(result1, t1)
|
70
|
-
print 'faster_q got {} in {} ms'.format(result2, t2)
|
data/ext/mesh/mesh/tools/bazel
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
../bazel
|