From 8f1dee92f8e36cc82d5890abb868456acd1f32c8 Mon Sep 17 00:00:00 2001 From: Connor Robertson Date: Tue, 19 Dec 2023 13:25:50 -0800 Subject: [PATCH] Condense output flag check Co-authored-by: Kevin Bonham --- src/slurm.jl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/slurm.jl b/src/slurm.jl index 97ac6bf..90fb873 100644 --- a/src/slurm.jl +++ b/src/slurm.jl @@ -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