Skip to content

Commit af2b442

Browse files
committed
replace @Assert with more informative error message
1 parent 4612325 commit af2b442

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/slurmmanager.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ struct SlurmManager <: ClusterManager
1111
launch_timeout::Float64
1212

1313
function SlurmManager(;verbose=false, launch_timeout=60.0)
14-
@assert "SLURM_JOBID" in keys(ENV)
15-
@assert "SLURM_NTASKS" in keys(ENV)
14+
if !("SLURM_JOBID" in keys(ENV) && "SLURM_NTASKS" in keys(ENV))
15+
throw(ErrorException("SlurmManager must be constructed inside a slurm allocation environemnt. SLURM_JOBID and SLURM_NTASKS must be defined."))
16+
end
1617

1718
jobid = parse(Int, ENV["SLURM_JOBID"])
1819
ntasks = parse(Int, ENV["SLURM_NTASKS"])

0 commit comments

Comments
 (0)