def qsub_submit(script, queue, headers, resources, envvars)
        params  = []
        params += ["-q", "#{queue}"] unless queue.empty?
        params += headers.map {|k,v| qsub_arg(k,v)}.flatten
        params += resources.map{|k,v| ["-l", "#{k}=#{v}"]}.flatten
        params += ["-v", envvars.map{|k,v| "#{k}=#{v}"}.join(",")] unless envvars.empty?
        params << script

        env = {
          "PBS_DEFAULT"     => "#{host}",
          "LD_LIBRARY_PATH" => "#{lib}:#{ENV['LD_LIBRARY_PATH']}"
        }
        cmd = bin.join("qsub").to_s
        o, e, s = Open3.capture3(env, cmd, *params)
        raise PBS::Error, e unless s.success?
        o.chomp
      end
def qsub_submit(script, queue, headers, resources, envvars)
        params  = []
        params += ["-q", "#{queue}"] unless queue.empty?
        params += headers.map {|k,v| qsub_arg(k,v)}.flatten
        params += resources.map{|k,v| ["-l", "#{k}=#{v}"]}.flatten
        params += ["-v", envvars.map{|k,v| "#{k}=#{v}"}.join(",")] unless envvars.empty?
        params << script

        env = {
          "PBS_DEFAULT"     => "#{host}",
          "LD_LIBRARY_PATH" => "#{lib}:#{ENV['LD_LIBRARY_PATH']}"
        }
        cmd = bin.join("qsub").to_s
        o, e, s = Open3.capture3(env, cmd, *params)
        raise PBS::Error, e unless s.success?
        o.chomp
      end
Submit a script using Torque binary
 NB: The binary includes many useful filters and is preferred