Runs analysis in a loop for each iteration. Includes running any graphing. If "analysis.log" does not exist in a certain iteration, warns script.
(self, total_args, iterations, print_stats=False, logfile=None)
| 315 | post_process_logfile) |
| 316 | |
| 317 | def run_analysis_loop(self, total_args, iterations, print_stats=False, logfile=None): |
| 318 | """ |
| 319 | Runs analysis in a loop for each iteration. |
| 320 | Includes running any graphing. |
| 321 | If "analysis.log" does not exist in a certain iteration, |
| 322 | warns script. |
| 323 | """ |
| 324 | if len(iterations) == 0: |
| 325 | return |
| 326 | csv_header = iterations[0].get_csv_header() |
| 327 | folder_path = Path(total_args.folder) |
| 328 | if logfile is None: |
| 329 | return |
| 330 | |
| 331 | df = pd.DataFrame(columns = csv_header) |
| 332 | for iteration in iterations: |
| 333 | analysis_path = iteration.get_folder_name(folder_path) /\ |
| 334 | "analysis.log" |
| 335 | skipped = iteration.get_folder_name(folder_path) /\ |
| 336 | "skipped.log" |
| 337 | ret = "" |
| 338 | if (os.path.exists(skipped)): |
| 339 | continue |
| 340 | if not(os.path.exists(analysis_path)): |
| 341 | status = iteration.run(folder_path, |
| 342 | self.get_exp_config(), |
| 343 | self.get_machine_config(), |
| 344 | total_args.pprint, |
| 345 | total_args.use_perf, |
| 346 | print_stats) |
| 347 | if not status: |
| 348 | utils.warn("Analysis for iteration {} did not exist and failed to rerun".format(str(iteration))) |
| 349 | continue |
| 350 | |
| 351 | #if True: |
| 352 | if not(os.path.exists(analysis_path)): |
| 353 | utils.info("Analyzing iteration {}".format(str(iteration))) |
| 354 | host_type_map = self.get_machine_config()["host_types"] |
| 355 | program_args_map = iteration.get_program_args_map(self.get_exp_config(), |
| 356 | host_type_map, |
| 357 | self.get_machine_config(), |
| 358 | total_args.folder) |
| 359 | client_file_list = iteration.get_client_file_list( |
| 360 | self.get_exp_config(), |
| 361 | program_args_map, |
| 362 | host_type_map, |
| 363 | total_args.folder) |
| 364 | iteration.calculate_iteration_stats( |
| 365 | iteration.get_folder_name(total_args.folder), |
| 366 | client_file_list, |
| 367 | False) |
| 368 | |
| 369 | iteration_df = iteration.read_analysis_log(folder_path) |
| 370 | df = pd.concat([df, iteration_df], ignore_index = True) |
| 371 | # write to logfile |
| 372 | df.to_csv(str(folder_path/logfile)) |
| 373 | |
| 374 | def run_iterations(self, total_args, iterations, print_stats=False): |
no test coverage detected