From f118604137bc840e57f5faf4409f80971dfce87e Mon Sep 17 00:00:00 2001 From: Sebastian Baunsgaard Date: Fri, 18 Aug 2023 18:03:06 +0200 Subject: [PATCH] debug in jol estimate --- .../component/compress/colgroup/JolEstimateTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/apache/sysds/test/component/compress/colgroup/JolEstimateTest.java b/src/test/java/org/apache/sysds/test/component/compress/colgroup/JolEstimateTest.java index 4c13724fdea..8c30b398b7c 100644 --- a/src/test/java/org/apache/sysds/test/component/compress/colgroup/JolEstimateTest.java +++ b/src/test/java/org/apache/sysds/test/component/compress/colgroup/JolEstimateTest.java @@ -28,6 +28,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.sysds.runtime.DMLRuntimeException; +import org.apache.sysds.runtime.compress.CompressedMatrixBlock; import org.apache.sysds.runtime.compress.CompressionSettings; import org.apache.sysds.runtime.compress.CompressionSettingsBuilder; import org.apache.sysds.runtime.compress.colgroup.AColGroup; @@ -74,6 +75,7 @@ public abstract class JolEstimateTest { private final AColGroup cg; public JolEstimateTest(MatrixBlock mbt) { + CompressedMatrixBlock.debug = true; this.mbt = mbt; colIndexes = ColIndexFactory.create(mbt.getNumRows()); @@ -166,7 +168,8 @@ public void compressedSizeInfoEstimatorSample(double ratio, double tolerance) { final int estimateNUniques = cInfo.getNumVals(); final double estimateCSI = (cg.getCompType() == CompressionType.CONST) ? ColGroupSizes - .estimateInMemorySizeCONST(cg.getNumCols(),true, 1.0, false) : cInfo.getCompressionSize(cg.getCompType()); + .estimateInMemorySizeCONST(cg.getNumCols(), true, 1.0, + false) : cInfo.getCompressionSize(cg.getCompType()); final double minTolerance = actualSize * tolerance * (ratio < 1 && mbt.getSparsity() < 0.8 ? mbt.getSparsity() + 0.2 : 1); double maxTolerance = actualSize / tolerance; @@ -182,8 +185,8 @@ public void compressedSizeInfoEstimatorSample(double ratio, double tolerance) { final boolean withinToleranceOnSize = minTolerance <= estimateCSI && estimateCSI <= maxTolerance; if(!withinToleranceOnSize) { - final String rangeString = String.format("%.0f <= %.0f <= %.0f , Actual Size %d", minTolerance, estimateCSI, - maxTolerance, actualSize); + final String rangeString = String.format("%.0f <= %.0f <= %.0f , Actual Size %d", minTolerance, + estimateCSI, maxTolerance, actualSize); String message = "CSI Sampled estimate size is not in tolerance range \n" + rangeString + "\nActual number uniques:" + actualNumberUnique + " estimated Uniques: " + estimateNUniques + "\nSampleSize of total rows:: " + sampleSize + " " + mbt.getNumColumns() + "\n" + cInfo + "\n";