diff --git a/comparisons/compare-maxmem-summary.py b/comparisons/compare-maxmem-summary.py index 60340bb40c1b..51583f4c08ad 100755 --- a/comparisons/compare-maxmem-summary.py +++ b/comparisons/compare-maxmem-summary.py @@ -8,9 +8,9 @@ import json import glob import re +import sys -MAXMEM_WARN_THRESHOLD = 1.0 -MAXMEM_ERROR_THRESHOLD = 10.0 +import maxmem_threshold def KILL(message): @@ -50,9 +50,9 @@ def compare_maxmem_summary(**kwargs): nalloc_pr = max_memory_pr_dict[step].get("# allocations calls") ndalloc_pr = max_memory_pr_dict[step].get("# deallocations calls") nlalloc_pr = nalloc_pr - ndalloc_pr if (nalloc_pr and ndalloc_pr) else 0 - max_memory_pr = max_mem_pr / 1000000 if max_mem_pr else 0.0 - req_memory_pr = req_mem_pr / 1000000 if req_mem_pr else 0.0 - leak_memory_pr = leak_mem_pr / 1000000 if leak_mem_pr else 0.0 + max_memory_pr = max_mem_pr / (1024 * 1024) if max_mem_pr else 0.0 + req_memory_pr = req_mem_pr / (1024 * 1024) if req_mem_pr else 0.0 + leak_memory_pr = leak_mem_pr / (1024 * 1024) if leak_mem_pr else 0.0 nallocated_pr = nalloc_pr if nalloc_pr else 0 max_mem_base = max_memory_base_dict[step].get("max memory used") @@ -61,9 +61,9 @@ def compare_maxmem_summary(**kwargs): nalloc_base = max_memory_base_dict[step].get("# allocations calls") ndalloc_base = max_memory_base_dict[step].get("# deallocations calls") nlalloc_base = nalloc_base - ndalloc_base if (nalloc_base and ndalloc_base) else 0 - max_memory_base = max_mem_base / 1000000 if max_mem_base else 0.0 - req_memory_base = req_mem_base / 1000000 if req_mem_base else 0.0 - leak_memory_base = leak_mem_base / 1000000 if leak_mem_base else 0.0 + max_memory_base = max_mem_base / (1024 * 1024) if max_mem_base else 0.0 + req_memory_base = req_mem_base / (1024 * 1024) if req_mem_base else 0.0 + leak_memory_base = leak_mem_base / (1024 * 1024) if leak_mem_base else 0.0 nallocated_base = nalloc_base if nalloc_base else 0 max_mem_pdiff = max_memory_pdiff_dict[step].get("max memory used") @@ -199,36 +199,40 @@ def stepfn(step): summaryLine += [ '
| ' - + "maximum memory used warn threshold %0.3f" % MAXMEM_WARN_THRESHOLD - + '% |
| ' - + "maximum memory used error threshold %0.3f" % MAXMEM_ERROR_THRESHOLD - + "% |
| ' + + "default maximum memory used error threshold %0.0f" + % maxmem_threshold.ERROR_THRESHOLD + + ' MB |
| ' + + "default maximum memory used warn threshold -1 * %0.0f" + % maxmem_threshold.WARN_THRESHOLD + + ' MB |
| ' + + "default maximum memory used error threshold -1 * %0.0f" + % maxmem_threshold.ERROR_THRESHOLD + + " MB |