From 06e2a847e07b5b4940201071e8a601941d76d124 Mon Sep 17 00:00:00 2001 From: Greg Lindahl Date: Sat, 25 Jul 2020 13:34:22 -0700 Subject: [PATCH] use the iowait stat by default --- Makefile | 1 + paramsurvey/psmultiprocessing.py | 7 ++++--- paramsurvey/psray.py | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b9cd5c4..52a813d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .PHONY: test clean_coverage test_coverage distclean dist_check dist test: + # hint: PYTEST_STDERR_VISIBLE=-v PYTHONPATH=. pytest test/unit PYTHONPATH=. test/integration/test-multiprocessing.sh test/integration PYTHONPATH=.:test/integration test/integration/test-ray.sh test/integration diff --git a/paramsurvey/psmultiprocessing.py b/paramsurvey/psmultiprocessing.py index 673ab3c..5385966 100644 --- a/paramsurvey/psmultiprocessing.py +++ b/paramsurvey/psmultiprocessing.py @@ -35,7 +35,7 @@ def finalize(): def current_core_count(): - # XXX should be the pool size + # XXX should be the pool size, if confered by init(ncores=) # XXX also affected by os.sched_getaffinity return multiprocessing.cpu_count() @@ -73,8 +73,9 @@ def do_work_wrapper(func, system_kwargs, user_kwargs, psets): user_ret = {'pset': pset} try: - with stats.record_wallclock(name, raw_stats): - result = func(pset, system_kwargs, user_kwargs, raw_stats) + with stats.record_wallclock(name+'_wall', raw_stats): + with stats.record_iowait(name+'_io', raw_stats): + result = func(pset, system_kwargs, user_kwargs, raw_stats) user_ret['result'] = result except Exception as e: user_ret['exception'] = repr(e) diff --git a/paramsurvey/psray.py b/paramsurvey/psray.py index 179f23b..884eced 100644 --- a/paramsurvey/psray.py +++ b/paramsurvey/psray.py @@ -75,8 +75,9 @@ def do_work_wrapper(func, system_kwargs, user_kwargs, psets): user_ret = {'pset': pset} try: - with stats.record_wallclock(name, raw_stats): - result = func(pset, system_kwargs, user_kwargs, raw_stats) + with stats.record_wallclock(name+'_wall', raw_stats): + with stats.record_iowait(name+'_io', raw_stats): + result = func(pset, system_kwargs, user_kwargs, raw_stats) user_ret['result'] = result except Exception as e: user_ret['exception'] = repr(e)