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..ff5fc5e18 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,7 +423,7 @@ void printNumericTable(NumericTable *dataTable, const char *message = "", nCols, message, interval); } packedTable->releasePackedArray(block); - } catch (const std::bad_cast &e) { + } else { std::cout << "Dynamic cast to PackedArrayNumericTableIface* failed: " << e.what() << std::endl;