Module: CodeRunner::Hopper

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

Instance Method Summary collapse

Methods included from Moab

#batch_script_file, #cancel_job, #error_file, #execute, #get_run_status, #hours_minutes_seconds, #mpi_prog, #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_scriptObject



9
10
11
12
13
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
# File 'lib/coderunner/system_modules/hopper.rb', line 9

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
	ppn ||= max_ppn
	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 mppwidth=#{nprocstot}
#PBS -l mppnppn=#{ppn}
#{@wall_mins ? "#PBS -l walltime=#{sprintf("%02d:%02d:%02d", hours, mins, secs)}" : ""}
#{@project ? "#PBS -A #@project" : ""}
       #PBS -q #{@runner.debug ? "debug" : "regular"} 

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

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


EOF

end

#max_ppnObject



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

def max_ppn
	24
end