You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/21 18:48:35 UTC

[GitHub] [spark] mridulm commented on a change in pull request #33385: [SPARK-36173][CORE] Support getting CPU number in TaskContext

mridulm commented on a change in pull request #33385:
URL: https://github.com/apache/spark/pull/33385#discussion_r674241685



##########
File path: core/src/main/scala/org/apache/spark/scheduler/TaskDescription.scala
##########
@@ -57,6 +57,7 @@ private[spark] class TaskDescription(
     val addedJars: Map[String, Long],
     val addedArchives: Map[String, Long],
     val properties: Properties,
+    val cpus: Int,

Review comment:
       Add a precondition for `cpus` > 0 ?

##########
File path: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala
##########
@@ -429,6 +429,7 @@ private[spark] class TaskSetManager(
       execId: String,
       host: String,
       maxLocality: TaskLocality.TaskLocality,
+      taskCpuAssignments: Int = 1,

Review comment:
       Can we not default to `CPUS_PER_TASK` which is current behavior ?

##########
File path: core/src/main/scala/org/apache/spark/TaskContextImpl.scala
##########
@@ -54,6 +54,7 @@ private[spark] class TaskContextImpl(
     @transient private val metricsSystem: MetricsSystem,
     // The default value is only used in tests.
     override val taskMetrics: TaskMetrics = TaskMetrics.empty,
+    override val cpus: Int = 0,

Review comment:
       Default to CPUS_PER_TASK ?




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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org