rbbt-util 5.32.7 → 5.32.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rbbt/util/simpleopt'
4
+ require 'rbbt/workflow'
5
+ require 'rbbt/workflow/usage'
6
+ require 'rbbt/hpc'
7
+ require 'rbbt/hpc/orchestrate'
8
+ require 'time'
9
+
10
+ $slurm_options = SOPT.get <<EOF
11
+ -dr--dry_run Print only the template
12
+ -cj--clean_job Clean job
13
+ --drbbt* Use development version of rbbt
14
+ -sing--singularity Use Singularity
15
+ -si--singularity_img* Singularity image to use
16
+ -ug--user_group* Use alternative user group for group project directory
17
+ -c--contain* Contain in directory (using Singularity)
18
+ -s--sync* Contain in directory and sync jobs
19
+ -e--exclusive Make exclusive use of the node
20
+ -hm--highmem Make use of highmem cores
21
+ -wc--wipe_container* Wipe the jobs from the contain directory
22
+ -CS--contain_and_sync Contain and sync to default locations
23
+ -ci--copy_image When using a container directory, copy image there
24
+ -t--tail Tail the logs
25
+ -BPP--batch_procpath* Save Procpath performance for batch job; specify only options
26
+ -q--queue* Queue
27
+ -t--task_cpus* Tasks
28
+ -W--workflows* Additional workflows
29
+ -tm--time* Time
30
+ -OR--orchestration_rules* Orchestration rules
31
+ -rmb--remove_batch_basedir Remove the SLURM working directory (command, STDIN, exit status, ...)
32
+ EOF
33
+
34
+ batch_system = $slurm_options.delete :batch_system
35
+ batch_system ||= 'auto'
36
+
37
+ HPC::BATCH_MODULE = HPC.batch_system batch_system
38
+
39
+ raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
40
+
41
+ class Step
42
+ def run(*args)
43
+ if done?
44
+ self.load
45
+ else
46
+ begin
47
+ Log.debug "Issuing SLURM job for #{self.path}"
48
+ HPC::BATCH_MODULE.orchestrate_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
49
+ rescue HPC::SBATCH
50
+ end
51
+ end
52
+ end
53
+ end
54
+
55
+ ARGV.concat ["-W", $slurm_options[:workflows], '--detach'] if $slurm_options[:workflows]
56
+ load Rbbt.share.rbbt_commands.workflow.task.find
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rbbt-util'
4
+ require 'rbbt/util/simpleopt'
5
+ require 'rbbt/hpc'
6
+
7
+ #$0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands
8
+
9
+ options = SOPT.setup <<EOF
10
+
11
+ Queue a job in Marenostrum
12
+
13
+ $ rbbt slurm tail <directory> [options]
14
+
15
+ -h--help Print this help
16
+ -d--done Done jobs only
17
+ -e--error Error jobs only
18
+ -a--aborted SLURM aboted jobs
19
+ -r--running Running jobs only
20
+ -q--queued Queued jobs only
21
+ -j--job* Job ids
22
+ -s--search* Regular expression
23
+ -t--tail* Show the last lines of the STDERR
24
+ -p--progress Report progress of job and the dependencies
25
+ -SBP--sbatch_parameters show sbatch parameters
26
+ -PERF--procpath_performance show Procpath performance summary
27
+ -sacct--sacct_peformance show sacct performance summary
28
+ -bs--batch_system* Batch system to use: auto, lsf, slurm (default is auto-detect)
29
+ EOF
30
+
31
+ if options[:help]
32
+ if defined? rbbt_usage
33
+ rbbt_usage
34
+ else
35
+ puts SOPT.doc
36
+ end
37
+ exit 0
38
+ end
39
+
40
+ batch_system = options.delete :batch_system
41
+ batch_system ||= 'auto'
42
+
43
+ HPC::BATCH_MODULE = HPC.batch_system batch_system
44
+
45
+ raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
46
+
47
+ directory = ARGV.shift
48
+
49
+ raise ParameterException if directory.nil?
50
+
51
+ directory = File.dirname(directory) unless File.directory?(directory)
52
+
53
+ require 'rbbt/hpc/slurm'
54
+
55
+ HPC::BATCH_MODULE.follow_job directory, true
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rbbt/util/simpleopt'
4
+ require 'rbbt/workflow'
5
+ require 'rbbt/workflow/usage'
6
+ require 'rbbt/hpc'
7
+ require 'time'
8
+
9
+ $slurm_options = SOPT.get <<EOF
10
+ -dr--dry_run Print only the template
11
+ -cj--clean_job Clean job
12
+ --drbbt* Use development version of rbbt
13
+ -sing--singularity Use Singularity
14
+ -si--singularity_img* Singularity image to use
15
+ -ug--user_group* Use alternative user group for group project directory
16
+ -c--contain* Contain in directory (using Singularity)
17
+ -s--sync* Contain in directory and sync jobs
18
+ -e--exclusive Make exclusive use of the node
19
+ -hm--highmem Make use of highmem cores
20
+ -wc--wipe_container* Wipe the jobs from the contain directory
21
+ -CS--contain_and_sync Contain and sync to default locations
22
+ -ci--copy_image When using a container directory, copy image there
23
+ -t--tail Tail the logs
24
+ -BPP--batch_procpath* Save Procpath performance for batch job; specify only options
25
+ -q--queue* Queue
26
+ -t--task_cpus* Tasks
27
+ -W--workflows* Additional workflows
28
+ -tm--time* Time
29
+ -rmb--remove_batch_dir Remove the batch working directory (command, STDIN, exit status, ...)
30
+ -bs--batch_system* Batch system to use: auto, lsf, slurm (default is auto-detect)
31
+ EOF
32
+
33
+ batch_system = $slurm_options.delete :batch_system
34
+ batch_system ||= 'auto'
35
+
36
+ HPC::BATCH_MODULE = HPC.batch_system batch_system
37
+
38
+ raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
39
+
40
+ class Step
41
+ def run(*args)
42
+ if done?
43
+ self.load
44
+ else
45
+ begin
46
+ Log.debug "Issuing SLURM job for #{self.path}"
47
+ HPC::BATCH_MODULE.run_job(self, SOPT::GOT_OPTIONS.merge($slurm_options))
48
+ rescue HPC::SBATCH
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ ARGV.concat ["-W", $slurm_options[:workflows]] if $slurm_options[:workflows]
55
+ load Rbbt.share.rbbt_commands.workflow.task.find
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.32.7
4
+ version: 5.32.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-30 00:00:00.000000000 Z
11
+ date: 2021-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -165,7 +165,7 @@ dependencies:
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  description: Utilities for handling tsv files, caches, etc
168
- email: miguel.vazquez@cnio.es
168
+ email: miguel.vazquez.g@bsc.es
169
169
  executables:
