44import os
55import time
66
7- def run_command (command , silent = False ):
7+ def run_command (command , silent = False , dataset = None ):
88 """Runs a shell command."""
99 try :
1010 if silent :
@@ -89,14 +89,14 @@ def run_benchmark():
8989 selection , dataset = curses .wrapper (main )
9090 except Exception as e :
9191 print (f"Error in UI: { e } " )
92- run_command ("make clean" , silent = True )
92+ # run_command("make clean", silent=True)
9393 return
9494
9595 if selection == "Exit" or selection is None :
9696 if dataset and dataset != "Exit" :
9797 print (dataset ) # Print error message if any
9898 print ("Exiting..." )
99- run_command ("make clean" , silent = True )
99+ # run_command("make clean", silent=True)
100100 return
101101
102102 print (f"\n Running { selection } Benchmark with dataset: { dataset } \n " + "=" * 60 + "\n " )
@@ -105,30 +105,36 @@ def run_benchmark():
105105 start_time = time .time ()
106106
107107 # Pass dataset as ARGS
108- args = f'ARGS="{ dataset } "'
108+ # args = f'ARGS="{dataset}"'
109109
110+ # Run the executable of the select benchmark, avoid make rules for overhead concerns
110111 if selection == "Serial" :
111- run_command (f"make run { args } " )
112+ run_command (f"./QPESeq { dataset } " )
113+
112114 elif selection == "OMP" :
113- run_command (f"make run-omp { args } " )
115+ run_command (f"./QPEOMP { dataset } " )
116+
114117 elif selection == "MPI" :
115- run_command (f"make run-mpi { args } " )
118+ run_command (f"./QPEMPI { dataset } " )
119+
116120 elif selection == "ALL" :
117121 print ("--- Running Serial ---" )
118- run_command (f"make run { args } " )
122+ run_command (f"./QPESeq { dataset } " )
123+
119124 print ("\n --- Running OMP ---" )
120- run_command (f"make run-omp { args } " )
125+ run_command (f"./QPEOMP { dataset } " )
126+
121127 print ("\n --- Running MPI ---" )
122- run_command (f"make run-mpi { args } " )
128+ run_command (f"./QPEMPI { dataset } " )
123129
124130 end_time = time .time ()
125131 print ("\n " + "=" * 60 )
126132 print (f"Total Benchmark Time: { end_time - start_time :.4f} seconds" )
127133
128- # Run make clean silently
129- print ("Cleaning up build artifacts..." )
130- run_command ("make clean" , silent = True )
131- print ("Done." )
134+ # # Run make clean silently
135+ # print("Cleaning up build artifacts...")
136+ # run_command("make clean", silent=True)
137+ # print("Done.")
132138
133139if __name__ == "__main__" :
134140 run_benchmark ()
0 commit comments