Skip to content
Snippets Groups Projects
Commit df3963e8 authored by Millian Poquet's avatar Millian Poquet
Browse files

script: fix batsim workload generator

parent a47ffb68
Branches
Tags
No related merge requests found
...@@ -108,9 +108,9 @@ def main(): ...@@ -108,9 +108,9 @@ def main():
power_df = pd.concat([power_df, next_month_power_df]) power_df = pd.concat([power_df, next_month_power_df])
del next_month_power_df del next_month_power_df
global POWER_DF global POWER_DF
POWER_DF = power_df.sort_values(by='timestamp') POWER_DF = power_df.sort_values(by='timestamp')
del power_df del power_df
with ProcessPoolExecutor(max_workers=args.max_processes) as executor: with ProcessPoolExecutor(max_workers=args.max_processes) as executor:
for wload, wload_type in [(running_jobs, 'init_run'), (queued_jobs, 'init_queue'), (toreplay_jobs, 'main')]: for wload, wload_type in [(running_jobs, 'init_run'), (queued_jobs, 'init_queue'), (toreplay_jobs, 'main')]:
...@@ -134,12 +134,13 @@ def main(): ...@@ -134,12 +134,13 @@ def main():
case 'usage_replay': case 'usage_replay':
job_starts_seconds_since_m100_epoch = int((row['start_time'] - EPOCH_M100).total_seconds()) job_starts_seconds_since_m100_epoch = int((row['start_time'] - EPOCH_M100).total_seconds())
job_profile = f'{row["job_id"]}_{job_starts_seconds_since_m100_epoch}' job_profile = f'{row["job_id"]}_{job_starts_seconds_since_m100_epoch}'
job_profile_dir = f'{args.output_dir}/jobs/{row["job_id"]}_{job_starts_seconds_since_m100_epoch}' job_profile_dir_suffix = f'jobs/{row["job_id"]}_{job_starts_seconds_since_m100_epoch}'
job_profile_dir = f'{args.output_dir}/{job_profile_dir_suffix}'
profiles[job_profile] = { profiles[job_profile] = {
'type': 'trace_replay', 'type': 'trace_replay',
'trace_type': 'usage', 'trace_type': 'usage',
'trace_file': f'{os.path.abspath(job_profile_dir)}/traces.txt', 'trace_file': f'./{job_profile_dir_suffix}/traces.txt',
} }
# assume that already existing dirs have valid content # assume that already existing dirs have valid content
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment