Module: CodeRunner::Franklin
- Includes:
- Moab
- Defined in:
- lib/coderunner/system_modules/franklin.rb
Instance Method Summary collapse
Methods included from Moab
#batch_script_file, #cancel_job, configure_environment, #error_file, #execute, #get_run_status, #max_ppn, #mpi_prog, #nprocstot, #output_file, #ppn, #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 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/coderunner/system_modules/franklin.rb', line 6 def batch_script nodes, ppn = @nprocs.split(/x/) eputs "Warning: Underuse of nodes (#{ppn} cores per node instead of 4)" if ppn.to_i < 4 raise "Please specify project" unless @project raise "Error: cores per node cannot excede 4" if ppn.to_i > 4 # raise "Error: project (i.e. budget) not specified" unless @project ppn ||= 4 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 Hector for project #@project..." EOF end |