Skip to content

Commit

Permalink
truncate excessively long simulation names (#233)
Browse files Browse the repository at this point in the history
* truncate excessively long simulation names

* truncate long filenames in get_stats and job status

---------

Co-authored-by: Tim Rogers <[email protected]>
Co-authored-by: JRPan <[email protected]>
  • Loading branch information
3 people authored Aug 9, 2024
1 parent 8d0785d commit 76dfd0b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 49 deletions.
13 changes: 4 additions & 9 deletions util/job_launching/get_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,10 @@ def millify(n):
torque_submname = re.sub(
r".*\.([^\s]*-commit-.*-commit-.*)", r"\1", jobname
)
outfile = os.path.join(
output_dir,
exes_and_args[idx].replace("/", "-")
+ "."
+ torque_submname
+ "."
+ "o"
+ jobId,
)
outfile_name = exes_and_args[idx].replace("/", "-") + "." + torque_submname
outfile_name = outfile_name[:200] # truncate excessively long file names
outfile = os.path.join(output_dir, outfile_name + "." + "o" + jobId)

else:
all_outfiles = [
os.path.join(output_dir, f)
Expand Down
26 changes: 4 additions & 22 deletions util/job_launching/job_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,28 +444,10 @@ def millify(n):
torquefile_base = re.sub(
r".*\.([^\s]*-commit-.*-commit-.*)", r"\1", jobname
)
errfile = os.path.join(
output_dir,
os.path.basename(app)
+ "-"
+ args
+ "."
+ torquefile_base
+ "."
+ "e"
+ jobId,
)
outfile = os.path.join(
output_dir,
os.path.basename(app)
+ "-"
+ args
+ "."
+ torquefile_base
+ "."
+ "o"
+ jobId,
)
common_name = os.path.basename(app) + "-" + args + "." + torquefile_base
common_name = common_name[:200] # truncate excessively long names
errfile = os.path.join(output_dir, common_name + "." + "e" + jobId)
outfile = os.path.join(output_dir, common_name + "." + "o" + jobId)

status_string = ""
additional_stats = ""
Expand Down
35 changes: 17 additions & 18 deletions util/job_launching/run_simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,24 +353,23 @@ def text_replace_torque_sim(
queue_name = os.getenv("TORQUE_QUEUE_NAME")

# do the text replacement for the .sim file
replacement_dict = {
"NAME": benchmark
+ "-"
+ self.benchmark_args_subdirs[command_line_args]
+ "."
+ gpgpusim_build_handle,
"NODES": "1",
"GPGPUSIM_ROOT": os.getenv("GPGPUSIM_ROOT"),
"LIBPATH": libpath,
"SUBDIR": this_run_dir,
"OPENCL_REMOTE_GPU_HOST": os.getenv("OPENCL_REMOTE_GPU_HOST"),
"BENCHMARK_SPECIFIC_COMMAND": benchmark_command_line,
"PATH": os.getenv("PATH"),
"EXEC_NAME": exec_name,
"QUEUE_NAME": queue_name,
"COMMAND_LINE": txt_args,
"MEM_USAGE": mem_usage,
}
sim_name = benchmark + "-" + self.benchmark_args_subdirs[command_line_args] + "." +\
gpgpusim_build_handle
# Truncate long simulation file names
sim_name = sim_name[:200]
replacement_dict = {"NAME":sim_name,
"NODES":"1",
"GPGPUSIM_ROOT":os.getenv("GPGPUSIM_ROOT"),
"LIBPATH": libpath,
"SUBDIR":this_run_dir,
"OPENCL_REMOTE_GPU_HOST":os.getenv("OPENCL_REMOTE_GPU_HOST"),
"BENCHMARK_SPECIFIC_COMMAND":benchmark_command_line,
"PATH":os.getenv("PATH"),
"EXEC_NAME":exec_name,
"QUEUE_NAME":queue_name,
"COMMAND_LINE":txt_args,
"MEM_USAGE": mem_usage
}
torque_text = open(this_directory + job_template).read().strip()
for entry in replacement_dict:
torque_text = re.sub(
Expand Down

0 comments on commit 76dfd0b

Please sign in to comment.