Sha256: 22f1fe438636fcc5bbc51b84c36face17761cb771d37dd32cea67192b1bdeca4

Contents?: true

Size: 844 Bytes

Versions: 26

Compression:

Stored size: 844 Bytes

Contents

class Step
  def self.produce_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

26 entries across 26 versions & 1 rubygems

Version Path
rbbt-util-5.43.0 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.42.0 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.41.1 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.41.0 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.40.5 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.40.4 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.40.3 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.40.0 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.39.0 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.38.1 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.38.0 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.37.16 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.37.15 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.37.14 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.37.13 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.37.12 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.37.11 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.37.10 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.37.9 lib/rbbt/workflow/step/produce.rb
rbbt-util-5.37.8 lib/rbbt/workflow/step/produce.rb