Module: CodeRunner::Archer
- Includes:
- Moab
- Defined in:
- lib/coderunner/system_modules/archer.rb
Instance Method Summary
collapse
Methods included from Moab
#batch_script_file, #cancel_job, #error_file, #execute, #hours_minutes_seconds, #nodes, #nprocstot, #output_file, #ppn, #ppn_checks, #queue_status, #run_command
Instance Method Details
#batch_script ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/coderunner/system_modules/archer.rb', line 6
def batch_script
raise "Please specify project" unless @project
(eputs "Warning: number of wall mins is not recommended (20, 60, 180, 360, 720 recomended)"; sleep 0.2) unless [20, 60, 180, 360, 720].include? @wall_mins.to_i
ppn_checks
hours, mins, secs = hours_minutes_seconds
<<EOF
#!/bin/bash --login
#PBS -N #{executable_name}.#{job_identifier}
#PBS -l select=#{nodes}
#PBS -l walltime=#{sprintf("%02d:%02d:%02d", hours, mins, secs)}
#{@project ? "#PBS -A #@project" : ""}
### start of jobscript
cd $PBS_O_WORKDIR
echo "workdir: $PBS_O_WORKDIR"
#{code_run_environment}
echo "Submitting #{nodes}x#{ppn} job on #{CodeRunner::SYS} for project #@project..."
EOF
end
|
#get_run_status(job_no, current_status) ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/coderunner/system_modules/archer.rb', line 35
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
|
28
29
30
|
# File 'lib/coderunner/system_modules/archer.rb', line 28
def max_ppn
24
end
|
32
33
34
|
# File 'lib/coderunner/system_modules/archer.rb', line 32
def mpi_prog
"aprun -n #{ppn*nodes}"
end
|