@@ -558,6 +558,8 @@ void PDHG_Init_Variables(const cupdlp_int* has_variables, CUPDLPwork *work) {
558558 // Ax(work, iterates->ax, iterates->x);
559559 // ATyCPU(work, iterates->aty, iterates->y);
560560 Ax (work , ax , x );
561+
562+ #if PDLP_DEBUG_LOG
561563 double ax_norm ;
562564 cupdlp_twoNorm (work , lp -> nRows , ax -> data , & ax_norm );
563565 if (work -> settings -> nLogLevel > 0 )
@@ -567,6 +569,7 @@ void PDHG_Init_Variables(const cupdlp_int* has_variables, CUPDLPwork *work) {
567569 double aty_norm ;
568570 cupdlp_twoNorm (work , lp -> nCols , aty -> data , & aty_norm );
569571 work -> debug_pdlp_data_ .aty_norm = aty_norm ;
572+ #endif
570573
571574 // cupdlp_zero(iterates->xSum, cupdlp_float, lp->nCols);
572575 // cupdlp_zero(iterates->ySum, cupdlp_float, lp->nRows);
@@ -907,14 +910,15 @@ cupdlp_retcode PDHG_Solve(const cupdlp_int* has_variables, CUPDLPwork *pdhg) {
907910 timers -> nIter = 0 ;
908911 timers -> dSolvingBeg = getTimeStamp ();
909912
913+ #if PDLP_DEBUG_LOG
910914 if (PDLP_DEBUG_LOG ) {
911915 pdhg -> debug_pdlp_log_file_ = fopen ("cuPDLP.log" , "w" );
912916 assert (pdhg -> debug_pdlp_log_file_ );
913917 debugPdlpDataInitialise (& pdhg -> debug_pdlp_data_ );
914918 } else {
915919 pdhg -> debug_pdlp_log_file_ = NULL ;
916920 }
917-
921+ #endif
918922 // PDHG_Init_Data does nothing!
919923 PDHG_Init_Data (pdhg );
920924
@@ -932,10 +936,16 @@ cupdlp_retcode PDHG_Solve(const cupdlp_int* has_variables, CUPDLPwork *pdhg) {
932936 // iter_log_since_header so that an initial header is printed
933937 const int iter_log_between_header = 50 ;
934938 int iter_log_since_header = iter_log_between_header ;
939+ #if PDLP_DEBUG_LOG
935940 debugPdlpIterHeaderLog (pdhg -> debug_pdlp_log_file_ );
941+ #endif
936942 for (timers -> nIter = 0 ; timers -> nIter < settings -> nIterLim ; ++ timers -> nIter ) {
943+ #if PDLP_DEBUG_LOG
937944 debugPdlpIterLog (pdhg -> debug_pdlp_log_file_ , timers -> nIter , & pdhg -> debug_pdlp_data_ , pdhg -> stepsize -> dBeta , pdhg -> stepsize -> dPrimalStep , pdhg -> stepsize -> dDualStep );
945+ #endif
946+
938947 PDHG_Compute_SolvingTime (pdhg );
948+
939949#if CUPDLP_DUMP_ITERATES_STATS && CUPDLP_DEBUG
940950 PDHG_Dump_Stats (pdhg );
941951#endif
@@ -982,6 +992,7 @@ cupdlp_retcode PDHG_Solve(const cupdlp_int* has_variables, CUPDLPwork *pdhg) {
982992 iter_log_since_header ++ ;
983993 }
984994
995+ #if PDLP_DEBUG_LOG
985996 debugPdlpFeasOptLog (pdhg -> debug_pdlp_log_file_ ,
986997 pdhg -> timers -> nIter ,
987998 pdhg -> resobj -> dPrimalObj ,
@@ -997,7 +1008,7 @@ cupdlp_retcode PDHG_Solve(const cupdlp_int* has_variables, CUPDLPwork *pdhg) {
9971008 pdhg -> resobj -> dPrimalFeasAverage / (1.0 + pdhg -> scaling -> dNormRhs ),
9981009 pdhg -> resobj -> dDualFeasAverage / (1.0 + pdhg -> scaling -> dNormCost ), "[A]" );
9991010 debugPdlpIterHeaderLog (pdhg -> debug_pdlp_log_file_ );
1000-
1011+ #endif
10011012 // Termination check printing is only done when printing is full
10021013 int termination_print = bool_print && full_print ;
10031014 if (PDHG_Check_Termination (pdhg , termination_print )) {
@@ -1059,14 +1070,16 @@ cupdlp_retcode PDHG_Solve(const cupdlp_int* has_variables, CUPDLPwork *pdhg) {
10591070
10601071 CUPDLPvec * ax = iterates -> ax [timers -> nIter % 2 ];
10611072 CUPDLPvec * aty = iterates -> aty [timers -> nIter % 2 ];
1073+
1074+ #if PDLP_DEBUG_LOG
10621075 double debug_pdlp_data_ax_norm = 0.0 ;
10631076 cupdlp_twoNorm (pdhg , problem -> nRows , ax -> data ,
10641077 & debug_pdlp_data_ax_norm );
10651078 pdhg -> debug_pdlp_data_ .ax_norm = debug_pdlp_data_ax_norm ;
10661079 double debug_pdlp_data_aty_norm = 0.0 ;
10671080 cupdlp_twoNorm (pdhg , problem -> nCols , aty -> data , & debug_pdlp_data_aty_norm );
10681081 pdhg -> debug_pdlp_data_ .aty_norm = debug_pdlp_data_aty_norm ;
1069-
1082+ #endif
10701083 // CUPDLP_CALL(PDHG_Update_Iterate(pdhg));
10711084 if (PDHG_Update_Iterate (pdhg ) == RETCODE_FAILED ) {
10721085 // cupdlp_printf("Time limit reached.\n");
0 commit comments