comp_tree 0.7.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.rdoc +6 -0
- data/MANIFEST +14 -15
- data/README.rdoc +13 -14
- data/Rakefile +1 -1
- data/devel/jumpstart.rb +591 -255
- data/install.rb +1 -2
- data/lib/comp_tree/algorithm.rb +44 -44
- data/lib/comp_tree/comp_tree.rb +55 -0
- data/lib/comp_tree/driver.rb +29 -38
- data/lib/comp_tree/error.rb +40 -6
- data/lib/comp_tree/node.rb +32 -27
- data/lib/comp_tree/queue/queue.rb +1 -0
- data/lib/comp_tree/{queue_old.rb → queue/queue_18.rb} +5 -5
- data/lib/comp_tree/{queue_new.rb → queue/queue_19.rb} +3 -1
- data/lib/comp_tree.rb +22 -75
- data/test/{test_basic.rb → basic_test.rb} +5 -3
- data/test/{test_circular.rb → circular_test.rb} +1 -1
- data/test/{common.rb → comp_tree_test_base.rb} +17 -4
- data/test/{test_drain.rb → drain_test.rb} +5 -6
- data/test/exception_test.rb +117 -0
- data/test/{test_flood.rb → flood_test.rb} +1 -1
- data/test/{test_grind.rb → grind_test.rb} +11 -12
- data/test/readme_test.rb +5 -0
- data/test/{test_sequential.rb → sequential_test.rb} +1 -1
- data/test/{test_throw.rb → throw_test.rb} +1 -1
- metadata +42 -43
- data/devel/jumpstart/lazy_attribute.rb +0 -38
- data/devel/jumpstart/ruby.rb +0 -44
- data/devel/jumpstart/simple_installer.rb +0 -85
- data/lib/comp_tree/queue.rb +0 -1
- data/test/test_exception.rb +0 -84
data/CHANGES.rdoc
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
|
2
2
|
= CompTree ChangeLog
|
3
3
|
|
4
|
+
== Version 1.0.0
|
5
|
+
|
6
|
+
* better errors and error handling
|
7
|
+
* single-threaded compute() now checks exceptions
|
8
|
+
* compute(:root, :threads => 3) option deprecated; use compute(:root, 3)
|
9
|
+
|
4
10
|
== Version 0.7.6
|
5
11
|
|
6
12
|
* Driver#define returns created node
|
data/MANIFEST
CHANGED
@@ -3,24 +3,23 @@ MANIFEST
|
|
3
3
|
README.rdoc
|
4
4
|
Rakefile
|
5
5
|
devel/jumpstart.rb
|
6
|
-
devel/jumpstart/lazy_attribute.rb
|
7
|
-
devel/jumpstart/ruby.rb
|
8
|
-
devel/jumpstart/simple_installer.rb
|
9
6
|
install.rb
|
10
7
|
lib/comp_tree.rb
|
11
8
|
lib/comp_tree/algorithm.rb
|
9
|
+
lib/comp_tree/comp_tree.rb
|
12
10
|
lib/comp_tree/driver.rb
|
13
11
|
lib/comp_tree/error.rb
|
14
12
|
lib/comp_tree/node.rb
|
15
|
-
lib/comp_tree/queue.rb
|
16
|
-
lib/comp_tree/
|
17
|
-
lib/comp_tree/
|
18
|
-
test/
|
19
|
-
test/
|
20
|
-
test/
|
21
|
-
test/
|
22
|
-
test/
|
23
|
-
test/
|
24
|
-
test/
|
25
|
-
test/
|
26
|
-
test/
|
13
|
+
lib/comp_tree/queue/queue.rb
|
14
|
+
lib/comp_tree/queue/queue_18.rb
|
15
|
+
lib/comp_tree/queue/queue_19.rb
|
16
|
+
test/basic_test.rb
|
17
|
+
test/circular_test.rb
|
18
|
+
test/comp_tree_test_base.rb
|
19
|
+
test/drain_test.rb
|
20
|
+
test/exception_test.rb
|
21
|
+
test/flood_test.rb
|
22
|
+
test/grind_test.rb
|
23
|
+
test/readme_test.rb
|
24
|
+
test/sequential_test.rb
|
25
|
+
test/throw_test.rb
|
data/README.rdoc
CHANGED
@@ -3,8 +3,7 @@
|
|
3
3
|
|
4
4
|
== Summary
|
5
5
|
|
6
|
-
|
7
|
-
programming.
|
6
|
+
A simple framework for parallelizing computations.
|
8
7
|
|
9
8
|
== Synopsis
|
10
9
|
|
@@ -33,7 +32,7 @@ programming.
|
|
33
32
|
}
|
34
33
|
|
35
34
|
# Compute the area using four parallel threads.
|
36
|
-
puts driver.compute(:area,
|
35
|
+
puts driver.compute(:area, 4)
|
37
36
|
# => 63
|
38
37
|
|
39
38
|
# We've done this computation.
|
@@ -51,14 +50,15 @@ Or for the (non-gem) .tgz package,
|
|
51
50
|
|
52
51
|
== Description
|
53
52
|
|
54
|
-
CompTree is
|
53
|
+
CompTree is parallel computation tree structure based upon concepts
|
54
|
+
from pure functional programming.
|
55
55
|
|
56
|
-
The user should have a basic understanding of
|
57
|
-
|
58
|
-
|
59
|
-
of <em>side effects</em>.
|
56
|
+
The user should have a basic understanding of functional programming
|
57
|
+
(see for example http://en.wikipedia.org/wiki/Functional_programming)
|
58
|
+
and the meaning of <em>side effects</em>.
|
60
59
|
|
61
|
-
Every function you define must explicitly depend on the data it
|
60
|
+
Every pure function you define must explicitly depend on the data it
|
61
|
+
uses.
|
62
62
|
|
63
63
|
#
|
64
64
|
# BAD example: depending on state -- offset not listed as a parameter
|
@@ -68,8 +68,7 @@ Every function you define must explicitly depend on the data it uses.
|
|
68
68
|
}
|
69
69
|
|
70
70
|
Unless <em>offset</em> is really a constant, the result of
|
71
|
-
<tt>driver.compute(:area,
|
72
|
-
for _n_ > 1.
|
71
|
+
<tt>driver.compute(:area, n)</tt> is not well-defined for _n_ > 1.
|
73
72
|
|
74
73
|
Just as depending on some changeable state is bad, it is likewise bad
|
75
74
|
to affect a state (to produce a <em>side effect</em>).
|
@@ -83,12 +82,12 @@ to affect a state (to produce a <em>side effect</em>).
|
|
83
82
|
}
|
84
83
|
|
85
84
|
Given a tree where nodes are modifying _accumulator_, the end state of
|
86
|
-
_accumulator_ is not well-defined
|
87
|
-
thread-safe
|
85
|
+
_accumulator_ is not well-defined, even if _accumulator_ is a
|
86
|
+
thread-safe object.
|
88
87
|
|
89
88
|
Note however it is OK affect a state as long as <em>no other function
|
90
89
|
depends on that state</em>. This is the principle under which
|
91
|
-
|
90
|
+
CompTree parallelizes Rake tasks (http://drake.rubyforge.org).
|
92
91
|
|
93
92
|
== Links
|
94
93
|
|
data/Rakefile
CHANGED