#!/usr/bin/env ruby require 'rbbt/util/simpleopt' require 'rbbt/workflow' require 'rbbt/workflow/usage' require 'rbbt/hpc' require 'time' $slurm_options = SOPT.get <<EOF -dr--dry_run Print only the template -cj--clean_job Clean job --drbbt* Use development version of rbbt -sing--singularity Use Singularity -si--singularity_img* Singularity image to use -ug--user_group* Use alternative user group for group project directory -c--contain* Contain in directory (using Singularity) -s--sync* Contain in directory and sync jobs -e--exclusive Make exclusive use of the node -hm--highmem Make use of highmem cores -wc--wipe_container* Wipe the jobs from the contain directory -pd--purge_deps Purge job dependencies -CS--contain_and_sync Contain and sync to default locations -ci--copy_image When using a container directory, copy image there -t--tail Tail the logs -BPP--batch_procpath* Save Procpath performance for batch job; specify only options -q--queue* Queue -t--task_cpus* Tasks -tm--time* Time -m--mem* SLURM minimum memory -mcpu--mem_per_cpu* SLURM minimum memory per CPU -lin--licenses* SLURM licenses -cons--constraint* SLURM constraint -W--workflows* Additional workflows -rmb--remove_batch_dir Remove the batch working directory (command, STDIN, exit status, ...) -bs--batch_system* Batch system to use: auto, lsf, slurm (default is auto-detect) EOF batch_system = $slurm_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? class Step def run(*args) if done? self.load else begin Log.debug "Issuing SLURM job for #{self.path}" HPC::BATCH_MODULE.run_job(self, SOPT::GOT_OPTIONS.merge($slurm_options)) rescue HPC::SBATCH end end end end ARGV.concat ["-W", $slurm_options[:workflows]] if $slurm_options[:workflows] load Rbbt.share.rbbt_commands.workflow.task.find