From 37a30c808c659d285bdaed6fc28c89a4d5db1cb4 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sun, 7 Mar 2021 23:15:50 -0500 Subject: Slightly increase the efficiency of the case study script --- run_case_study.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'run_case_study.py') diff --git a/run_case_study.py b/run_case_study.py index b073468..86c6775 100755 --- a/run_case_study.py +++ b/run_case_study.py @@ -36,12 +36,12 @@ def ID2PID(lookupID): res = None # Find benchmark PID (avoid getting shell or numactl PID) try: - res = subprocess.check_output("pgrep -af ' " + lookupID + " ' | grep -v numactl | cut -d ' ' -f 1", shell=True) + res = subprocess.check_output("pgrep -af ' " + lookupID + " ' | grep -v numactl", shell=True) except: res = None if res: # Ignore the newline - return res.decode("utf-8").strip() + return res.decode("utf-8").split(" ")[0].strip() else: return None -- cgit v1.2.2