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
Methods included from Launcher
#cancel_job_launcher, #error_file_launcher, #execute_launcher, #launcher_prefix, #output_file_launcher, #queue_status_launcher, #use_launcher
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
27
|
# 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
"#!/bin/bash --login \n#PBS -N \#{executable_name}.\#{job_identifier}\n#PBS -l select=\#{nodes}\n#PBS -l walltime=\#{sprintf(\"%02d:%02d:%02d\", hours, mins, secs)}\n\#{@project ? \"#PBS -A \#@project\" : \"\"}\n\#{@queue ? \"#PBS -q \#@queue\" : \"\"}\n\n### start of jobscript \ncd $PBS_O_WORKDIR \necho \"workdir: $PBS_O_WORKDIR\" \n\#{code_run_environment}\n\necho \"Submitting \#{nodes}x\#{ppn} job on \#{CodeRunner::SYS} for project \#@project...\"\n"
end
|
#get_run_status(job_no, current_status) ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/coderunner/system_modules/archer.rb', line 36
def get_run_status(job_no, current_status)
if use_launcher
return :Unknown
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
|
29
30
31
|
# File 'lib/coderunner/system_modules/archer.rb', line 29
def max_ppn
24
end
|
33
34
35
|
# File 'lib/coderunner/system_modules/archer.rb', line 33
def mpi_prog
"aprun -n #{ppn*nodes}"
end
|