Sha256: e735cdc1f49434d6b240335dd5dc4a8807351c31731f9b9074b0c1f637fa5604

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

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

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

## option analysis
OPTIONS = {}
op = OptionParser.new
op.banner = [
  "Usage: #{File.basename("#{__FILE__}")} [options] host_series command",
].join("\n")
op.on("-s"   , "--submit"    , "Submit at the same time."){OPTIONS[:submit] = true}
op.on("-o file", "--outfile=file", "Output in file."){|v| OPTIONS[:outfile] = v}
op.parse!(ARGV)

io = STDOUT
io = File.open( OPTIONS[:outfile], "w") if OPTIONS[:outfile]

series = ARGV.shift

cluster_setting = Comana::ClusterSetting.load_file
settings =  cluster_setting.groups[series]

unless settings
  puts "Not found '#{series}' in #{cluster_setting.data_file}"
  puts op.banner
  exit
end
ppn = settings["ppn"]

command = ARGV.join(' ')

GridEngineScript.generate(io, series, ppn, command)
io.close

if OPTIONS[:submit]
    unless OPTIONS[:outfile]
        puts "'--submit' option must use with '--outfile' option."
        exit
    end

    GridEngineScript.write_submit(series, ppn, command, OPTIONS[:outfile])
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
comana-0.1.0 bin/genqsub