Sha256: 8fba58293fe5f40848e5ff692288b88d4ad81956f75b4455a76ac93e4ef7a19a
Contents?: true
Size: 1.39 KB
Versions: 57
Compression:
Stored size: 1.39 KB
Contents
#!/usr/bin/env ruby require 'rbbt-util' require 'rbbt/util/simpleopt' require 'rbbt/hpc' #$0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands options = SOPT.setup <<EOF Queue a job in Marenostrum $ rbbt slurm tail <directory|jobid> [options] -h--help Print this help EOF if options[:help] if defined? rbbt_usage rbbt_usage else puts SOPT.doc end exit 0 end batch_system = options.delete :batch_system batch_system ||= 'auto' HPC::BATCH_MODULE = HPC.batch_system batch_system raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil? directory = ARGV.shift raise ParameterException if directory.nil? if directory =~ /^[0-9]*$/ workdir = File.expand_path('~/rbbt-batch') Path.setup(workdir) workdir.glob("**/job.id").each do |file| next unless directory == Open.read(file).strip directory = File.dirname(file) break end end raise ParameterException, "Could not identify job #{directory}" unless File.exists?(directory) require 'rbbt/hpc/slurm' command_txt = Open.read(File.join(directory, 'command.batch')) if m = command_txt.match(/#STEP_PATH: (.*)/) step_path = m[1] else step_path = nil end puts Log.color(:magenta, "Directory: ") + directory if directory puts Log.color(:magenta, "Step path: ") + step_path if step_path HPC::BATCH_MODULE.follow_job directory, true
Version data entries
57 entries across 19 versions & 1 rubygems