Sha256: 14f546ab140ef6d0df6ff106a48dc39aaee3f8b1c79a3b0aa3ed9c8dd44eb120

Contents?: true

Size: 1.54 KB

Versions: 3

Compression:

Stored size: 1.54 KB

Contents

#! /usr/bin/env ruby
# coding: utf-8

require "pp"
require "comana"
require "optparse"

options = {}
op = OptionParser.new
op.banner = <<HERE
genqsub [options] [dirs]
Submit queue to grid engine. Empty 'dirs' in argument indicates current directory.
HERE
op.on('--q-name=queue'         , "Queue name for '#$ -q'"){
  |v| options[:q_name] = v}
op.on('--pe-name=pe'     , "Parallel environment name for '\#$ -pe'"){
  |v| options[:pe_name] = v}
op.on('--ppn=ppn'            , "Process per node, 2nd argument for'#$ -pe'"){
  |v| options[:ppn] = v}
op.on('--ld_library_path=path', "Set 'LD_LIBRARY_PATH'"){
  |v| options[:ld_library_path] = v}
op.on('--load-group=group'     , "Load setting from group in setting file."){
  |v| options[:load_group] = v}
#op.on('-no_submit'      , "Write script', ' but not submit."){
#|v| options[:no_submit] = v}
op.on('--auto'           , "Select low load group and automatic setting."){ options[:auto] = true}
op.parse!(ARGV)

if options[:load_group]
  settings = Comana::ClusterSetting.load_file
  gs = settings.groups[options[:load_group]]
  q_name          ||= gs['queue']
  pe_name         ||= gs['pe']         
  ppn             ||= gs['ppn']         
  ld_library_path ||= gs['ld_library_path'] 
end

if ARGV.empty?
  puts "Need command in argument. Exit."
  exit
else
  command = ARGV.join(" ")
end

GridEngine.write_qsub_script(
  q_name:          q_name          ,
  pe_name:         pe_name         ,
  ppn:             ppn             ,
  command:         command         ,
  ld_library_path: ld_library_path ,
  io: $stdout
)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
comana-0.1.3 bin/genqsub
comana-0.1.2 bin/genqsub
comana-0.1.1 bin/genqsub