lib/coderunner/system_modules/archer.rb in coderunner-0.14.17 vs lib/coderunner/system_modules/archer.rb in coderunner-0.14.18

- old
+ new

@@ -30,7 +30,36 @@ end def mpi_prog "aprun -n #{ppn*nodes}" end +def get_run_status(job_no, current_status) + if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false) + if current_status =~ Regexp.new(job_no.to_s) + @running = true + return :Running + else + @running = false + return :Unknown + end + end + line = current_status.split(/\n/).grep(Regexp.new(job_no.to_s))[0] + unless line + return :Unknown + else + if line =~ /\sQ\s/ + return :Queueing + elsif line =~ /\sR\s/ + return :Running + elsif line =~ /\sH\s/ + return :Queueing + elsif line =~ /\s[CE]\s/ + @running=false + return :Unknown + else + ep 'line', line + raise 'Could not get run status' + end + end +end end end