drake 0.8.2.1.0.12 → 0.8.2.1.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGES.drake +4 -0
  2. data/lib/rake.rb +2 -2
  3. data/lib/rake/parallel.rb +23 -28
  4. metadata +2 -2
data/CHANGES.drake CHANGED
@@ -1,6 +1,10 @@
1
1
 
2
2
  = Drake Changelog
3
3
 
4
+ == Version 0.8.2.1.0.13
5
+
6
+ * Optimized construction of computation tree.
7
+
4
8
  == Version 0.8.2.1.0.12
5
9
 
6
10
  * Handle multiple manual invocations of Task#invoke better.
data/lib/rake.rb CHANGED
@@ -29,7 +29,7 @@
29
29
  # as a library via a require statement, but it can be distributed
30
30
  # independently as an application.
31
31
 
32
- RAKEVERSION = '0.8.2.1.0.12'
32
+ RAKEVERSION = '0.8.2.1.0.13'
33
33
 
34
34
  require 'rbconfig'
35
35
  require 'fileutils'
@@ -582,7 +582,7 @@ module Rake
582
582
  application.parallel_tasks.clear
583
583
  application.parallel_parent_flags.clear
584
584
  base_invoke(*args)
585
- application.invoke_parallel_tasks
585
+ application.invoke_parallel(self.name)
586
586
  }
587
587
  end
588
588
  end
data/lib/rake/parallel.rb CHANGED
@@ -5,25 +5,10 @@ require 'rake/comp_tree/driver'
5
5
 
6
6
  module Rake
7
7
  module TaskManager
8
- # :nodoc:
9
- def invoke_parallel_tasks
10
- parent_names = parallel_tasks.keys.map { |name|
11
- name.to_sym
12
- }
13
-
14
- root_name = "computation_root__#{Process.pid}__#{rand}".to_sym
15
-
8
+ def invoke_parallel(root_task_name) # :nodoc:
16
9
  CompTree::Driver.new(:discard_result => true) { |driver|
17
10
  #
18
- # Define the root computation node.
19
- #
20
- # Top-level tasks are immediate children of the root.
21
- #
22
- driver.define(root_name, *parent_names) {
23
- }
24
-
25
- #
26
- # build the rest of the computation tree from task prereqs
11
+ # Build the computation tree from task prereqs.
27
12
  #
28
13
  parallel_tasks.each_pair { |task_name, cache|
29
14
  task = self[task_name]
@@ -36,19 +21,29 @@ module Rake
36
21
  }
37
22
  }
38
23
 
24
+ root_node = driver.nodes[root_task_name.to_sym]
25
+
39
26
  #
40
- # Mark computation nodes without a function as computed.
41
- #
42
- driver.nodes[root_name].each_downward { |node|
43
- unless node.function
44
- node.result = true
45
- end
46
- }
47
-
48
- #
49
- # launch the computation
27
+ # If there were nothing to do, there would be no root node.
50
28
  #
51
- driver.compute(root_name, :threads => num_threads, :fork => false)
29
+ if root_node
30
+ #
31
+ # Mark computation nodes without a function as computed.
32
+ #
33
+ root_node.each_downward { |node|
34
+ unless node.function
35
+ node.result = true
36
+ end
37
+ }
38
+
39
+ #
40
+ # Launch the computation.
41
+ #
42
+ driver.compute(
43
+ root_node.name,
44
+ :threads => num_threads,
45
+ :fork => false)
46
+ end
52
47
  }
53
48
  end
54
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2.1.0.12
4
+ version: 0.8.2.1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - James M. Lawrence
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-19 00:00:00 -04:00
12
+ date: 2008-09-20 00:00:00 -04:00
13
13
  default_executable: drake
14
14
  dependencies: []
15
15