pwrake 2.2.8 → 2.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4053be2a3de706030e8ee37157453416b379f22c7751db94d2122b607eec6d3a
4
- data.tar.gz: c76ad99c55d4ee592522337d66327845d72c239df9cfd8bed294e7d7acdc3e83
3
+ metadata.gz: 93b60deb41a4fda0bafa94a5b240812e5c5925ab204f8b802ef63d78fbcf81b2
4
+ data.tar.gz: 6ac5c66ad22c8ba3316bca3aeab8b34fe0a4e9189f50a99b2056c5a8cced7277
5
5
  SHA512:
6
- metadata.gz: bc954608b0bf14af8782f27273cc9a802951a31a04c2507ef42255a0855af738c9ab71dc9cc5f6afdde2d8c097b27cc01d606d2cf667b083e270a138e9e5ac4d
7
- data.tar.gz: 192a8cbc976188d637f74b08cec65054235e156e82ecaa1354a75a2dbdadd91e1c8b14b0d21733f15c0d85d601c15db366f0c91c95d0b4919e25a23b886cdb87
6
+ metadata.gz: 7b0d50fb5cb90b8c7682be343c4ef70acfb324d01b46903f39606f8e044d3315ae7cf7a6cd8e4074e5b5178b3e16aa224c827f53b1ef8ea74a27b6176f84b39b
7
+ data.tar.gz: 90911a12880e22276be78feae3e13b850d9614f93fc30195a7fb253e730a369bc51783778524aca2213672fca6b290c7622bdf503278f0e04dfe2eb29d46acb5
@@ -329,7 +329,7 @@ module Pwrake
329
329
  if count == 0 && !@task_queue.empty? && @hostinfo_by_taskname.empty?
330
330
  m="No task was invoked while unexecuted tasks remain"
331
331
  Log.error m
332
- Log.error "count=#{count} @hostinfo_by_taskname.empty?=#{@hostinfo_by_taskname.empty?} @task_queue=\n"+@task_queue.inspect_q
332
+ Log.error "count=#{count} @hostinfo_by_taskname.empty?=#{@hostinfo_by_taskname.empty?} @task_queue.empty?={@task_queue.empty?} @task_queue=\n"+@task_queue.inspect_q
333
333
  raise RuntimeError,m
334
334
  end
335
335
  #Log.debug "#{self.class}#send_task_to_idle_core end time=#{Time.now-tm}"
@@ -139,6 +139,18 @@ module Pwrake
139
139
  end
140
140
  attr_reader :by_id, :by_name
141
141
 
142
+ def max_ncore
143
+ by_id.map{|host_info| host_info.ncore}.max
144
+ end
145
+
146
+ def min_ncore
147
+ by_id.map{|host_info| host_info.ncore}.max
148
+ end
149
+
150
+ def total_ncore
151
+ by_id.inject(0){|sum,host_info| host_info.ncore + sum}
152
+ end
153
+
142
154
  def local?
143
155
  @is_local
144
156
  end
@@ -59,7 +59,7 @@ module Pwrake
59
59
  def turn_empty?(turn)
60
60
  case turn
61
61
  when 0
62
- @q_no_action.empty? && @size_q == 0 && @q_remote.empty?
62
+ empty?
63
63
  when 1
64
64
  @size_q == 0
65
65
  end
@@ -158,6 +158,7 @@ module Pwrake
158
158
  end
159
159
  s << _qstr("local*#{n}",[]) if n > 0
160
160
  s << _qstr("remote",@q_remote)
161
+ s << _qstr("reserved",@q_reserved)
161
162
  s << "@size_q=#{@size_q}"
162
163
  s
163
164
  end
@@ -9,6 +9,12 @@ module Pwrake
9
9
  @enable_steal = true
10
10
  @q_no_action = NoActionQueue.new
11
11
  @q_reserved = Hash.new
12
+ def @q_reserved.first
13
+ super.last
14
+ end
15
+ def @q_reserved.last
16
+ self[keys.last]
17
+ end
12
18
 
13
19
  @hostinfo_by_id = hostinfo_by_id
14
20
 
@@ -158,7 +164,8 @@ module Pwrake
158
164
  def inspect_q
159
165
  _qstr("noaction",@q_no_action) +
160
166
  _qstr("input", @q_input) +
161
- _qstr("no_input",@q_no_input)
167
+ _qstr("no_input",@q_no_input) +
168
+ _qstr("reserved",@q_reserved)
162
169
  end
163
170
 
164
171
  def drop_host(host_info)
@@ -16,8 +16,8 @@ module Pwrake
16
16
  end
17
17
 
18
18
  def define_task(task_class, *args, &block) # :nodoc:
19
- prop = @property_by_block[block.object_id]
20
- if prop.nil?
19
+ prop = block && @property_by_block[block.source_location]
20
+ unless prop
21
21
  prop = @last_property
22
22
  @last_property = TaskProperty.new
23
23
  end
@@ -35,7 +35,9 @@ module Pwrake
35
35
  end
36
36
 
37
37
  def create_rule(*args, &block) # :nodoc:
38
- @property_by_block[block.object_id] = @last_property
38
+ if block
39
+ @property_by_block[block.source_location] = @last_property
40
+ end
39
41
  @last_property = TaskProperty.new
40
42
  super
41
43
  end
@@ -1,3 +1,3 @@
1
1
  module Pwrake
2
- VERSION = "2.2.8"
2
+ VERSION = "2.2.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.8
4
+ version: 2.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro TANAKA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-21 00:00:00.000000000 Z
11
+ date: 2019-06-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Parallel and distributed Rake for workflow execution on multicores, clusters,
14
14
  clouds using SSH. It has locality-aware scheduling designed for Gfarm file system.
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
- rubygems_version: 3.0.1
125
+ rubygems_version: 3.0.3
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Parallel and distributed Rake for workflow execution on multicores, clusters,