#!/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 < [options] -h--help Print this help -d--done Done jobs only -e--error Error jobs only -a--aborted SLURM aboted jobs -r--running Running jobs only -q--queued Queued jobs only -j--job* Job ids -s--search* Regular expression -t--tail* Show the last lines of the STDERR -p--progress Report progress of job and the dependencies -SBP--sbatch_parameters show sbatch parameters -PERF--procpath_performance show Procpath performance summary -sacct--sacct_peformance show sacct performance summary -bs--batch_system* Batch system to use: auto, lsf, slurm (default is auto-detect) 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? directory = File.dirname(directory) unless File.directory?(directory) require 'rbbt/hpc/slurm' HPC::BATCH_MODULE.follow_job directory, true