@@ -465,15 +465,16 @@ PostSolveRetcode PDLPSolver::postprocess(HighsSolution& solution) {
465465
466466void PDLPSolver::solve (std::vector<double >& x, std::vector<double >& y) {
467467 hipdlpTimerStart (kHipdlpClockSolve );
468- auto solve_start = std::chrono::high_resolution_clock::now ();
469468 Timer solver_timer;
470469 const HighsLp& lp = lp_;
471470
472- debug_pdlp_log_file_ = fopen (" HiPDLP.log" , " w" );
473- assert (debug_pdlp_log_file_);
471+ const bool debug_logging = false ;
472+ if (debug_logging) {
473+ debug_pdlp_log_file_ = fopen (" HiPDLP.log" , " w" );
474+ assert (debug_pdlp_log_file_);
475+ }
474476
475477 // --- 0. Using PowerMethod to estimate the largest eigenvalue ---
476- auto init_start = std::chrono::high_resolution_clock::now ();
477478 initializeStepSizes ();
478479
479480 PrimalDualParams working_params = params_;
@@ -518,9 +519,6 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
518519
519520 logger_.print_iteration_header ();
520521
521- auto init_end = std::chrono::high_resolution_clock::now ();
522- timings_.other_time += std::chrono::duration<double >(init_end - init_start).count ();
523-
524522 // --- 2. Main PDHG Loop ---
525523 debugPdlpIterHeaderLog (debug_pdlp_log_file_);
526524 debugPdlpDataInitialise (&debug_pdlp_data_);
@@ -548,10 +546,7 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
548546 bool_checking = (bool_checking || iter % PDHG_CHECK_INTERVAL == 0 );
549547 if (bool_checking) {
550548 hipdlpTimerStart (kHipdlpClockAverageIterate );
551- auto avg_start = std::chrono::high_resolution_clock::now ();
552549 computeAverageIterate (Ax_avg, ATy_avg);
553- auto avg_end = std::chrono::high_resolution_clock::now ();
554- timings_.average_iterate_time += std::chrono::duration<double >(avg_end - avg_start).count ();
555550 hipdlpTimerStop (kHipdlpClockAverageIterate );
556551
557552 // Reset the average iterate accumulation
@@ -562,7 +557,6 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
562557 SolverResults average_results;
563558
564559 hipdlpTimerStart (kHipdlpClockConvergenceCheck );
565- auto conv_start = std::chrono::high_resolution_clock::now ();
566560 // Compute residuals for current iterate
567561 bool current_converged = checkConvergence (
568562 iter, x_current_, y_current_, Ax_cache_, ATy_cache_,
@@ -572,8 +566,6 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
572566 bool average_converged =
573567 checkConvergence (iter, x_avg_, y_avg_, Ax_avg, ATy_avg,
574568 params_.tolerance , average_results, " [A]" );
575- auto conv_end = std::chrono::high_resolution_clock::now ();
576- timings_.convergence_check_time += std::chrono::duration<double >(conv_end - conv_start).count ();
577569 hipdlpTimerStop (kHipdlpClockConvergenceCheck );
578570
579571 debugPdlpIterHeaderLog (debug_pdlp_log_file_);
@@ -603,7 +595,6 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
603595 }
604596
605597 // --- 4. Restart Check (using computed results) ---
606- auto restart_start = std::chrono::high_resolution_clock::now ();
607598 RestartInfo restart_info =
608599 restart_scheme_.Check (iter, current_results, average_results);
609600
@@ -637,22 +628,16 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
637628 sum_weights_ = 0.0 ;
638629
639630 restart_scheme_.last_restart_iter_ = iter;
640- auto matvec_start = std::chrono::high_resolution_clock::now ();
641631 // Recompute Ax and ATy for the restarted iterates
642632 linalg::Ax (lp, x_current_, Ax_cache_);
643633 linalg::ATy (lp, y_current_, ATy_cache_);
644- auto matvec_end = std::chrono::high_resolution_clock::now ();
645- timings_.matrix_multiply_time += std::chrono::duration<double >(matvec_end - matvec_start).count ();
646634
647635 restart_scheme_.SetLastRestartIter (iter);
648636 }
649- auto restart_end = std::chrono::high_resolution_clock::now ();
650- timings_.restart_check_time += std::chrono::duration<double >(restart_end - restart_start).count ();
651637 }
652638
653639 // --- 5. Core PDHG update Step ---
654640 hipdlpTimerStart (kHipdlpClockIterateUpdate );
655- auto update_start = std::chrono::high_resolution_clock::now ();
656641 bool step_success = true ;
657642
658643 // Store current iterates before update (for next iteration's x_current_,
@@ -686,16 +671,11 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
686671 return solveReturn (TerminationStatus::ERROR);
687672 }
688673 }
689- auto update_end = std::chrono::high_resolution_clock::now ();
690- timings_.iterate_update_time += std::chrono::duration<double >(update_end - update_start).count ();
691674
692675 // Compute ATy for the new iterate
693676 Ax_cache_ = Ax_next_;
694677 hipdlpTimerStart (kHipdlpClockMatrixTransposeMultiply );
695- auto aty_start = std::chrono::high_resolution_clock::now ();
696678 linalg::ATy (lp, y_next_, ATy_cache_);
697- auto aty_end = std::chrono::high_resolution_clock::now ();
698- timings_.matrix_multiply_time += std::chrono::duration<double >(aty_end - aty_start).count ();
699679 hipdlpTimerStop (kHipdlpClockMatrixTransposeMultiply );
700680
701681 hipdlpTimerStop (kHipdlpClockIterateUpdate );
@@ -704,10 +684,7 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
704684 // The number of iterations since the last restart
705685 int inner_iter = iter - restart_scheme_.GetLastRestartIter ();
706686 hipdlpTimerStart (kHipdlpClockAverageIterate );
707- auto avg_update_start = std::chrono::high_resolution_clock::now ();
708687 updateAverageIterates (x_next_, y_next_, working_params, inner_iter);
709- auto avg_update_end = std::chrono::high_resolution_clock::now ();
710- timings_.average_iterate_time += std::chrono::duration<double >(avg_update_end - avg_update_start).count ();
711688 hipdlpTimerStop (kHipdlpClockAverageIterate );
712689
713690
@@ -725,8 +702,6 @@ void PDLPSolver::solve(std::vector<double>& x, std::vector<double>& y) {
725702 x = x_avg_;
726703 y = y_avg_;
727704
728- auto solve_end = std::chrono::high_resolution_clock::now ();
729- timings_.total_time = std::chrono::duration<double >(solve_end - solve_start).count ();
730705
731706 return solveReturn (TerminationStatus::TIMEOUT);
732707}
@@ -1408,31 +1383,21 @@ std::vector<double> PDLPSolver::updateY(const std::vector<double> &y, const std:
14081383
14091384void PDLPSolver::updateIteratesFixed () {
14101385 hipdlpTimerStart (kHipdlpClockProjectX );
1411- auto proj_start = std::chrono::high_resolution_clock::now ();
14121386 x_next_ = updateX (x_current_, ATy_cache_, stepsize_.primal_step );
1413- auto proj_end = std::chrono::high_resolution_clock::now ();
1414- timings_.projection_time += std::chrono::duration<double >(proj_end - proj_start).count ();
14151387 hipdlpTimerStop (kHipdlpClockProjectX );
14161388
14171389 hipdlpTimerStart (kHipdlpClockMatrixMultiply );
1418- auto ax_start = std::chrono::high_resolution_clock::now ();
14191390 linalg::Ax (lp_, x_next_, Ax_next_);
1420- auto ax_end = std::chrono::high_resolution_clock::now ();
1421- timings_.matrix_multiply_time += std::chrono::duration<double >(ax_end - ax_start).count ();
14221391 hipdlpTimerStop (kHipdlpClockMatrixMultiply );
14231392
14241393 hipdlpTimerStart (kHipdlpClockProjectY );
1425- auto proj_y_start = std::chrono::high_resolution_clock::now ();
14261394 y_next_ = updateY (y_current_, Ax_cache_, Ax_next_, stepsize_.dual_step );
1427- auto proj_y_end = std::chrono::high_resolution_clock::now ();
1428- timings_.projection_time += std::chrono::duration<double >(proj_y_end - proj_y_start).count ();
14291395 hipdlpTimerStop (kHipdlpClockProjectY );
14301396}
14311397
14321398void PDLPSolver::updateIteratesAdaptive () {
14331399 hipdlpTimerStart (kHipdlpClockStepSizeAdjustment );
14341400
1435- auto step_adjust_start = std::chrono::high_resolution_clock::now ();
14361401 const double MIN_ETA = 1e-6 ;
14371402 const double MAX_ETA = 1.0 ;
14381403
@@ -1469,32 +1434,20 @@ void PDLPSolver::updateIteratesAdaptive() {
14691434
14701435 // Primal update
14711436 hipdlpTimerStart (kHipdlpClockProjectX );
1472- auto proj_start = std::chrono::high_resolution_clock::now ();
14731437 xupdate = updateX (x_candidate, aty_candidate, primal_step_update);
1474- auto proj_end = std::chrono::high_resolution_clock::now ();
1475- timings_.projection_time += std::chrono::duration<double >(proj_end - proj_start).count ();
14761438 hipdlpTimerStop (kHipdlpClockProjectX );
14771439
14781440 hipdlpTimerStart (kHipdlpClockMatrixMultiply );
1479- auto ax_start = std::chrono::high_resolution_clock::now ();
14801441 linalg::Ax (lp_, xupdate, axupdate);
1481- auto ax_end = std::chrono::high_resolution_clock::now ();
1482- timings_.matrix_multiply_time += std::chrono::duration<double >(ax_end - ax_start).count ();
14831442 hipdlpTimerStop (kHipdlpClockMatrixMultiply );
14841443
14851444 // Dual update with timing
14861445 hipdlpTimerStart (kHipdlpClockProjectY );
1487- auto proj_y_start = std::chrono::high_resolution_clock::now ();
14881446 yupdate = updateY (y_candidate, ax_candidate, axupdate, dual_step_update);
1489- auto proj_y_end = std::chrono::high_resolution_clock::now ();
1490- timings_.projection_time += std::chrono::duration<double >(proj_y_end - proj_y_start).count ();
14911447 hipdlpTimerStop (kHipdlpClockProjectY );
14921448
14931449 hipdlpTimerStart (kHipdlpClockMatrixTransposeMultiply );
1494- auto aty_start = std::chrono::high_resolution_clock::now ();
14951450 linalg::ATy (lp_, yupdate, atyupdate);
1496- auto aty_end = std::chrono::high_resolution_clock::now ();
1497- timings_.matrix_multiply_time += std::chrono::duration<double >(aty_end - aty_start).count ();
14981451 hipdlpTimerStop (kHipdlpClockMatrixTransposeMultiply );
14991452
15001453 // Compute deltas
@@ -1571,8 +1524,6 @@ void PDLPSolver::updateIteratesAdaptive() {
15711524 stepsize_.primal_step = dStepSizeUpdate / std::sqrt (stepsize_.beta );
15721525 stepsize_.dual_step = dStepSizeUpdate * std::sqrt (stepsize_.beta );
15731526
1574- auto step_adjust_end = std::chrono::high_resolution_clock::now ();
1575- timings_.step_size_adjustment_time += std::chrono::duration<double >(step_adjust_end - step_adjust_start).count ();
15761527 hipdlpTimerStop (kHipdlpClockStepSizeAdjustment );
15771528}
15781529
0 commit comments