170
170
  - rbbt_query.rb
171
171
  - rbbt_exec.rb
@@ -378,6 +378,11 @@ files:
378
378
  - share/rbbt_commands/hpc/tail
379
379
  - share/rbbt_commands/hpc/task
380
380
  - share/rbbt_commands/log
381
+ - share/rbbt_commands/lsf/clean
382
+ - share/rbbt_commands/lsf/list
383
+ - share/rbbt_commands/lsf/orchestrate
384
+ - share/rbbt_commands/lsf/tail
385
+ - share/rbbt_commands/lsf/task
381
386
  - share/rbbt_commands/migrate
382
387
  - share/rbbt_commands/migrate_job
383
388
  - share/rbbt_commands/purge_job
@@ -387,6 +392,11 @@ files:
387
392
  - share/rbbt_commands/resource/produce
388
393
  - share/rbbt_commands/resource/read
389
394
  - share/rbbt_commands/rsync
395
+ - share/rbbt_commands/slurm/clean
396
+ - share/rbbt_commands/slurm/list
397
+ - share/rbbt_commands/slurm/orchestrate
398
+ - share/rbbt_commands/slurm/tail
399
+ - share/rbbt_commands/slurm/task
390
400
  - share/rbbt_commands/stat/abs
391
401
  - share/rbbt_commands/stat/boxplot
392
402
  - share/rbbt_commands/stat/compare_lists