Skip to content

Commit e4edea2

Browse files
committed
clean up, fixed warnings
1 parent 1caeb33 commit e4edea2

File tree

3 files changed

+42
-45
lines changed

3 files changed

+42
-45
lines changed

src/Optimization/hiopAlgFilterIPM.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,7 @@ bool hiopAlgFilterIPMBase::evalNlpAndLogErrors(const hiopIterate& it,
652652
{
653653
nlp->runStats.tmSolverInternal.start();
654654

655-
size_type n = nlp->n_complem(), m = nlp->m();
656-
// the one norms
657-
// double nrmDualBou=it.normOneOfBoundDuals();
658-
// double nrmDualEqu=it.normOneOfEqualityDuals();
655+
size_type n = nlp->n_complem();
659656
double sc;
660657
double sd;
661658
double nrmDualBou;
@@ -738,7 +735,7 @@ bool hiopAlgFilterIPMBase::evalNlpAndLogErrors2(const hiopIterate& it,
738735
{
739736
nlp->runStats.tmSolverInternal.start();
740737

741-
size_type n = nlp->n_complem(), m = nlp->m();
738+
size_type n = nlp->n_complem();
742739
double sc;
743740
double sd;
744741
double nrmDualBou;

src/Optimization/hiopIterate.cpp

+38-38
Original file line numberDiff line numberDiff line change
@@ -196,45 +196,45 @@ void hiopIterate::setEqualityDualsToConstant(const double& v)
196196
yd->setToConstant(v);
197197
}
198198

199-
double hiopIterate::normOneOfBoundDuals() const
200-
{
201-
#ifdef HIOP_DEEPCHECKS
202-
assert(zl->matchesPattern(nlp->get_ixl()));
203-
assert(zu->matchesPattern(nlp->get_ixu()));
204-
assert(vl->matchesPattern(nlp->get_idl()));
205-
assert(vu->matchesPattern(nlp->get_idu()));
206-
#endif
207-
// work locally with all the vectors. This will result in only one MPI_Allreduce call instead of two.
208-
double nrm1 = zl->onenorm_local() + zu->onenorm_local();
209-
#ifdef HIOP_USE_MPI
210-
double nrm1_global;
211-
int ierr = MPI_Allreduce(&nrm1, &nrm1_global, 1, MPI_DOUBLE, MPI_SUM, nlp->get_comm());
212-
assert(MPI_SUCCESS == ierr);
213-
nrm1 = nrm1_global;
214-
#endif
215-
nrm1 += vl->onenorm_local() + vu->onenorm_local();
216-
return nrm1;
217-
}
199+
// double hiopIterate::normOneOfBoundDuals() const
200+
// {
201+
// #ifdef HIOP_DEEPCHECKS
202+
// assert(zl->matchesPattern(nlp->get_ixl()));
203+
// assert(zu->matchesPattern(nlp->get_ixu()));
204+
// assert(vl->matchesPattern(nlp->get_idl()));
205+
// assert(vu->matchesPattern(nlp->get_idu()));
206+
// #endif
207+
// // work locally with all the vectors. This will result in only one MPI_Allreduce call instead of two.
208+
// double nrm1 = zl->onenorm_local() + zu->onenorm_local();
209+
// #ifdef HIOP_USE_MPI
210+
// double nrm1_global;
211+
// int ierr = MPI_Allreduce(&nrm1, &nrm1_global, 1, MPI_DOUBLE, MPI_SUM, nlp->get_comm());
212+
// assert(MPI_SUCCESS == ierr);
213+
// nrm1 = nrm1_global;
214+
// #endif
215+
// nrm1 += vl->onenorm_local() + vu->onenorm_local();
216+
// return nrm1;
217+
// }
218218

219-
double hiopIterate::normOneOfEqualityDuals() const
220-
{
221-
#ifdef HIOP_DEEPCHECKS
222-
assert(zl->matchesPattern(nlp->get_ixl()));
223-
assert(zu->matchesPattern(nlp->get_ixu()));
224-
assert(vl->matchesPattern(nlp->get_idl()));
225-
assert(vu->matchesPattern(nlp->get_idu()));
226-
#endif
227-
// work locally with all the vectors. This will result in only one MPI_Allreduce call instead of two.
228-
double nrm1 = zl->onenorm_local() + zu->onenorm_local();
229-
#ifdef HIOP_USE_MPI
230-
double nrm1_global;
231-
int ierr = MPI_Allreduce(&nrm1, &nrm1_global, 1, MPI_DOUBLE, MPI_SUM, nlp->get_comm());
232-
assert(MPI_SUCCESS == ierr);
233-
nrm1 = nrm1_global;
234-
#endif
235-
nrm1 += vl->onenorm_local() + vu->onenorm_local() + yc->onenorm_local() + yd->onenorm_local();
236-
return nrm1;
237-
}
219+
// double hiopIterate::normOneOfEqualityDuals() const
220+
// {
221+
// #ifdef HIOP_DEEPCHECKS
222+
// assert(zl->matchesPattern(nlp->get_ixl()));
223+
// assert(zu->matchesPattern(nlp->get_ixu()));
224+
// assert(vl->matchesPattern(nlp->get_idl()));
225+
// assert(vu->matchesPattern(nlp->get_idu()));
226+
// #endif
227+
// // work locally with all the vectors. This will result in only one MPI_Allreduce call instead of two.
228+
// double nrm1 = zl->onenorm_local() + zu->onenorm_local();
229+
// #ifdef HIOP_USE_MPI
230+
// double nrm1_global;
231+
// int ierr = MPI_Allreduce(&nrm1, &nrm1_global, 1, MPI_DOUBLE, MPI_SUM, nlp->get_comm());
232+
// assert(MPI_SUCCESS == ierr);
233+
// nrm1 = nrm1_global;
234+
// #endif
235+
// nrm1 += vl->onenorm_local() + vu->onenorm_local() + yc->onenorm_local() + yd->onenorm_local();
236+
// return nrm1;
237+
// }
238238

239239
// void hiopIterate::normOneOfDuals(double& nrm1Eq, double& nrm1Bnd) const
240240
// {

src/Optimization/hiopIterate.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ class hiopIterate
139139
hiopVector& grad_d) const;
140140

141141
/** norms for individual parts of the iterate (on demand computation) */
142-
virtual double normOneOfBoundDuals() const;
143-
virtual double normOneOfEqualityDuals() const;
142+
//virtual double normOneOfBoundDuals() const;
143+
//virtual double normOneOfEqualityDuals() const;
144144
/* same as above but computed in one shot to save on communication and computation */
145145
//virtual void normOneOfDuals(double& nrm1Eq, double& nrm1Bnd) const;
146146

0 commit comments

Comments
 (0)