@@ -97,7 +97,8 @@ hiopAlgFilterIPMBase::hiopAlgFilterIPMBase(hiopNlpFormulation* nlp_in, const boo
97
97
d_soc(nullptr ),
98
98
within_FR_(within_FR),
99
99
pd_perturb_(nullptr ),
100
- fact_acceptor_(nullptr )
100
+ fact_acceptor_(nullptr ),
101
+ warn_large_bnd_duals_(false )
101
102
{
102
103
// force completion of the nlp's initialization
103
104
nlp->finalizeInitialization ();
@@ -662,7 +663,7 @@ bool hiopAlgFilterIPMBase::evalNlpAndLogErrors(const hiopIterate& it,
662
663
}
663
664
664
665
nlp->log ->printf (hovIteration, " nrmOneDualEqu %g nrmOneDualBo %g\n " , nrmDualEqu, nrmDualBou);
665
- if (nrmDualBou > 1e+10 ) {
666
+ if (nrmDualBou > 1e+10 && !warn_large_bnd_duals_ ) {
666
667
nlp->log ->printf (hovWarning,
667
668
" Unusually large bound dual variables (norm1=%g) occured, \n "
668
669
" which may cause numerical instabilities, convergence issues, \n "
@@ -673,7 +674,8 @@ bool hiopAlgFilterIPMBase::evalNlpAndLogErrors(const hiopIterate& it,
673
674
674
675
nlp->log ->printf (hovWarning,
675
676
" HiOp options 'fixed_var_tolerance', 'bound_relax_perturb', or \n "
676
- " 'elastic_mode' may remedy this issue. Also see 'scaling_type' option.\n " );
677
+ " 'elastic_mode' may remedy this issue. Also see 'scaling_type' option.\n " );
678
+ warn_large_bnd_duals_ = true ;
677
679
}
678
680
679
681
// scaling factors
@@ -710,99 +712,6 @@ bool hiopAlgFilterIPMBase::evalNlpAndLogErrors(const hiopIterate& it,
710
712
return true ;
711
713
}
712
714
713
- // bool hiopAlgFilterIPMBase::evalNlpAndLogErrors2(const hiopIterate& it,
714
- // const hiopResidual& resid,
715
- // const double& mu,
716
- // double& nlpoptim,
717
- // double& nlpfeas,
718
- // double& nlpcomplem,
719
- // double& nlpoverall,
720
- // double& logoptim,
721
- // double& logfeas,
722
- // double& logcomplem,
723
- // double& logoverall,
724
- // double& cons_violation)
725
- // {
726
- // nlp->runStats.tmSolverInternal.start();
727
-
728
- // size_type n = nlp->n_complem();
729
- // double sc;
730
- // double sd;
731
- // double nrmDualBou;
732
- // double nrmDualEqu;
733
- // if(!it.compute_sc_sd(sc, sd, nrmDualEqu, nrmDualBou)) {
734
- // return false;
735
- // }
736
-
737
- // nlp->log->printf(hovWarning, "nrmOneDualEqu %g nrmOneDualBo %g\n", nrmDualEqu, nrmDualBou);
738
- // if(nrmDualBou > 1e+10) {
739
- // nlp->log->printf(hovWarning,
740
- // "Unusually large bound dual variables (norm1=%g) occured, "
741
- // "which may cause numerical instabilities if it persists. Convergence "
742
- // " issues or inacurate optimal solutions may be experienced. Possible causes: "
743
- // " tight bounds or bad scaling of the optimization variables.\n",
744
- // nrmDualBou);
745
- // if(nlp->options->GetString("fixed_var") == "remove") {
746
- // nlp->log->printf(hovWarning,
747
- // "For example, increase 'fixed_var_tolerance' to remove "
748
- // "additional variables.\n");
749
- // } else if(nlp->options->GetString("fixed_var") == "relax") {
750
- // nlp->log->printf(hovWarning,
751
- // "For example, increase 'fixed_var_tolerance' to relax "
752
- // "aditional (tight) variables and/or increase 'fixed_var_perturb' "
753
- // "to decrease the tightness.\n");
754
- // } else {
755
- // nlp->log->printf(hovWarning,
756
- // "Potential fixes: fix or relax variables with tight bounds "
757
- // "(see 'fixed_var' option) or rescale variables.\n");
758
- // }
759
- // }
760
-
761
- // // scaling factors
762
- // //sd = max { p_smax, ||zl||_M + ||zu||_M + (||vl||_1 + ||vu||_1)/m } /p_smax
763
- // //sc = max { p_smax, ||zl||_M + ||zu||_M } /p_smax
764
- // //nlpoptim = ||gradf + Jc'*yc + Jd'*Jd - M*zl - M*zu||_Hinv
765
- // // ||yd+vl-vu||_inf
766
- // //nlpfeas = ||crhs- c||_inf
767
- // // ||drs- d||_inf
768
- // // ||x-sxl-xl||_inf
769
- // // ||x-sxu+xu||_inf
770
- // // ||d-sdl-dl||
771
- // //
772
- // //double sd = fmax(p_smax, (nrmDualBou + nrmDualEqu) / (n + m)) / p_smax;
773
- // //double sc = n == 0 ? 0 : fmax(p_smax, nrmDualBou / n) / p_smax;
774
-
775
- // sd = fmax(p_smax, sd) / p_smax;
776
- // sc = n == 0 ? 0 : fmax(p_smax, sc) / p_smax;
777
-
778
- // sd = fmin(sd, 1e+8);
779
- // sc = fmin(sc, 1e+8);
780
-
781
- // // actual nlp errors
782
- // resid.getNlpErrors(nlpoptim, nlpfeas, nlpcomplem, cons_violation);
783
-
784
- // // finally, the scaled nlp error
785
- // nlpoverall = fmax(nlpoptim / sd, fmax(cons_violation, nlpcomplem / sc));
786
-
787
- // nlp->log->printf(hovWarning,
788
- // "nlpoverall %g nloptim %g sd %g nlpfeas %g nlpcomplem %g sc %g cons_violation %g\n",
789
- // nlpoverall,
790
- // nlpoptim,
791
- // sd,
792
- // nlpfeas,
793
- // nlpcomplem,
794
- // cons_violation,
795
- // sc);
796
-
797
- // // actual log errors
798
- // resid.getBarrierErrors(logoptim, logfeas, logcomplem);
799
-
800
- // // finally, the scaled barrier error
801
- // logoverall = fmax(logoptim / sd, fmax(cons_violation, logcomplem / sc));
802
- // nlp->runStats.tmSolverInternal.stop();
803
- // return true;
804
- // }
805
-
806
715
bool hiopAlgFilterIPMBase::evalNlp_funcOnly (hiopIterate& iter, double & f, hiopVector& c, hiopVector& d)
807
716
{
808
717
bool new_x = true ;
0 commit comments