From 3d71e2112f83d5b287f5fe063036f2e64d0bef7c Mon Sep 17 00:00:00 2001 From: minmingzhu <45281494+minmingzhu@users.noreply.github.com> Date: Fri, 28 Jul 2023 16:00:28 +0800 Subject: [PATCH] [ML-335] Fix issues (#337) * split CI script to python and scala Signed-off-by: minmingzhu * fixed issues Signed-off-by: minmingzhu * update ci-tests.yml Signed-off-by: minmingzhu * update service.cpp Signed-off-by: minmingzhu * update service.cpp code style Signed-off-by: minmingzhu --------- Signed-off-by: minmingzhu --- .../java/com/intel/oap/mllib/feature/PCAResult.java | 10 ++++++++++ mllib-dal/src/main/native/OneCCL.cpp | 7 ++++++- mllib-dal/src/main/native/service.cpp | 13 ++++++------- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/mllib-dal/src/main/java/com/intel/oap/mllib/feature/PCAResult.java b/mllib-dal/src/main/java/com/intel/oap/mllib/feature/PCAResult.java index a0ea6c6c7..bb4799ad6 100644 --- a/mllib-dal/src/main/java/com/intel/oap/mllib/feature/PCAResult.java +++ b/mllib-dal/src/main/java/com/intel/oap/mllib/feature/PCAResult.java @@ -20,6 +20,14 @@ public class PCAResult { public long pcNumericTable; public long explainedVarianceNumericTable; + public long getExplainedVarianceNumericTable() { + return explainedVarianceNumericTable; + } + + public void setExplainedVarianceNumericTable(long explainedVarianceNumericTable) { + this.explainedVarianceNumericTable = explainedVarianceNumericTable; + } + public long getPcNumericTable() { return pcNumericTable; } @@ -27,4 +35,6 @@ public long getPcNumericTable() { public void setPcNumericTable(long pcNumericTable) { this.pcNumericTable = pcNumericTable; } + + } diff --git a/mllib-dal/src/main/native/OneCCL.cpp b/mllib-dal/src/main/native/OneCCL.cpp index 38557d615..1c6947e06 100644 --- a/mllib-dal/src/main/native/OneCCL.cpp +++ b/mllib-dal/src/main/native/OneCCL.cpp @@ -147,7 +147,7 @@ static int fill_local_host_ip() { continue; if (strstr(ifa->ifa_name, iface_name) == NULL) { family = ifa->ifa_addr->sa_family; - if (family == AF_INET) { + if (family == AF_INET || family == AF_INET6) { memset(local_ip, 0, CCL_IP_LEN); int res = getnameinfo( ifa->ifa_addr, @@ -161,6 +161,11 @@ static int fill_local_host_ip() { return -1; } local_host_ips.push_back(local_ip); + } else { + std::cerr + << "OneCCL (native): can't find interface to get host IP" + << std::endl; + return -1; } } } diff --git a/mllib-dal/src/main/native/service.cpp b/mllib-dal/src/main/native/service.cpp index 07d820765..0bb05c241 100644 --- a/mllib-dal/src/main/native/service.cpp +++ b/mllib-dal/src/main/native/service.cpp @@ -410,9 +410,9 @@ void printNumericTable(NumericTable *dataTable, const char *message = "", nPrintedRows, nCols, message, interval); dataTable->releaseBlockOfRows(block); } else { - try { - PackedArrayNumericTableIface *packedTable = - dynamic_cast(dataTable); + PackedArrayNumericTableIface *packedTable = + dynamic_cast(dataTable); + if (packedTable) { packedTable->getPackedArray(readOnly, block); if (isLower(layout)) { printLowerArray( @@ -423,10 +423,9 @@ void printNumericTable(NumericTable *dataTable, const char *message = "", nCols, message, interval); } packedTable->releasePackedArray(block); - } catch (const std::bad_cast &e) { - std::cout - << "Dynamic cast to PackedArrayNumericTableIface* failed: " - << e.what() << std::endl; + } else { + std::cout << "Dynamic cast to PackedArrayNumericTableIface* failed." + << std::endl; } } }