rbbt-util 5.30.4 → 5.30.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d45adac7949e3fea0d710418d93837cf0aa715bcedb2212c6e68f8dd749382ae
4
- data.tar.gz: 9a9857c6b1565b9ed55f18f50fb1b242a1477dd6868111e10252ecc0c286ca44
3
+ metadata.gz: aa5b1545b1a92199d163bf398ca973c6aa3d78ab37cc724b988e007c87824b3b
4
+ data.tar.gz: 6cd3ce80ea589fb97a211ebe1d2973dd7c0d3f93b1ccefe10b9ecefbc77ff515
5
5
  SHA512:
6
- metadata.gz: 9dac4b1211fd40894f00b1a84f4f10abad83f2169579ec327a8da86f05b4274cc11e2192902638eb78b9de8f39351993f17a3b08dd5390a0f2c04ef385a0e1a2
7
- data.tar.gz: 01b9d69b003088e78f2665b57e9ed8acc8104143bc826aabe49059e77fd0e20279d9393245f7bb20efcab807180273f31d2285a62113947cf151571a96f2d949
6
+ metadata.gz: d8246d2a2686cc38086800fb6c30949bba93c8e78b7feac220b710a4e80f66858f979c5ea41de0beb67aeefd29de045e2315c3b50128f448bfef521ce3d52e15
7
+ data.tar.gz: 26559322cae3bfb736565e8da0c7e63c3b006c793ab5cda8ec37a04fabfa460001bae6d7da8164ccd310730b81553d1d3b5a1d14cee9e6929793329ce508ec59
@@ -5,7 +5,10 @@ module HPC
5
5
  def self.job_rules(rules, job)
6
6
  workflow = job.workflow.to_s
7
7
  task_name = job.task_name.to_s
8
+ task_name = job.overriden.to_s if Symbol === job.overriden
9
+
8
10
  defaults = rules["defaults"] || {}
11
+ defaults.merge(rules[workflow]["defaults"] || {}) if rules[workflow]
9
12
 
10
13
  job_rules = IndiferentHash.setup(defaults.dup)
11
14
 
@@ -21,10 +21,10 @@ module HPC
21
21
  exclusive = options.delete :exclusive
22
22
  highmem = options.delete :highmem
23
23
 
24
- queue = options.delete(:queue) || 'bsc_ls'
24
+ queue = options.delete(:queue) || Rbbt::Config.get('queue', :slurm_queue, :slurm, :SLURM, :default => 'bsc_ls')
25
25
  task_cpus = options.delete(:task_cpus) || 1
26
26
  nodes = options.delete(:nodes) || 1
27
- time = options.delete(:time) || "0:00:10"
27
+ time = options.delete(:time) || "0:02:00"
28
28
 
29
29
  inputs_dir = options.delete :inputs_dir
30
30
  config_keys = options.delete :config_keys
@@ -301,11 +301,15 @@ EOF
301
301
  coda +=<<-EOF
302
302
 
303
303
  # Sync data to target location
304
- mkdir -p "$(dirname '#{target}')"
305
- rsync -avztAXHP --copy-unsafe-links "#{source}/" "#{target}/" &>> #{fsync}
306
- sync_es="$?"
307
- echo $sync_es > #{fsyncexit}
308
- find '#{target}' -type l -ls | awk '$13 ~ /^#{target.gsub('/','\/')}/ { sub("#{source}", "#{target}", $13); print $11, $13 }' | while read A B; do rm $A; ln -s $B $A; done
304
+ if [ $exit_status == '0' ]; then
305
+ mkdir -p "$(dirname '#{target}')"
306
+ rsync -avztAXHP --copy-unsafe-links "#{source}/" "#{target}/" &>> #{fsync}
307
+ sync_es="$?"
308
+ echo $sync_es > #{fsyncexit}
309
+ find '#{target}' -type l -ls | awk '$13 ~ /^#{target.gsub('/','\/')}/ { sub("#{source}", "#{target}", $13); print $11, $13 }' | while read A B; do rm $A; ln -s $B $A; done
310
+ else
311
+ sync_es="$exit_status"
312
+ fi
309
313
  EOF
310
314
 
311
315
  if contain && (wipe_container == "post" || wipe_container == "both")
@@ -331,11 +335,11 @@ EOF
331
335
  else
332
336
  coda +=<<-EOF
333
337
  ##{exec_cmd} system clean
334
- if [ $exit_status == '0' -a $sync_es == '0' ]; then
338
+ #if [ $exit_status == '0' -a $sync_es == '0' ]; then
335
339
  rm -Rfv #{contain} &>> #{fsync}
336
- else
337
- echo "ERROR: Process failed or results could not sync correctly. Contain directory not purged" &>> #{fsync}
338
- fi
340
+ #else
341
+ # echo "ERROR: Process failed or results could not sync correctly. Contain directory not purged" &>> #{fsync}
342
+ #fi
339
343
  EOF
340
344
 
341
345
  end
@@ -748,7 +748,9 @@ module Open
748
748
  if (dir_sub_path = find_repo_dir(path))
749
749
  writable_repo?(*dir_sub_path)
750
750
  else
751
- if File.exist?(path)
751
+ if File.symlink?(path)
752
+ File.writable?(File.dirname(path))
753
+ elsif File.exist?(path)
752
754
  File.writable?(path)
753
755
  else
754
756
  File.writable?(File.dirname(File.expand_path(path)))
@@ -53,7 +53,11 @@ module Workflow
53
53
  if file =~ /\.yaml/
54
54
  inputs[input.to_sym] = YAML.load(Open.read(file))
55
55
  else
56
- inputs[input.to_sym] = Open.realpath(file)
56
+ if File.symlink?(file)
57
+ inputs[input.to_sym] = File.readlink(file)
58
+ else
59
+ inputs[input.to_sym] = Open.realpath(file)
60
+ end
57
61
  end
58
62
  when :text
59
63
  Log.debug "Reading #{ input } from #{file}"
@@ -133,7 +133,7 @@ workdir.glob("**/command.slurm").sort_by{|f| File.mtime(f)}.each do |fcmd|
133
133
  select = true if queued && deps && (running_jobs & deps).any? || queued && is_running && nodes.empty?
134
134
  select = true if running && nodes.any? && (exit_status.nil? && running_jobs.include?(id)) && (!deps || (running_jobs & deps).empty?)
135
135
  select = true if jobid && jobid.split(",").include?(id)
136
- select &= search && cmd.match(/#{search}/) if search
136
+ select = select && cmd.match(/#{search}/) if search
137
137
  next unless select
138
138
  elsif search
139
139
  select = false
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.30.4
4
+ version: 5.30.5
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-02-04 00:00:00.000000000 Z
11
+ date: 2021-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake