Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.1.0, 2.1.1
-
None
Description
In the function 'resourceOffers', It declare a variable 'tasks' for storage the tasks which have allocated a executor. It declared like this:
val tasks = shuffledOffers.map(o => new ArrayBuffer[TaskDescription](o.cores))
But, I think this code only conside a situation for that one task per core. If the user config the "spark.task.cpus" as 2 or 3, It really don't need so much space. I think It can motify as follow:
val tasks = shuffledOffers.map(o => new ArrayBuffer[TaskDescription](Math.ceil(o.cores*1.0/CPUS_PER_TASK).toInt))