Skip to content

Commit

Permalink
added cooler mem calculation to partb benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
SooLee committed Sep 16, 2017
1 parent f7b8421 commit 90d7895
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions Benchmark/Benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,23 @@ def hi_c_processing_partb(input_json):
total_safe_size = total_size * 2

# mem
mem = 14 * GB_IN_MB # default from cwl
maxmem = 14 * GB_IN_MB # default from cwl
if 'parameters' in input_json:
if 'maxmem' in input_json.get('parameters'):
maxmem = input_json.get('parameters').get('maxmem')
if 'g' in maxmem:
mem = int(maxmem.replace('g', '')) * GB_IN_MB
maxmem = int(maxmem.replace('g', '')) * GB_IN_MB
elif 'm' in maxmem:
mem = int(maxmem.replace('m', ''))
maxmem = int(maxmem.replace('m', ''))
else:
raise Exception("proper maxmem string?")

cooler_mem = nthreads * input_size * GB_IN_MB
if cooler_mem > maxmem:
mem = cooler_mem
else:
mem = maxmem

r = BenchmarkResult(size=total_safe_size, mem=mem, cpu=nthreads)
return(r.as_dict())

Expand Down
2 changes: 1 addition & 1 deletion Benchmark/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version information."""

# The following line *must* be the last in the module, exactly as formatted:
__version__ = "0.1.8"
__version__ = "0.1.9"
2 changes: 1 addition & 1 deletion tests/tests_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_benchmark9(self):
input_json = {'input_size_in_bytes': {'input_pairs': [1000000000,
2000000000,
3000000000]},
'parameters': {'ncores': 1,
'parameters': {'ncores': 16,
'maxmem': '1900g'}}
res = B.benchmark('hi-c-processing-partb', input_json)
print(res)
Expand Down

0 comments on commit 90d7895

Please sign in to comment.