Module: CodeRunner::Loki

Includes:
Moab
Defined in:
lib/coderunner/system_modules/loki.rb

Instance Method Summary collapse

Methods included from Moab

#batch_script_file, #cancel_job, #error_file, #execute, #get_run_status, #hours_minutes_seconds, #nodes, #nprocstot, #output_file, #ppn, #ppn_checks, #queue_status, #run_command

Instance Method Details

#batch_scriptObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/coderunner/system_modules/loki.rb', line 14

def batch_script
	nodes, ppn = @nprocs.split(/x/)
         eputs "Warning: Underuse of nodes (#{ppn} cores per node instead of #{max_ppn})" if ppn.to_i < max_ppn
#		raise "Please specify project" unless @project
               raise "Error: cores per node cannot excede #{max_ppn}" if ppn.to_i > max_ppn
#		raise "Error: project (i.e. budget) not specified" unless @project
	if @wall_mins
		ep @wall_mins
		hours = (@wall_mins / 60).floor
		mins = @wall_mins.to_i % 60
		secs = ((@wall_mins - @wall_mins.to_i) * 60).to_i
	end
	eputs "Allotted wall time is " + sprintf("%02d:%02d:%02d", hours, mins, secs)
	nprocstot = nodes.to_i * ppn.to_i
<<EOF
#!/bin/bash --login 
#PBS -N #{executable_name}.#{job_identifier}
#PBS -l nodes=#{nodes}:ppn=#{ppn}
#{@wall_mins ? "#PBS -l walltime=#{sprintf("%02d:%02d:%02d", hours, mins, secs)}" : ""}
#{@project ? "#PBS -A #@project" : ""}
       #PBS -q #{@runner.debug ? "debug" : "default"} 

### start of jobscript 
cd $PBS_O_WORKDIR 
echo "workdir: $PBS_O_WORKDIR" 

echo "Submitting #{nodes}x#{ppn} job on Loki for project #@project..."


EOF

end

#max_ppnObject



6
7
8
# File 'lib/coderunner/system_modules/loki.rb', line 6

def max_ppn
	8
end

#mpi_progObject



10
11
12
# File 'lib/coderunner/system_modules/loki.rb', line 10

def mpi_prog
	"mpiexec -n #{nprocstot}"
end