Skip to content

Commit

Permalink
fix LibLoader.loadLibMLlibDAL with loadLibraries
Browse files Browse the repository at this point in the history
  • Loading branch information
xwu99 committed Feb 2, 2021
1 parent 3c3e2cf commit 2d87d07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static synchronized void loadLibraries() throws IOException {
/**
* Load oneCCL libs in dependency order
*/
public static synchronized void loadLibCCL() throws IOException {
private static synchronized void loadLibCCL() throws IOException {
loadFromJar(subDir, "libfabric.so.1");
loadFromJar(subDir, "libmpi.so.12");
loadFromJar(subDir, "libccl.so");
Expand All @@ -65,12 +65,12 @@ public static synchronized void loadLibCCL() throws IOException {
* Load MLlibDAL lib, it depends TBB libs that are loaded by oneDAL,
* so this function should be called after oneDAL loadLibrary
*/
public static synchronized void loadLibMLlibDAL() throws IOException {
private static synchronized void loadLibMLlibDAL() throws IOException {
// oneDAL Java API doesn't load correct libtbb version for oneAPI Beta 10
// Rename in pom.xml and assembly.xml to workaround.
// See https://github.com/oneapi-src/oneDAL/issues/1254 -->
LibUtils.loadLibrary();

loadFromJar(subDir, "libMLlibDAL.so");
}

Expand Down
4 changes: 2 additions & 2 deletions mllib-dal/src/main/scala/org/apache/spark/ml/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ object Utils {
}

def checkClusterPlatformCompatibility(sc: SparkContext) : Boolean = {
LibLoader.loadLibMLlibDAL()
LibLoader.loadLibraries()

// check driver platform compatibility
if (!OneDAL.cCheckPlatformCompatibility())
Expand All @@ -82,7 +82,7 @@ object Utils {
val executor_num = Utils.sparkExecutorNum(sc)
val data = sc.parallelize(1 to executor_num, executor_num)
val result = data.map { p =>
LibLoader.loadLibMLlibDAL()
LibLoader.loadLibraries()
OneDAL.cCheckPlatformCompatibility()
}.collect()

Expand Down

0 comments on commit 2d87d07

Please sign in to comment.