Skip to content

Commit

Permalink
print availableProcessors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ngone51 committed Aug 11, 2020
1 parent fe5f891 commit 4e1d8ec
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,15 @@ private class SharedMessageLoop(

private def getNumOfThreads(conf: SparkConf): Int = {
val availableCores =
if (numUsableCores > 0) numUsableCores else Runtime.getRuntime.availableProcessors()
if (numUsableCores > 0) {
numUsableCores
} else {
val processors = Runtime.getRuntime.availableProcessors()
// scalastyle:off
println(s"availableProcessors=$processors")
// scalastyle:on
processors
}

val modNumThreads = conf.get(RPC_NETTY_DISPATCHER_NUM_THREADS)
.getOrElse(math.max(2, availableCores))
Expand Down

0 comments on commit 4e1d8ec

Please sign in to comment.