Module: CodeRunner::Iridis
- Includes:
- Moab
- Defined in:
- lib/coderunner/system_modules/iridis.rb
Instance Method Summary
collapse
Methods included from Moab
#batch_script_file, #cancel_job, #error_file, #get_run_status, #hours_minutes_seconds, #nodes, #nprocstot, #output_file, #ppn, #ppn_checks, #queue_status, #run_command
Instance Method Details
#batch_script ⇒ Object
5
6
7
8
|
# File 'lib/coderunner/system_modules/iridis.rb', line 5
def batch_script
raise "Please specify project" unless @project
super
end
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/coderunner/system_modules/iridis.rb', line 15
def execute
if ((prefix = ENV['CODE_RUNNER_LAUNCHER']).size > 0 rescue false)
launch_id = "#{Time.now.to_i}#{$$}"
fname = ENV['HOME'] + "/.coderunner_to_launch_#{prefix}/#{launch_id}"
File.open(fname + '.start', 'w'){|file| file.puts "cd #{Dir.pwd};#{run_command}"}
sleep 1 until FileTest.exist? fname + '.pid'
pid = File.read(fname + '.pid').to_i
FileUtils.rm fname + '.pid'
return pid
else
File.open(batch_script_file, 'w'){|file| file.puts batch_script + run_command + "\n"}
pid = %x[qsub -q #@project #{batch_script_file}].to_i
end
end
|
9
10
11
|
# File 'lib/coderunner/system_modules/iridis.rb', line 9
def max_ppn
12
end
|
12
13
14
|
# File 'lib/coderunner/system_modules/iridis.rb', line 12
def mpi_prog
"mpirun -np #{nprocstot}"
end
|