class Pwrake::NonLocalityQueue

Attributes

turns[R]

Public Class Methods

new(hostinfo_by_id, array_class, median_core, group_map=nil) click to toggle source
# File lib/pwrake/queue/non_locality_queue.rb, line 9
def initialize(hostinfo_by_id, array_class, median_core, group_map=nil)
  @hostinfo_by_id = hostinfo_by_id
  @array_class = array_class
  @median_core = median_core
  @disable_rank = Rake.application.pwrake_options['DISABLE_RANK_PRIORITY']
  Log.debug "#{self.class}: @disable_rank=#{@disable_rank.inspect}"
  @q_input = @array_class.new(@median_core)
  @q_no_input = FifoQueueArray.new(@median_core)
  @turns = [0]
end

Public Instance Methods

clear() click to toggle source
# File lib/pwrake/queue/non_locality_queue.rb, line 53
def clear
  @q_input.clear
  @q_no_input.clear
end
deq_impl(host_info, turn) click to toggle source
# File lib/pwrake/queue/non_locality_queue.rb, line 38
def deq_impl(host_info, turn)
  case turn
  when 0
    @q_input.shift(host_info,@rank) ||
      @q_no_input.shift(host_info,@rank)
  else
    raise "invalid turn: #{turn}"
  end
end
deq_start() click to toggle source
# File lib/pwrake/queue/non_locality_queue.rb, line 34
def deq_start
  @rank = @disable_rank ? 0 : @q_input.find_rank(@median_core)
end
drop_host(host_info) click to toggle source
# File lib/pwrake/queue/non_locality_queue.rb, line 68
def drop_host(host_info)
end
empty?() click to toggle source
# File lib/pwrake/queue/non_locality_queue.rb, line 58
def empty?
  @q_input.empty? &&
  @q_no_input.empty?
end
enq_impl(tw) click to toggle source
# File lib/pwrake/queue/non_locality_queue.rb, line 22
def enq_impl(tw)
  if tw.has_input_file?
    @q_input.push(tw)
  else
    @q_no_input.push(tw)
  end
end
inspect_q() click to toggle source
# File lib/pwrake/queue/non_locality_queue.rb, line 63
def inspect_q
  TaskQueue._qstr("input",   @q_input) +
  TaskQueue._qstr("no_input",@q_no_input)
end
size() click to toggle source
# File lib/pwrake/queue/non_locality_queue.rb, line 48
def size
  @q_input.size +
  @q_no_input.size
end
turn_empty?(turn) click to toggle source
# File lib/pwrake/queue/non_locality_queue.rb, line 30
def turn_empty?(turn)
  empty?
end