mridulm 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_r390235561
 
 

 ##########
 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:
   If possible, feature parity in whatever practical/constrained way of local 
mode with cluster mode would be nice - it allows for an quick 
prototyping/testing before launching on a cluster.
   Ofcourse, not coupling with this work - but particularly for rapid 
prototyping, local mode is invaluable.

----------------------------------------------------------------
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