tgravescs commented on a change in pull request #27773: [SPARK-29154][CORE] 
Update Spark scheduler for stage level scheduling
URL: https://github.com/apache/spark/pull/27773#discussion_r390300887
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/scheduler/local/LocalSchedulerBackend.scala
 ##########
 @@ -162,7 +162,13 @@ private[spark] class LocalSchedulerBackend(
 
   override def applicationId(): String = appId
 
-  override def maxNumConcurrentTasks(): Int = totalCores / 
scheduler.CPUS_PER_TASK
+  // Doesn't support different ResourceProfiles yet
+  // so we expect all executors to be of same ResourceProfile
+  override def maxNumConcurrentTasks(rp: ResourceProfile): Int = {
+    val cpusPerTask = rp.taskResources.get(ResourceProfile.CPUS)
+      .map(_.amount.toInt).getOrElse(scheduler.CPUS_PER_TASK)
+    totalCores / cpusPerTask
 
 Review comment:
   yeah the main issue right now is this is tied to dynamic allocation, so we 
would just need to figure out we would want that to behave.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to