From 2d87d07940a4ed3709b825a8f5779ecefe1a7820 Mon Sep 17 00:00:00 2001 From: "Wu, Xiaochang" Date: Tue, 2 Feb 2021 17:38:51 +0800 Subject: [PATCH] fix LibLoader.loadLibMLlibDAL with loadLibraries --- .../src/main/java/org/apache/spark/ml/util/LibLoader.java | 6 +++--- .../src/main/scala/org/apache/spark/ml/util/Utils.scala | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mllib-dal/src/main/java/org/apache/spark/ml/util/LibLoader.java b/mllib-dal/src/main/java/org/apache/spark/ml/util/LibLoader.java index c11b4e56e..ed83f3fe8 100644 --- a/mllib-dal/src/main/java/org/apache/spark/ml/util/LibLoader.java +++ b/mllib-dal/src/main/java/org/apache/spark/ml/util/LibLoader.java @@ -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"); @@ -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"); } diff --git a/mllib-dal/src/main/scala/org/apache/spark/ml/util/Utils.scala b/mllib-dal/src/main/scala/org/apache/spark/ml/util/Utils.scala index 40a1c6823..a7b762945 100644 --- a/mllib-dal/src/main/scala/org/apache/spark/ml/util/Utils.scala +++ b/mllib-dal/src/main/scala/org/apache/spark/ml/util/Utils.scala @@ -72,7 +72,7 @@ object Utils { } def checkClusterPlatformCompatibility(sc: SparkContext) : Boolean = { - LibLoader.loadLibMLlibDAL() + LibLoader.loadLibraries() // check driver platform compatibility if (!OneDAL.cCheckPlatformCompatibility()) @@ -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()