diff --git a/mllib-dal/src/main/native/GPU.cpp b/mllib-dal/src/main/native/GPU.cpp index 957c19267..0c79a10ed 100644 --- a/mllib-dal/src/main/native/GPU.cpp +++ b/mllib-dal/src/main/native/GPU.cpp @@ -25,6 +25,7 @@ std::vector get_gpus() { } static int getLocalRank(ccl::communicator &comm, int size, int rank) { + const int MPI_MAX_PROCESSOR_NAME = 128; /* Obtain local rank among nodes sharing the same host name */ char zero = static_cast(0); std::vector name(MPI_MAX_PROCESSOR_NAME + 1, zero); @@ -112,45 +113,3 @@ sycl::queue getQueue(const ComputeDevice device) { } } } - -preview::spmd::communicator -createDalCommunicator(const jint executorNum, const jint rank, - const ccl::string ccl_ip_port) { - auto gpus = get_gpus(); - - auto t1 = std::chrono::high_resolution_clock::now(); - - ccl::init(); - - auto t2 = std::chrono::high_resolution_clock::now(); - auto duration = - (float)std::chrono::duration_cast(t2 - t1) - .count(); - - logger::println(logger::INFO, "OneCCL singleton init took %f secs", - duration / 1000); - - t1 = std::chrono::high_resolution_clock::now(); - - auto kvs_attr = ccl::create_kvs_attr(); - - kvs_attr.set(ccl_ip_port); - - ccl::shared_ptr_class kvs = ccl::create_main_kvs(kvs_attr); - - t2 = std::chrono::high_resolution_clock::now(); - duration = - (float)std::chrono::duration_cast(t2 - t1) - .count(); - logger::println(logger::INFO, "OneCCL (native): create kvs took %f secs", - duration / 1000); - sycl::queue queue{gpus[0]}; - t1 = std::chrono::high_resolution_clock::now(); - auto comm = preview::spmd::make_communicator( - queue, executorNum, rank, kvs); - t2 = std::chrono::high_resolution_clock::now(); - duration = - (float)std::chrono::duration_cast(t2 - t1) - .count(); - return comm; -} diff --git a/mllib-dal/src/main/native/GPU.h b/mllib-dal/src/main/native/GPU.h index fa5fb2d99..9023cd1f2 100644 --- a/mllib-dal/src/main/native/GPU.h +++ b/mllib-dal/src/main/native/GPU.h @@ -6,8 +6,6 @@ #include #include -#include "Communicator.hpp" - sycl::queue getAssignedGPU(const ComputeDevice device, jint *gpu_indices); sycl::queue getQueue(const ComputeDevice device); diff --git a/mllib-dal/src/main/native/Profile.hpp b/mllib-dal/src/main/native/Profile.hpp index 06e0b4392..429e65b65 100644 --- a/mllib-dal/src/main/native/Profile.hpp +++ b/mllib-dal/src/main/native/Profile.hpp @@ -11,8 +11,7 @@ class Profiler { void startProfile(std::string s = "") { action = s; - logger::println(logger::INFO, "%s (native): start %s", subject.c_str(), - action.c_str()); + logger::println(logger::INFO, "%s (native): start %s", subject.c_str(), action.c_str()); startTime = std::chrono::high_resolution_clock::now(); } @@ -21,14 +20,11 @@ class Profiler { auto duration = std::chrono::duration_cast( end_time - startTime) .count(); - logger::println(logger::INFO, "%s (native): start %s took %f secs", - subject.c_str(), action.c_str(), - (float)duration / 1000); + logger::println(logger::INFO, "%s (native): start %s took %f secs", subject.c_str(), action.c_str(), (float)duration / 1000); } void println(std::string msg) { - logger::println(logger::INFO, "%s (native): %s", subject.c_str(), - msg.c_str()); + logger::println(logger::INFO, "%s (native): %s", subject.c_str(), msg.c_str()); } private: diff --git a/mllib-dal/src/main/native/javah/com_intel_oap_mllib_clustering_KMeansDALImpl.h b/mllib-dal/src/main/native/javah/com_intel_oap_mllib_clustering_KMeansDALImpl.h index 9a00db0a2..a0fc24dde 100644 --- a/mllib-dal/src/main/native/javah/com_intel_oap_mllib_clustering_KMeansDALImpl.h +++ b/mllib-dal/src/main/native/javah/com_intel_oap_mllib_clustering_KMeansDALImpl.h @@ -13,7 +13,7 @@ extern "C" { * Signature: (JJIDIIII[ILcom/intel/oap/mllib/clustering/KMeansResult;)J */ JNIEXPORT jlong JNICALL Java_com_intel_oap_mllib_clustering_KMeansDALImpl_cKMeansOneapiComputeWithInitCenters - (JNIEnv *, jobject, jint, jlong, jlong, jlong, jlong, jint, jdouble, jint, jint, jint, jint, jintArray, jstring, jobject); + (JNIEnv *, jobject, jint, jlong, jlong, jlong, jlong, jint, jdouble, jint, jint, jint, jint, jintArray, jobject); #ifdef __cplusplus }