Sha256: 445ec2789048e6b5db6ee91bc5fc67aee41adf57097d8691cb90d8f58be9aa86
Contents?: true
Size: 855 Bytes
Versions: 154
Compression:
Stored size: 855 Bytes
Contents
class CodeRunner require SCRIPT_FOLDER + '/system_modules/moab.rb' module Iridis include Moab def batch_script raise "Please specify project" unless @project super end def max_ppn 12 end def mpi_prog "mpirun -np #{nprocstot}" end 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 end end
Version data entries
154 entries across 154 versions & 1 rubygems