Skip to content

Commit

Permalink
testing and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
cnpetra committed Sep 14, 2024
1 parent 0506d38 commit b785475
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/Optimization/hiopAlgFilterIPM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,7 @@ hiopSolveStatus hiopAlgFilterIPMQuasiNewton::run()
//
//checkpoint load from file
//
#ifdef HIOP_USE_AXOM
//load from file: will populate it_curr, _Hess_lagr, and algorithmic parameters
auto chkpnt_ok = load_state_from_file(nlp->options->GetString("checkpoint_file"));
if(!chkpnt_ok) {
Expand All @@ -1012,6 +1013,11 @@ hiopSolveStatus hiopAlgFilterIPMQuasiNewton::run()
_mu=mu0;
iter_num_total_ = 0;
}
#else
nlp->log->printf(hovWarning,
"Unexpected checkpoint misconfiguration. "
"Will use user-provided starting point.\n");
#endif
}
//additionally: need to evaluate the nlp
if(!this->evalNlp_noHess(*it_curr, _f_nlp, *_c, *_d, *_grad_f, *_Jac_c, *_Jac_d)) {
Expand Down
10 changes: 5 additions & 5 deletions src/Optimization/hiopHessianLowRank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ void hiopHessianLowRank::updateInternalBFGSRepresentation()
const size_t buffsize=l*l*sizeof(double);
memcpy(_buff1_lxlx3, DpYtDhInvY.local_data(), buffsize);
#else
DpYtDhInvY.addDiagonal(1., *D);
V->copyBlockFromMatrix(l,l,DpYtDhInvY);
DpYtDhInvY.addDiagonal(1., *D_);
V_->copyBlockFromMatrix(l,l,DpYtDhInvY);
#endif

//-- block (1,2)
Expand All @@ -436,9 +436,9 @@ void hiopHessianLowRank::updateInternalBFGSRepresentation()
memcpy(_buff1_lxlx3+l*l, StB0DhInvYmL.local_data(), buffsize);
#else
//substract L
StB0DhInvYmL.addMatrix(-1.0, *L);
StB0DhInvYmL.addMatrix(-1.0, *L_);
// (1,2) block in V
V->copyBlockFromMatrix(0,l,StB0DhInvYmL);
V_->copyBlockFromMatrix(0,l,StB0DhInvYmL);
#endif

//-- block (2,2)
Expand All @@ -450,7 +450,7 @@ void hiopHessianLowRank::updateInternalBFGSRepresentation()
#ifdef HIOP_USE_MPI
memcpy(_buff1_lxlx3+2*l*l, DpYtDhInvY.local_data(), buffsize);
#else
V->copyBlockFromMatrix(0,0,StDS);
V_->copyBlockFromMatrix(0,0,StDS);
#endif


Expand Down
2 changes: 1 addition & 1 deletion src/Optimization/hiopKKTLinSys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ bool hiopKKTLinSys::compute_directions_w_IR(const hiopResidual* resid, hiopItera
bool bret = bicgIR_->solve(dir, resid);

nlp_->runStats.kkt.nIterRefinInner += bicgIR_->get_sol_num_iter();
nlp_->runStats.kkt.tmSolveInner.stop();
//nlp_->runStats.kkt.tmSolveInner.stop();
if(!bret) {
nlp_->log->printf(hovWarning, "%s", bicgIR_->get_convergence_info().c_str());

Expand Down

0 comments on commit b785475

Please sign in to comment.