Sha256: 76bd6d2f00abb2022d654ef88d832f598beed699a5a62c21741ea4eba3501ced

Contents?: true

Size: 844 Bytes

Versions: 289

Compression:

Stored size: 844 Bytes

Contents

class Step
  def self.prepare_dependencies(jobs, tasks, cpus)
    deps = []

    jobs = [jobs] unless Array === jobs
    tasks = [tasks] unless Array === tasks
    tasks = tasks.collect{|t| t.to_s}

    jobs.each do |job|
      job.rec_dependencies.each do |dep|
        next if dep.done?
        dep.clean if dep.error? && dep.recoverable_error?
        deps << dep if tasks.include?(dep.task_name.to_s) or tasks.include?([dep.workflow.to_s, dep.task_name] * "#")
      end
    end

    cpus = jobs.length if cpus.to_s == "max"
    cpus = cpus.to_i if String === cpus
    TSV.traverse deps.collect{|dep| dep.path}, :type => :array, :cpus => cpus, :bar => "Prepare dependencies #{Misc.fingerprint tasks} for #{Misc.fingerprint jobs}" do |path|
      dep = deps.select{|dep| dep.path == path}.first
      dep.produce
      nil
    end
  end
end

Version data entries

289 entries across 289 versions & 1 rubygems

Version Path
rbbt-util-5.35.4 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.35.3 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.35.2 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.35.1 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.27 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.26 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.25 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.24 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.23 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.22 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.21 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.20 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.18 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.17 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.16 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.15 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.14 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.13 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.12 lib/rbbt/workflow/step/prepare.rb
rbbt-util-5.34.11 lib/rbbt/workflow/step/prepare.rb