def parallels(slave_instance_type, instance_count)
      reduce_slots = Hash.new(1)
      reduce_slots['m1.small'] = 1
      reduce_slots['m1.large'] = 2
      reduce_slots['m1.xlarge'] = 4
      reduce_slots['c1.medium'] = 2
      reduce_slots['c1.xlarge'] = 4
      ((instance_count - 1).to_f * reduce_slots[slave_instance_type].to_f * 0.9).ceil
    end
def parallels(slave_instance_type, instance_count)
      reduce_slots = Hash.new(1)
      reduce_slots['m1.small'] = 1
      reduce_slots['m1.large'] = 2
      reduce_slots['m1.xlarge'] = 4
      reduce_slots['c1.medium'] = 2
      reduce_slots['c1.xlarge'] = 4
      ((instance_count - 1).to_f * reduce_slots[slave_instance_type].to_f * 0.9).ceil
    end
Calculate a common-sense default value of PARALLELS using the following
 formula from the Pig Cookbook:

   <num machines> * <num reduce slots per machine> * 0.9

 With the following reducer configuration (from an AWS forum post):

   m1.small   1
   m1.large   2
   m1.xlarge  4
   c1.medium  2
   c1.xlarge  4