comp_tree 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +35 -47
- data/comp_tree.gemspec +1 -1
- data/contrib/quix/lib/quix/diagnostic.rb +2 -2
- data/contrib/quix/lib/quix/kernel.rb +3 -3
- data/lib/comp_tree/algorithm.rb +2 -2
- data/lib/comp_tree/bucket_ipc.rb +3 -3
- data/lib/comp_tree/{quix/diagnostic.rb → diagnostic.rb} +2 -26
- data/lib/comp_tree/driver.rb +4 -4
- data/lib/comp_tree/{quix/kernel.rb → misc.rb} +3 -27
- data/lib/comp_tree/node.rb +2 -2
- data/lib/comp_tree/tap.rb +9 -0
- data/test/test_comp_tree.rb +1 -1
- metadata +5 -5
- data/lib/comp_tree/quix/builtin/kernel/tap.rb +0 -33
data/Rakefile
CHANGED
@@ -2,7 +2,6 @@ $LOAD_PATH.unshift "contrib/quix/lib"
|
|
2
2
|
|
3
3
|
require 'rake/gempackagetask'
|
4
4
|
require 'rake/contrib/rubyforgepublisher'
|
5
|
-
require 'quix/subpackager'
|
6
5
|
|
7
6
|
$VERBOSE = nil
|
8
7
|
require 'rdoc/rdoc'
|
@@ -11,12 +10,8 @@ $VERBOSE = true
|
|
11
10
|
require 'fileutils'
|
12
11
|
include FileUtils
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
package_name_in_ruby = "CompTree"
|
17
|
-
|
18
|
-
# I would prefer "doc", but "html" is hard-coded for rubyforgepublisher
|
19
|
-
doc_dir = "html"
|
13
|
+
GEMSPEC = eval(File.read("comp_tree.gemspec"))
|
14
|
+
DOC_DIR = "html"
|
20
15
|
|
21
16
|
######################################################################
|
22
17
|
# clean
|
@@ -25,7 +20,7 @@ task :clean => [:clobber, :clean_doc] do
|
|
25
20
|
end
|
26
21
|
|
27
22
|
task :clean_doc do
|
28
|
-
rm_rf(
|
23
|
+
rm_rf(DOC_DIR)
|
29
24
|
end
|
30
25
|
|
31
26
|
######################################################################
|
@@ -40,7 +35,7 @@ end
|
|
40
35
|
|
41
36
|
task :package => :clean
|
42
37
|
|
43
|
-
Rake::GemPackageTask.new(
|
38
|
+
Rake::GemPackageTask.new(GEMSPEC) { |t|
|
44
39
|
t.need_tar = true
|
45
40
|
}
|
46
41
|
|
@@ -53,39 +48,14 @@ task :doc => :clean_doc do
|
|
53
48
|
}
|
54
49
|
|
55
50
|
options = [
|
56
|
-
"-o",
|
57
|
-
"--title", "comp_tree: #{
|
51
|
+
"-o", DOC_DIR,
|
52
|
+
"--title", "comp_tree: #{GEMSPEC.summary}",
|
58
53
|
"--main", "README"
|
59
54
|
]
|
60
55
|
|
61
56
|
RDoc::RDoc.new.document(files + options)
|
62
57
|
end
|
63
58
|
|
64
|
-
######################################################################
|
65
|
-
# repackage files from contrib/
|
66
|
-
|
67
|
-
task :generate_rb do
|
68
|
-
packages = {
|
69
|
-
:comp_tree => {
|
70
|
-
:name_in_ruby => "CompTree",
|
71
|
-
:lib_dir => "./lib",
|
72
|
-
:subpackages => {
|
73
|
-
:quix => {
|
74
|
-
:name_in_ruby => "Quix",
|
75
|
-
:sources => [
|
76
|
-
"diagnostic",
|
77
|
-
"kernel",
|
78
|
-
"builtin/kernel/tap",
|
79
|
-
],
|
80
|
-
:lib_dir => "./contrib/quix/lib",
|
81
|
-
:ignore_root_rb => true,
|
82
|
-
},
|
83
|
-
},
|
84
|
-
},
|
85
|
-
}
|
86
|
-
Quix::Subpackager.run(packages)
|
87
|
-
end
|
88
|
-
|
89
59
|
######################################################################
|
90
60
|
# git
|
91
61
|
|
@@ -110,7 +80,7 @@ task :run_pull_contrib do
|
|
110
80
|
git(*%w!pull --no-commit -s subtree quix master!)
|
111
81
|
end
|
112
82
|
|
113
|
-
task :pull_contrib => [ :init_contrib, :run_pull_contrib
|
83
|
+
task :pull_contrib => [ :init_contrib, :run_pull_contrib ]
|
114
84
|
|
115
85
|
######################################################################
|
116
86
|
# publisher
|
@@ -123,24 +93,42 @@ end
|
|
123
93
|
# release
|
124
94
|
|
125
95
|
task :prerelease => :clean do
|
126
|
-
rm_rf(
|
96
|
+
rm_rf(DOC_DIR)
|
127
97
|
rm_rf("pkg")
|
128
98
|
unless `git status` =~ %r!nothing to commit \(working directory clean\)!
|
129
99
|
raise "Directory not clean"
|
130
100
|
end
|
101
|
+
unless `ping -c2 github.com` =~ %r!0% packet loss!i
|
102
|
+
raise "No ping for github.com"
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
def rubyforge(command, file)
|
107
|
+
sh("rubyforge",
|
108
|
+
command,
|
109
|
+
GEMSPEC.rubyforge_project,
|
110
|
+
GEMSPEC.rubyforge_project,
|
111
|
+
GEMSPEC.version.to_s,
|
112
|
+
file)
|
131
113
|
end
|
132
114
|
|
133
115
|
task :finish_release do
|
134
|
-
%w(gem tgz).
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
116
|
+
gem, tgz = %w(gem tgz).map { |ext|
|
117
|
+
"pkg/#{GEMSPEC.name}-#{GEMSPEC.version}.#{ext}"
|
118
|
+
}
|
119
|
+
gem_md5, tgz_md5 = [gem, tgz].map { |file|
|
120
|
+
"#{file}.md5".tap { |md5|
|
121
|
+
sh("md5sum #{file} > #{md5}")
|
122
|
+
}
|
141
123
|
}
|
142
|
-
|
143
|
-
|
124
|
+
|
125
|
+
rubyforge("add_release", gem)
|
126
|
+
rubyforge("add_file", gem_md5)
|
127
|
+
rubyforge("add_file", tgz)
|
128
|
+
rubyforge("add_file", tgz_md5)
|
129
|
+
|
130
|
+
git("tag", "comp_tree-" + GEMSPEC.version.to_s)
|
131
|
+
git(*%w(push --tags origin master))
|
144
132
|
end
|
145
133
|
|
146
134
|
task :release =>
|
data/comp_tree.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new { |t|
|
|
6
6
|
t.name = "comp_tree"
|
7
7
|
t.rubyforge_project = "comptree"
|
8
8
|
t.homepage = "comptree.rubyforge.org"
|
9
|
-
t.version = "0.5.
|
9
|
+
t.version = "0.5.1"
|
10
10
|
t.description = "Build a computation tree and execute it with N " +
|
11
11
|
"parallel threads. Optionally fork computation nodes into new processes."
|
12
12
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
require 'thread'
|
3
3
|
|
4
|
-
module
|
5
|
-
module
|
4
|
+
module CompTree
|
5
|
+
module Misc
|
6
6
|
def let
|
7
7
|
yield self
|
8
8
|
end
|
@@ -23,7 +23,7 @@ module Quix
|
|
23
23
|
@count += 1
|
24
24
|
}
|
25
25
|
}
|
26
|
-
"#{prefix || :G}_#{count}
|
26
|
+
"#{prefix || :G}_#{count}".to_sym
|
27
27
|
end
|
28
28
|
end
|
29
29
|
include Gensym
|
data/lib/comp_tree/algorithm.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
-
require 'comp_tree/
|
2
|
+
require 'comp_tree/diagnostic'
|
3
3
|
require 'comp_tree/retriable_fork'
|
4
4
|
|
5
5
|
module CompTree
|
6
6
|
module Algorithm
|
7
|
-
include
|
7
|
+
include Diagnostic
|
8
8
|
|
9
9
|
def compute_multithreaded(root, num_threads, use_fork, buckets)
|
10
10
|
trace "Computing #{root.name} with #{num_threads} threads"
|
data/lib/comp_tree/bucket_ipc.rb
CHANGED
@@ -3,13 +3,13 @@ require 'drb'
|
|
3
3
|
require 'thread'
|
4
4
|
|
5
5
|
require 'comp_tree/retriable_fork'
|
6
|
-
require 'comp_tree/
|
7
|
-
require 'comp_tree/
|
6
|
+
require 'comp_tree/diagnostic'
|
7
|
+
require 'comp_tree/tap'
|
8
8
|
|
9
9
|
module CompTree
|
10
10
|
module BucketIPC
|
11
11
|
class Bucket
|
12
|
-
include
|
12
|
+
include Diagnostic
|
13
13
|
include RetriableFork
|
14
14
|
|
15
15
|
def initialize(address, timeout, wait_interval)
|
@@ -1,19 +1,7 @@
|
|
1
1
|
|
2
|
+
require 'comp_tree/tap'
|
2
3
|
|
3
|
-
|
4
|
-
######################################################
|
5
|
-
#
|
6
|
-
# **** DO NOT EDIT ****
|
7
|
-
#
|
8
|
-
# **** THIS IS A GENERATED FILE *****
|
9
|
-
#
|
10
|
-
######################################################
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
require 'comp_tree/quix/builtin/kernel/tap'
|
15
|
-
|
16
|
-
module CompTree::Quix
|
4
|
+
module CompTree
|
17
5
|
module Diagnostic
|
18
6
|
def show(desc = nil, stream = STDOUT, &block)
|
19
7
|
if desc
|
@@ -54,15 +42,3 @@ module CompTree::Quix
|
|
54
42
|
end
|
55
43
|
end
|
56
44
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
######################################################
|
61
|
-
#
|
62
|
-
# **** DO NOT EDIT ****
|
63
|
-
#
|
64
|
-
# **** THIS IS A GENERATED FILE *****
|
65
|
-
#
|
66
|
-
######################################################
|
67
|
-
|
68
|
-
|
data/lib/comp_tree/driver.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
require 'comp_tree/bucket_ipc'
|
3
|
-
require 'comp_tree/
|
4
|
-
require 'comp_tree/
|
3
|
+
require 'comp_tree/diagnostic'
|
4
|
+
require 'comp_tree/misc'
|
5
5
|
require 'comp_tree/algorithm'
|
6
6
|
require 'comp_tree/node'
|
7
7
|
require 'comp_tree/task_node'
|
@@ -22,8 +22,8 @@ module CompTree
|
|
22
22
|
:wait_interval => 0.02,
|
23
23
|
}
|
24
24
|
|
25
|
-
include
|
26
|
-
include
|
25
|
+
include Diagnostic
|
26
|
+
include Misc
|
27
27
|
|
28
28
|
#
|
29
29
|
# Begin a new computation tree.
|
@@ -1,20 +1,8 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
######################################################
|
5
|
-
#
|
6
|
-
# **** DO NOT EDIT ****
|
7
|
-
#
|
8
|
-
# **** THIS IS A GENERATED FILE *****
|
9
|
-
#
|
10
|
-
######################################################
|
11
|
-
|
12
|
-
|
13
|
-
|
14
2
|
require 'thread'
|
15
3
|
|
16
|
-
module CompTree
|
17
|
-
module
|
4
|
+
module CompTree
|
5
|
+
module Misc
|
18
6
|
def let
|
19
7
|
yield self
|
20
8
|
end
|
@@ -35,7 +23,7 @@ module CompTree::Quix
|
|
35
23
|
@count += 1
|
36
24
|
}
|
37
25
|
}
|
38
|
-
"#{prefix || :G}_#{count}
|
26
|
+
"#{prefix || :G}_#{count}".to_sym
|
39
27
|
end
|
40
28
|
end
|
41
29
|
include Gensym
|
@@ -71,15 +59,3 @@ module CompTree::Quix
|
|
71
59
|
extend self
|
72
60
|
end
|
73
61
|
end
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
######################################################
|
78
|
-
#
|
79
|
-
# **** DO NOT EDIT ****
|
80
|
-
#
|
81
|
-
# **** THIS IS A GENERATED FILE *****
|
82
|
-
#
|
83
|
-
######################################################
|
84
|
-
|
85
|
-
|
data/lib/comp_tree/node.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
require 'comp_tree/
|
2
|
+
require 'comp_tree/diagnostic'
|
3
3
|
require 'thread'
|
4
4
|
|
5
5
|
module CompTree
|
@@ -7,7 +7,7 @@ module CompTree
|
|
7
7
|
# Base class for nodes in the computation tree.
|
8
8
|
#
|
9
9
|
class Node
|
10
|
-
include
|
10
|
+
include Diagnostic
|
11
11
|
|
12
12
|
attr_reader :name #:nodoc:
|
13
13
|
|
data/test/test_comp_tree.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comp_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
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-
|
12
|
+
date: 2008-09-13 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -53,13 +53,13 @@ files:
|
|
53
53
|
- ./install.rb
|
54
54
|
- ./lib/comp_tree/algorithm.rb
|
55
55
|
- ./lib/comp_tree/bucket_ipc.rb
|
56
|
+
- ./lib/comp_tree/diagnostic.rb
|
56
57
|
- ./lib/comp_tree/driver.rb
|
57
58
|
- ./lib/comp_tree/error.rb
|
59
|
+
- ./lib/comp_tree/misc.rb
|
58
60
|
- ./lib/comp_tree/node.rb
|
59
|
-
- ./lib/comp_tree/quix/builtin/kernel/tap.rb
|
60
|
-
- ./lib/comp_tree/quix/diagnostic.rb
|
61
|
-
- ./lib/comp_tree/quix/kernel.rb
|
62
61
|
- ./lib/comp_tree/retriable_fork.rb
|
62
|
+
- ./lib/comp_tree/tap.rb
|
63
63
|
- ./lib/comp_tree/task_node.rb
|
64
64
|
- ./lib/comp_tree.rb
|
65
65
|
- ./test/all.rb
|
@@ -1,33 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
######################################################
|
5
|
-
#
|
6
|
-
# **** DO NOT EDIT ****
|
7
|
-
#
|
8
|
-
# **** THIS IS A GENERATED FILE *****
|
9
|
-
#
|
10
|
-
######################################################
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
unless respond_to? :tap
|
15
|
-
module Kernel
|
16
|
-
def tap
|
17
|
-
yield self
|
18
|
-
self
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
######################################################
|
26
|
-
#
|
27
|
-
# **** DO NOT EDIT ****
|
28
|
-
#
|
29
|
-
# **** THIS IS A GENERATED FILE *****
|
30
|
-
#
|
31
|
-
######################################################
|
32
|
-
|
33
|
-
|