tgravescs commented on a change in pull request #24374: 
[WIP][SPARK-27366][CORE] Support GPU Resources in Spark job scheduling
URL: https://github.com/apache/spark/pull/24374#discussion_r284253618
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/SparkConf.scala
 ##########
 @@ -584,6 +679,32 @@ class SparkConf(loadDefaults: Boolean) extends Cloneable 
with Logging with Seria
       }
     }
 
+    val resources = getResources(false)
+    val resourceRequirements = getResourceRequirements()
+    val executorCores = get(EXECUTOR_CORES)
+    val taskCpus = get(CPUS_PER_TASK)
+    resourceRequirements.foreach { case (resourceName, resourceCount) =>
+      if (!resources.contains(resourceName)) {
 
 Review comment:
   This should just be comparing task count to executor resource count (no 
addresses). Those are the 2 configs the user would specify.
   
   could simplify this a bit by doing a getOrElse:
   
   val executorResourceCount = resources.get(resourceName).getOrElse(
           throw new SparkException(...
   
   Then you don't need the if/else and can use executorResourceCount in the if 
check below.

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