code: int computeNumSlotsPerMap(long slotSizePerMap) {
      if ((slotSizePerMap==DISABLED_MEMORY_LIMIT) ||
          (getMemoryForMapTask()==DISABLED_MEMORY_LIMIT)) {
        return 1;
      }
      return (int)(Math.ceil((float)getMemoryForMapTask() / (float)slotSizePerMap));
    }
docs: Compute the number of slots required to run a single map task-attempt
  of this job.
  @param slotSizePerMap cluster-wide value of the amount of memory required
  to run a map-task
  @return the number of slots required to run a single map task-attempt
  1 if memory parameters are disabled.