-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: spark.executor.cores' default value based on master when countin…
…g workers (#855) * fix default values based on master - https://spark.apache.org/docs/latest/configuration.html * add unittest for clusterutils * fix comment and add copyright Co-authored-by: Ilya Matiach <ilmat@microsoft.com>
- Loading branch information
1 parent
4ae0fe8
commit 64481e9
Showing
3 changed files
with
93 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/test/scala/com/microsoft/ml/spark/core/utils/VerifyClusterUtil.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (C) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in project root for information. | ||
|
||
package com.microsoft.ml.spark.core.utils | ||
|
||
import com.microsoft.ml.spark.core.test.base.{SparkSessionFactory, TestBase} | ||
import org.slf4j.LoggerFactory | ||
|
||
class VerifyClusterUtil extends TestBase { | ||
test("Verify ClusterUtil can get default number of executor cores based on master") { | ||
val spark = SparkSessionFactory.getSession("verifyClusterUtil-Session") | ||
val log = LoggerFactory.getLogger("VerifyClusterUtil") | ||
|
||
// https://spark.apache.org/docs/latest/configuration.html | ||
assert(ClusterUtil.getDefaultNumExecutorCores(spark, log, Option("yarn")) == 1) | ||
assert(ClusterUtil.getDefaultNumExecutorCores(spark, log, Option("spark://localhost:7077")) == | ||
ClusterUtil.getJVMCPUs(spark)) | ||
} | ||
} |