diff --git a/src/main/java/org/apache/sysds/hops/DataOp.java b/src/main/java/org/apache/sysds/hops/DataOp.java index 7b912bd39ed..cfc57972af3 100644 --- a/src/main/java/org/apache/sysds/hops/DataOp.java +++ b/src/main/java/org/apache/sysds/hops/DataOp.java @@ -130,9 +130,7 @@ public DataOp(String l, DataType dt, ValueType vt, String s = e.getKey(); Hop input = e.getValue(); getInput().add(input); - if (LOG.isDebugEnabled()){ - LOG.debug(String.format("%15s - %s",s,input)); - } + LOG.debug(s + " - " + input); input.getParent().add(this); _paramIndexMap.put(s, index); diff --git a/src/main/java/org/apache/sysds/hops/cost/CostEstimator.java b/src/main/java/org/apache/sysds/hops/cost/CostEstimator.java index ffd3ff1bb82..84bb29a070e 100644 --- a/src/main/java/org/apache/sysds/hops/cost/CostEstimator.java +++ b/src/main/java/org/apache/sysds/hops/cost/CostEstimator.java @@ -155,18 +155,16 @@ else if( pb instanceof BasicProgramBlock ) //awareness of recursive functions, missing program if( !memoFunc.contains(fkey) && pb.getProgram()!=null ) { - if(LOG.isDebugEnabled()) - LOG.debug("Begin Function "+fkey); - + LOG.debug("Begin Function " + fkey); + memoFunc.add(fkey); Program prog = pb.getProgram(); FunctionProgramBlock fpb = prog.getFunctionProgramBlock( finst.getNamespace(), finst.getFunctionName()); ret += rGetTimeEstimate(fpb, stats, memoFunc, recursive); memoFunc.remove(fkey); - - if(LOG.isDebugEnabled()) - LOG.debug("End Function "+fkey); + + LOG.debug("End Function " + fkey); } } } diff --git a/src/main/java/org/apache/sysds/hops/cost/CostEstimatorStaticRuntime.java b/src/main/java/org/apache/sysds/hops/cost/CostEstimatorStaticRuntime.java index da2788e8c6c..873a24fda9d 100644 --- a/src/main/java/org/apache/sysds/hops/cost/CostEstimatorStaticRuntime.java +++ b/src/main/java/org/apache/sysds/hops/cost/CostEstimatorStaticRuntime.java @@ -85,9 +85,8 @@ protected double getCPInstTimeEstimate( Instruction inst, VarStats[] vs, String[ } vs[1]._inmem = true; } - if( LOG.isDebugEnabled() && ltime!=0 ) { - LOG.debug("Cost["+cpinst.getOpcode()+" - read] = "+ltime); - } + if(ltime != 0) + LOG.debug("Cost[" + cpinst.getOpcode() + " - read] = " + ltime); //exec time CP instruction String opcode = (cpinst instanceof FunctionCallCPInstruction) ? InstructionUtils.getOpCode(cpinst.toString()) : cpinst.getOpcode(); @@ -99,9 +98,8 @@ protected double getCPInstTimeEstimate( Instruction inst, VarStats[] vs, String[ if( inst instanceof VariableCPInstruction && ((VariableCPInstruction)inst).getOpcode().equals(Opcodes.WRITE.toString()) ) wtime += getHDFSWriteTime(vs[2].getRows(), vs[2].getCols(), vs[2].getSparsity(), ((VariableCPInstruction)inst).getInput3().getName() ); - if( LOG.isDebugEnabled() && wtime!=0 ) { - LOG.debug("Cost["+cpinst.getOpcode()+" - write] = "+wtime); - } + if(wtime != 0) + LOG.debug("Cost[" + cpinst.getOpcode() + " - write] = " + wtime); //total costs double costs = ltime + etime + wtime; @@ -261,8 +259,7 @@ private static double getInstTimeEstimate( String opcode, boolean inMR, long d1m double nflops = getNFLOP(opcode, inMR, d1m, d1n, d1s, d2m, d2n, d2s, d3m, d3n, d3s, args); double time = nflops / DEFAULT_FLOPS; - if( LOG.isDebugEnabled() ) - LOG.debug("Cost["+opcode+"] = "+time+"s, "+nflops+" flops ("+d1m+","+d1n+","+d1s+","+d2m+","+d2n+","+d2s+","+d3m+","+d3n+","+d3s+")."); + LOG.debug("Cost[" + opcode + "] = " + time + "s, " + nflops + " flops (" + d1m + "," + d1n + "," + d1s + "," + d2m + "," + d2n + "," + d2s + "," + d3m + "," + d3n + "," + d3s + ")."); return time; } diff --git a/src/main/java/org/apache/sysds/hops/rewrite/RewriteInjectOOCTee.java b/src/main/java/org/apache/sysds/hops/rewrite/RewriteInjectOOCTee.java index 7abfb15d1d4..c6a0fc9a93d 100644 --- a/src/main/java/org/apache/sysds/hops/rewrite/RewriteInjectOOCTee.java +++ b/src/main/java/org/apache/sysds/hops/rewrite/RewriteInjectOOCTee.java @@ -138,10 +138,7 @@ private void applyTopDownTeeRewrite(Hop sharedInput) { } int consumerCount = sharedInput.getParent().size(); - if (LOG.isDebugEnabled()) { - LOG.debug("Inject tee for hop " + sharedInput.getHopID() + " (" - + sharedInput.getName() + "), consumers=" + consumerCount); - } + LOG.debug("Inject tee for hop " + sharedInput.getHopID() + " (" + sharedInput.getName() + "), consumers=" + consumerCount); // Take a defensive copy of consumers before modifying the graph ArrayList consumers = new ArrayList<>(sharedInput.getParent()); @@ -161,10 +158,7 @@ private void applyTopDownTeeRewrite(Hop sharedInput) { handledHop.put(sharedInput.getHopID(), teeOp); rewrittenHops.add(sharedInput.getHopID()); - if (LOG.isDebugEnabled()) { - LOG.debug("Created tee hop " + teeOp.getHopID() + " -> " - + teeOp.getName()); - } + LOG.debug("Created tee hop " + teeOp.getHopID() + " -> " + teeOp.getName()); } @SuppressWarnings("unused") @@ -276,11 +270,7 @@ private void removeRedundantTeeChains(Hop hop) { if (HopRewriteUtils.isData(hop, OpOpData.TEE) && hop.getInput().size() == 1) { Hop teeInput = hop.getInput().get(0); if (HopRewriteUtils.isData(teeInput, OpOpData.TEE)) { - if (LOG.isDebugEnabled()) { - LOG.debug("Remove redundant tee hop " + hop.getHopID() - + " (" + hop.getName() + ") -> " + teeInput.getHopID() - + " (" + teeInput.getName() + ")"); - } + LOG.debug("Remove redundant tee hop " + hop.getHopID() + " (" + hop.getName() + ") -> " + teeInput.getHopID() + " (" + teeInput.getName() + ")"); HopRewriteUtils.rewireAllParentChildReferences(hop, teeInput); HopRewriteUtils.removeAllChildReferences(hop); } diff --git a/src/main/java/org/apache/sysds/runtime/compress/CompressedMatrixBlockFactory.java b/src/main/java/org/apache/sysds/runtime/compress/CompressedMatrixBlockFactory.java index 4c48effb4df..d5cfc6b60e8 100644 --- a/src/main/java/org/apache/sysds/runtime/compress/CompressedMatrixBlockFactory.java +++ b/src/main/java/org/apache/sysds/runtime/compress/CompressedMatrixBlockFactory.java @@ -532,13 +532,11 @@ private Pair abortCompression() { } private void logInit() { - if(LOG.isDebugEnabled()) { - LOG.debug("--Seed used for comp : " + compSettings.seed); - LOG.debug(String.format("--number columns to compress: %10d", mb.getNumColumns())); - LOG.debug(String.format("--number rows to compress : %10d", mb.getNumRows())); - LOG.debug(String.format("--sparsity : %10.5f", mb.getSparsity())); - LOG.debug(String.format("--nonZeros : %10d", mb.getNonZeros())); - } + LOG.debug("--Seed used for comp : " + compSettings.seed); + LOG.debug("--number columns to compress: " + mb.getNumColumns()); + LOG.debug("--number rows to compress : " + mb.getNumRows()); + LOG.debug("--sparsity : " + mb.getSparsity()); + LOG.debug("--nonZeros : " + mb.getNonZeros()); } private void logPhase() { diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/caching/CacheableData.java b/src/main/java/org/apache/sysds/runtime/controlprogram/caching/CacheableData.java index 36637ee8959..82601813bd3 100644 --- a/src/main/java/org/apache/sysds/runtime/controlprogram/caching/CacheableData.java +++ b/src/main/java/org/apache/sysds/runtime/controlprogram/caching/CacheableData.java @@ -1172,8 +1172,7 @@ protected abstract T readBlobFromStream(OOCStream stream) // Federated read protected T readBlobFromFederated(FederationMap fedMap) throws IOException { - if( LOG.isDebugEnabled() ) //common if instructions keep federated outputs - LOG.debug("Pulling data from federated sites"); + LOG.debug("Pulling data from federated sites"); MetaDataFormat iimd = (MetaDataFormat) _metaData; DataCharacteristics dc = iimd.getDataCharacteristics(); return readBlobFromFederated(fedMap, dc.getDims()); diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/FederatedWorkerHandler.java b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/FederatedWorkerHandler.java index 2cd9e8abf4e..945e8bb46ba 100644 --- a/src/main/java/org/apache/sysds/runtime/controlprogram/federated/FederatedWorkerHandler.java +++ b/src/main/java/org/apache/sysds/runtime/controlprogram/federated/FederatedWorkerHandler.java @@ -290,11 +290,9 @@ private static void printStatistics() { } private static void logRequests(FederatedRequest request, int nrRequest, int totalRequests) { - if(LOG.isDebugEnabled()) { - LOG.debug("Executing command " + (nrRequest + 1) + "/" + totalRequests + ": " + request.getType().name()); - if(LOG.isTraceEnabled()) - LOG.trace("full command: " + request.toString()); - } + LOG.debug("Executing command " + (nrRequest + 1) + "/" + totalRequests + ": " + request.getType().name()); + if(LOG.isTraceEnabled()) + LOG.trace("full command: " + request); } private FederatedResponse executeCommand(FederatedRequest request, ExecutionContextMap ecm, EventStageModel eventStage) diff --git a/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/ParamServer.java b/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/ParamServer.java index 333c889b7c1..a8a768611e6 100644 --- a/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/ParamServer.java +++ b/src/main/java/org/apache/sysds/runtime/controlprogram/paramserv/ParamServer.java @@ -203,10 +203,7 @@ protected synchronized void updateGlobalModel(int workerID, ListObject params) { protected synchronized void updateGlobalGradients(int workerID, ListObject gradients) { try { - if(LOG.isDebugEnabled()) { - LOG.debug(String.format("Successfully pulled the gradients [size:%d kb] of worker_%d.", - gradients.getDataSize() / 1024, workerID)); - } + LOG.debug("Successfully pulled the gradients [size:" + gradients.getDataSize() / 1024 + " kb] of worker_" + workerID + "."); switch(_updateType) { case BSP: { @@ -298,8 +295,7 @@ private void performGlobalGradientUpdate() { // Broadcast the updated model broadcastModel(_finishedStates); resetFinishedStates(); - if(LOG.isDebugEnabled()) - LOG.debug("Global parameter is broadcasted successfully."); + LOG.debug("Global parameter is broadcasted successfully."); } private void tagStragglers() { @@ -353,10 +349,7 @@ protected ListObject updateLocalModel(ExecutionContext ec, ListObject gradients, protected synchronized void updateAverageModel(int workerID, ListObject model) { try { - if(LOG.isDebugEnabled()) { - LOG.debug(String.format("Successfully pulled the models [size:%d kb] of worker_%d.", - model.getDataSize() / 1024, workerID)); - } + LOG.debug("Successfully pulled the models [size:" + model.getDataSize() / 1024 + " kb] of worker_" + workerID + "."); Timing tAgg = DMLScript.STATISTICS ? new Timing(true) : null; switch(_updateType) { @@ -443,8 +436,7 @@ protected void updateAndBroadcastModel(ListObject new_model, Timing tAgg, boolea broadcastModel(true); else broadcastModel(workerBroadcastMask); - if(LOG.isDebugEnabled()) - LOG.debug("Global parameter is broadcasted successfully "); + LOG.debug("Global parameter is broadcasted successfully"); } protected ListObject weightModels(ListObject params, int numWorkers) { diff --git a/src/main/java/org/apache/sysds/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java b/src/main/java/org/apache/sysds/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java index 98101348da0..b10bf3d8b85 100644 --- a/src/main/java/org/apache/sysds/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java +++ b/src/main/java/org/apache/sysds/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java @@ -106,9 +106,7 @@ public void processInstruction(ExecutionContext ec) { ec.setMatrixOutput(getOutput(0).getName(), data); ec.setFrameOutput(getOutput(1).getName(), meta); - if(LOG.isDebugEnabled()) - // debug the size of the output metadata. - LOG.debug("Memory size of metadata: " + meta.getInMemorySize()); + LOG.debug("Memory size of metadata: " + meta.getInMemorySize()); } @Override diff --git a/src/main/java/org/apache/sysds/runtime/instructions/fed/InitFEDInstruction.java b/src/main/java/org/apache/sysds/runtime/instructions/fed/InitFEDInstruction.java index bf2e6b43718..4dbe96b7c55 100644 --- a/src/main/java/org/apache/sysds/runtime/instructions/fed/InitFEDInstruction.java +++ b/src/main/java/org/apache/sysds/runtime/instructions/fed/InitFEDInstruction.java @@ -423,8 +423,7 @@ public static void federateMatrix(CacheableData output, List> idResponse : idResponses) { // wait for initialization and check dimensions FederatedResponse re = idResponse.getRight().get(timeout, TimeUnit.SECONDS); diff --git a/src/main/java/org/apache/sysds/runtime/io/MatrixReaderFactory.java b/src/main/java/org/apache/sysds/runtime/io/MatrixReaderFactory.java index dc1c7da230c..5d0f07b16ea 100644 --- a/src/main/java/org/apache/sysds/runtime/io/MatrixReaderFactory.java +++ b/src/main/java/org/apache/sysds/runtime/io/MatrixReaderFactory.java @@ -36,9 +36,7 @@ public static MatrixReader createMatrixReader(FileFormat fmt) { boolean par = ConfigurationManager.getCompilerConfigFlag(ConfigType.PARALLEL_CP_READ_TEXTFORMATS); boolean mcsr = MatrixBlock.DEFAULT_SPARSEBLOCK == SparseBlock.Type.MCSR; - if (LOG.isDebugEnabled()){ - LOG.debug("reading parallel: " + par + " mcsr: " + mcsr); - } + LOG.debug("reading parallel: " + par + " mcsr: " + mcsr); switch(fmt) { case TEXT: @@ -95,9 +93,7 @@ public static MatrixReader createMatrixReader( ReadProperties props ) { boolean par = ConfigurationManager.getCompilerConfigFlag(ConfigType.PARALLEL_CP_READ_TEXTFORMATS); boolean mcsr = MatrixBlock.DEFAULT_SPARSEBLOCK == SparseBlock.Type.MCSR; - if (LOG.isDebugEnabled()){ - LOG.debug("reading parallel: " + par + " mcsr: " + mcsr); - } + LOG.debug("reading parallel: " + par + " mcsr: " + mcsr); switch(fmt) { case TEXT: diff --git a/src/main/java/org/apache/sysds/runtime/lineage/LineageRewriteReuse.java b/src/main/java/org/apache/sysds/runtime/lineage/LineageRewriteReuse.java index 6cc71550247..812ece167ed 100644 --- a/src/main/java/org/apache/sysds/runtime/lineage/LineageRewriteReuse.java +++ b/src/main/java/org/apache/sysds/runtime/lineage/LineageRewriteReuse.java @@ -167,8 +167,7 @@ private static ArrayList rewriteTsmmCbind (Instruction curr, Execut DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteTsmmCbind APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteTsmmCbind APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); // cleanup buffer pool @@ -209,8 +208,7 @@ private static ArrayList rewriteTsmmCbindOnes (Instruction curr, Ex DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteTsmmCbindOnes APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteTsmmCbindOnes APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; @@ -254,8 +252,7 @@ private static ArrayList rewriteTsmmRbind (Instruction curr, Execut DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteTsmmRbind APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteTsmmRbind APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; @@ -318,8 +315,7 @@ private static ArrayList rewriteTsmm2Cbind (Instruction curr, Execu DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteTsmm2Cbind APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteTsmm2Cbind APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; @@ -389,8 +385,7 @@ private static ArrayList rewriteTsmm2CbindSameLeft (Instruction cur DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteTsmm2CbindSameLeft APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteTsmm2CbindSameLeft APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; @@ -435,8 +430,7 @@ private static ArrayList rewriteMatMulRbindLeft (Instruction curr, DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteMetMulRbindLeft APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteMetMulRbindLeft APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; @@ -481,8 +475,7 @@ private static ArrayList rewriteMatMulCbindRight (Instruction curr, DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteMatMulCbindRight APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteMatMulCbindRight APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; @@ -516,8 +509,7 @@ private static ArrayList rewriteMatMulCbindRightOnes (Instruction c DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteMatMulCbindRightOnes APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteMatMulCbindRightOnes APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; @@ -573,8 +565,7 @@ private static ArrayList rewriteElementMulRbind (Instruction curr, DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteElementMulRbind APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteElementMulRbind APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; @@ -630,8 +621,7 @@ private static ArrayList rewriteElementMulCbind (Instruction curr, DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteElementMulCbind APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteElementMulCbind APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; @@ -687,8 +677,7 @@ private static ArrayList rewriteAggregateCbind (Instruction curr, E DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteElementMulCbind APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteElementMulCbind APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; @@ -740,8 +729,7 @@ private static ArrayList rewriteIndexingMatMul (Instruction curr, E DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewriteIndexingMatMul APPLIED"); + LOG.debug("LINEAGE REWRITE rewriteIndexingMatMul APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); // Keep reuse enabled _disableReuse = false; @@ -801,8 +789,7 @@ private static ArrayList rewritePcaTsmm(Instruction curr, Execution DataOp lrwWrite = HopRewriteUtils.createTransientWrite(LR_VAR, lrwHop); // Generate runtime instructions - if (LOG.isDebugEnabled()) - LOG.debug("LINEAGE REWRITE rewritePcaTsmm APPLIED"); + LOG.debug("LINEAGE REWRITE rewritePcaTsmm APPLIED"); ArrayList inst = genInst(lrwWrite, lrwec); _disableReuse = true; diff --git a/src/main/java/org/apache/sysds/runtime/matrix/data/sketch/countdistinctapprox/KMVSketch.java b/src/main/java/org/apache/sysds/runtime/matrix/data/sketch/countdistinctapprox/KMVSketch.java index 29d1706f9e1..f1398c4a2f5 100644 --- a/src/main/java/org/apache/sysds/runtime/matrix/data/sketch/countdistinctapprox/KMVSketch.java +++ b/src/main/java/org/apache/sysds/runtime/matrix/data/sketch/countdistinctapprox/KMVSketch.java @@ -73,13 +73,10 @@ public MatrixBlock getValue(MatrixBlock blkIn) { SmallestPriorityQueue spq = getKSmallestHashes(blkIn, k, M); - if(LOG.isDebugEnabled()) { - LOG.debug("M not forced to int size: " + tmp); - LOG.debug("M: " + M); - LOG.debug("M: " + M); - LOG.debug("kth smallest hash:" + spq.peek()); - LOG.debug("spq: " + spq); - } + LOG.debug("M not forced to int size: " + tmp); + LOG.debug("M: " + M); + LOG.debug("kth smallest hash: " + spq.peek()); + LOG.debug("spq: " + spq); long res = countDistinctValuesKMV(spq, k, M, D); @@ -197,11 +194,9 @@ private long countDistinctValuesKMV(SmallestPriorityQueue spq, int k, int M, lon double estimate = (k - 1) / U_k; double ceilEstimate = Math.min(estimate, D); - if(LOG.isDebugEnabled()) { - LOG.debug("U_k : " + U_k); - LOG.debug("Estimate: " + estimate); - LOG.debug("Ceil worst case: " + D); - } + LOG.debug("U_k : " + U_k); + LOG.debug("Estimate: " + estimate); + LOG.debug("Ceil worst case: " + D); res = Math.round(ceilEstimate); } diff --git a/src/main/java/org/apache/sysds/runtime/transform/encode/ColumnEncoderDummycode.java b/src/main/java/org/apache/sysds/runtime/transform/encode/ColumnEncoderDummycode.java index 616a6a7ce8b..e73dca018cb 100644 --- a/src/main/java/org/apache/sysds/runtime/transform/encode/ColumnEncoderDummycode.java +++ b/src/main/java/org/apache/sysds/runtime/transform/encode/ColumnEncoderDummycode.java @@ -224,10 +224,7 @@ else if(columnEncoder instanceof ColumnEncoderFeatureHash){ if(distinct != -1) { _domainSize = Math.max(1, distinct); - if(LOG.isDebugEnabled()){ - - LOG.debug("DummyCoder for column: " + _colID + " has domain size: " + _domainSize); - } + LOG.debug("DummyCoder for column: " + _colID + " has domain size: " + _domainSize); } } } diff --git a/src/main/java/org/apache/sysds/runtime/transform/encode/CompressedEncode.java b/src/main/java/org/apache/sysds/runtime/transform/encode/CompressedEncode.java index c3903cef006..34fb55efcec 100644 --- a/src/main/java/org/apache/sysds/runtime/transform/encode/CompressedEncode.java +++ b/src/main/java/org/apache/sysds/runtime/transform/encode/CompressedEncode.java @@ -205,9 +205,7 @@ private int shiftGroups(List groups) { private AColGroup encode(ColumnEncoderComposite c) throws Exception { final Timing t = new Timing(); AColGroup g = executeEncode(c); - if(LOG.isDebugEnabled()) - LOG.debug(String.format("Encode: columns: %4d estimateDistinct: %6d distinct: %6d size: %6d time: %10f", - c._colID, c._estNumDistincts, g.getNumValues(), g.estimateInMemorySize(), t.stop())); + LOG.debug("Encode: columns: " + c._colID + " estimateDistinct: " + c._estNumDistincts + " distinct: " + g.getNumValues() + " size: " + g.estimateInMemorySize() + " time: " + t.stop()); return g; } @@ -721,8 +719,7 @@ private AColGroup combine(List ucg) throws Interrupte nnz.addAndGet(combinedNNZ); ret.setNonZeros(combinedNNZ); - if(LOG.isDebugEnabled()) - LOG.debug("Combining of : " + ucg.size() + " uncompressed columns Time: " + t.stop()); + LOG.debug("Combining of : " + ucg.size() + " uncompressed columns Time: " + t.stop()); return ColGroupUncompressed.create(ret, combinedCols); } @@ -769,16 +766,13 @@ private final long putIntoRowBlock(List ucg, int jl, } private void logging(MatrixBlock mb) { - if(LOG.isDebugEnabled()) { - LOG.debug(String.format("Uncompressed transform encode Dense size: %16d", mb.estimateSizeDenseInMemory())); - LOG.debug(String.format("Uncompressed transform encode Sparse size: %16d", mb.estimateSizeSparseInMemory())); - LOG.debug(String.format("Compressed transform encode size: %16d", mb.estimateSizeInMemory())); - - double ratio = Math.min(mb.estimateSizeDenseInMemory(), mb.estimateSizeSparseInMemory()) / - mb.estimateSizeInMemory(); - double denseRatio = mb.estimateSizeDenseInMemory() / mb.estimateSizeInMemory(); - LOG.debug(String.format("Compression ratio: %10.3f", ratio)); - LOG.debug(String.format("Dense ratio: %10.3f", denseRatio)); - } + LOG.debug("Uncompressed transform encode Dense size: " + mb.estimateSizeDenseInMemory()); + LOG.debug("Uncompressed transform encode Sparse size: " + mb.estimateSizeSparseInMemory()); + LOG.debug("Compressed transform encode size: " + mb.estimateSizeInMemory()); + double ratio = Math.min(mb.estimateSizeDenseInMemory(), mb.estimateSizeSparseInMemory()) / + mb.estimateSizeInMemory(); + double denseRatio = mb.estimateSizeDenseInMemory() / mb.estimateSizeInMemory(); + LOG.debug("Compression ratio: " + ratio); + LOG.debug("Dense ratio: " + denseRatio); } }