@@ -28,17 +28,23 @@ def init_cmd_args():
2828 type = int ,
2929 help = "List of process/thread counts to run sequentially"
3030 )
31+ parser .add_argument (
32+ "--verbose" ,
33+ action = "store_true" ,
34+ help = "Print commands executed by the script"
35+ )
3136 args = parser .parse_args ()
3237 _args_dict = vars (args )
3338 return _args_dict
3439
3540
3641class PPCRunner :
37- def __init__ (self ):
42+ def __init__ (self , verbose = False ):
3843 self .__ppc_num_threads = None
3944 self .__ppc_num_proc = None
4045 self .__ppc_env = None
4146 self .work_dir = None
47+ self .verbose = verbose
4248
4349 self .valgrind_cmd = "valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all"
4450
@@ -71,6 +77,8 @@ def setup_env(self, ppc_env):
7177 self .work_dir = Path (self .__get_project_path ()) / "build" / "bin"
7278
7379 def __run_exec (self , command ):
80+ if self .verbose :
81+ print ("Executing:" , " " .join (shlex .quote (part ) for part in command ))
7482 result = subprocess .run (command , shell = False , env = self .__ppc_env )
7583 if result .returncode != 0 :
7684 raise Exception (f"Subprocess return { result .returncode } ." )
@@ -144,7 +152,7 @@ def run_performance(self):
144152
145153
146154def _execute (args_dict , env ):
147- runner = PPCRunner ()
155+ runner = PPCRunner (verbose = args_dict . get ( "verbose" , False ) )
148156 runner .setup_env (env )
149157
150158 if args_dict ["running_type" ] in ["threads" , "processes" ]:
0 commit comments