Skip to content

Commit

Permalink
Condense output flag check
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Bonham <[email protected]>
  • Loading branch information
cnrrobertson and kescobo authored Dec 19, 2023
1 parent ffdd867 commit 8f1dee9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/slurm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ function launch(manager::SlurmManager, params::Dict, instances_arr::Array,
jobname = "julia-$(getpid())"
has_output_name = ("-o" in srunargs) | ("--output" in srunargs)
if has_output_name
loc = findfirst(x-> x == "-o", srunargs)
if isnothing(loc)
loc = findfirst(x-> x == "--output", srunargs)
end
loc = findfirst(x-> x == "-o" || x == "--output", srunargs)
job_output_name = srunargs[loc+1]
job_output_template = joinpath(job_file_loc, job_output_name)
srunargs[loc+1] = job_output_template
Expand Down

0 comments on commit 8f1dee9

Please sign in to comment.