Skip to content

Commit

Permalink
add cxx flag NDEBUG to test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nychiang committed Oct 28, 2023
1 parent 27f24ce commit 40fe440
Show file tree
Hide file tree
Showing 60 changed files with 324 additions and 240 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS "-Wall -Werror")
set(CMAKE_CXX_FLAGS "-Wall -Werror -DNDEBUG")

if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
Expand Down
8 changes: 4 additions & 4 deletions src/Drivers/Dense/NlpDenseConsEx1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Ex1Meshing1D::Ex1Meshing1D(double a, double b, size_type glob_n, double r, MPI_C
comm=comm_;
comm_size=1; my_rank=0;
#ifdef HIOP_USE_MPI
int ierr = MPI_Comm_size(comm, &comm_size); assert(MPI_SUCCESS==ierr);
ierr = MPI_Comm_rank(comm, &my_rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(comm, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
ierr = MPI_Comm_rank(comm, &my_rank); assert(MPI_SUCCESS==ierr); (void)ierr;
#endif
// set up vector distribution for primal variables - easier to store it as a member in this simple example
col_partition = new index_type[comm_size+1];
Expand Down Expand Up @@ -121,7 +121,7 @@ double DiscretizedFunction::dotProductWith( const hiopVector& v_ ) const

#ifdef HIOP_USE_MPI
double dotprodG;
int ierr = MPI_Allreduce(&dot, &dotprodG, 1, MPI_DOUBLE, MPI_SUM, comm_); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Allreduce(&dot, &dotprodG, 1, MPI_DOUBLE, MPI_SUM, comm_); assert(MPI_SUCCESS==ierr); (void)ierr;
dot=dotprodG;
#endif
return dot;
Expand Down Expand Up @@ -150,7 +150,7 @@ double DiscretizedFunction::twonorm() const

#ifdef HIOP_USE_MPI
double nrm_squareG;
int ierr = MPI_Allreduce(&nrm_square, &nrm_squareG, 1, MPI_DOUBLE, MPI_SUM, comm_); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Allreduce(&nrm_square, &nrm_squareG, 1, MPI_DOUBLE, MPI_SUM, comm_); assert(MPI_SUCCESS==ierr); (void)ierr;
nrm_square=nrm_squareG;
#endif
return sqrt(nrm_square);
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Dense/NlpDenseConsEx1Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int main(int argc, char **argv)
int rank = 0;
#ifdef HIOP_USE_MPI
int numRanks = 1;
int err;
int err; (void)err;
err = MPI_Init(&argc, &argv); assert(MPI_SUCCESS==err);
err = MPI_Comm_rank(MPI_COMM_WORLD,&rank); assert(MPI_SUCCESS==err);
err = MPI_Comm_size(MPI_COMM_WORLD,&numRanks); assert(MPI_SUCCESS==err);
Expand Down
8 changes: 4 additions & 4 deletions src/Drivers/Dense/NlpDenseConsEx2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ DenseConsEx2::DenseConsEx2(int n, bool unconstrained)
my_rank = 0;
#ifdef HIOP_USE_MPI
comm = MPI_COMM_WORLD;
int ierr = MPI_Comm_size(comm, &comm_size); assert(MPI_SUCCESS==ierr);
ierr = MPI_Comm_rank(comm, &my_rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(comm, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
ierr = MPI_Comm_rank(comm, &my_rank); assert(MPI_SUCCESS==ierr); (void)ierr;
#endif

if(unconstrained_) {
Expand Down Expand Up @@ -111,7 +111,7 @@ bool DenseConsEx2::eval_f(const size_type& n, const double* x, bool new_x, doubl
}
#ifdef HIOP_USE_MPI
double obj_global;
int ierr = MPI_Allreduce(&obj_value, &obj_global, 1, MPI_DOUBLE, MPI_SUM, comm); assert(ierr==MPI_SUCCESS);
int ierr = MPI_Allreduce(&obj_value, &obj_global, 1, MPI_DOUBLE, MPI_SUM, comm); assert(MPI_SUCCESS==ierr); (void)ierr;
obj_value = obj_global;
#endif
return true;
Expand Down Expand Up @@ -212,7 +212,7 @@ bool DenseConsEx2::eval_cons(const size_type& n,
#ifdef HIOP_USE_MPI
if(num_cons>0) {
double* cons_global = new double[num_cons];
int ierr = MPI_Allreduce(cons, cons_global, num_cons, MPI_DOUBLE, MPI_SUM, comm); assert(ierr==MPI_SUCCESS);
int ierr = MPI_Allreduce(cons, cons_global, num_cons, MPI_DOUBLE, MPI_SUM, comm); assert(MPI_SUCCESS==ierr); (void)ierr;
memcpy(cons, cons_global, num_cons*sizeof(double));
delete[] cons_global;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Dense/NlpDenseConsEx2Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int ierr = MPI_Comm_rank(MPI_COMM_WORLD,&rank);
assert(MPI_SUCCESS==ierr);
assert(MPI_SUCCESS==ierr); (void)ierr;
//if(0==rank) printf("Support for MPI is enabled\n");
#endif
bool selfCheck;
Expand Down
8 changes: 4 additions & 4 deletions src/Drivers/Dense/NlpDenseConsEx3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class DenseConsEx3 : public hiop::hiopInterfaceDenseConstraints
comm_size=1; my_rank=0;
#ifdef HIOP_USE_MPI
comm = MPI_COMM_WORLD;
int ierr = MPI_Comm_size(comm, &comm_size); assert(MPI_SUCCESS==ierr);
ierr = MPI_Comm_rank(comm, &my_rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(comm, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
ierr = MPI_Comm_rank(comm, &my_rank); assert(MPI_SUCCESS==ierr); (void)ierr;
#endif

// set up vector distribution for primal variables - easier to store it as a member in this simple example
Expand Down Expand Up @@ -103,7 +103,7 @@ class DenseConsEx3 : public hiop::hiopInterfaceDenseConstraints
for(int i=0;i<n_local;i++) obj_value += 0.25*pow(x[i]-1., 4);
#ifdef HIOP_USE_MPI
double obj_global;
int ierr=MPI_Allreduce(&obj_value, &obj_global, 1, MPI_DOUBLE, MPI_SUM, comm); assert(ierr==MPI_SUCCESS);
int ierr=MPI_Allreduce(&obj_value, &obj_global, 1, MPI_DOUBLE, MPI_SUM, comm); assert(MPI_SUCCESS==ierr); (void)ierr;
obj_value=obj_global;
#endif
return true;
Expand Down Expand Up @@ -151,7 +151,7 @@ class DenseConsEx3 : public hiop::hiopInterfaceDenseConstraints

#ifdef HIOP_USE_MPI
double* cons_global=new double[num_cons];
int ierr=MPI_Allreduce(cons, cons_global, num_cons, MPI_DOUBLE, MPI_SUM, comm); assert(ierr==MPI_SUCCESS);
int ierr=MPI_Allreduce(cons, cons_global, num_cons, MPI_DOUBLE, MPI_SUM, comm); assert(MPI_SUCCESS==ierr); (void)ierr;
memcpy(cons, cons_global, num_cons*sizeof(double));
delete[] cons_global;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Dense/NlpDenseConsEx3Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int ierr = MPI_Comm_rank(MPI_COMM_WORLD,&rank);
assert(MPI_SUCCESS==ierr);
assert(MPI_SUCCESS==ierr); (void)ierr;
//if(0==rank) printf("Support for MPI is enabled\n");
#endif
bool selfCheck; size_type n;
Expand Down
8 changes: 4 additions & 4 deletions src/Drivers/Dense/NlpDenseConsEx4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ DenseConsEx4::DenseConsEx4()
my_rank = 0;
#ifdef HIOP_USE_MPI
comm = MPI_COMM_WORLD;
int ierr = MPI_Comm_size(comm, &comm_size); assert(MPI_SUCCESS==ierr);
ierr = MPI_Comm_rank(comm, &my_rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(comm, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
ierr = MPI_Comm_rank(comm, &my_rank); assert(MPI_SUCCESS==ierr); (void)ierr;
#endif

if(unconstrained_) {
Expand Down Expand Up @@ -114,7 +114,7 @@ bool DenseConsEx4::eval_f(const size_type& n, const double* x, bool new_x, doubl

#ifdef HIOP_USE_MPI
double obj_global;
int ierr = MPI_Allreduce(&obj_value, &obj_global, 1, MPI_DOUBLE, MPI_SUM, comm); assert(ierr==MPI_SUCCESS);
int ierr = MPI_Allreduce(&obj_value, &obj_global, 1, MPI_DOUBLE, MPI_SUM, comm); assert(MPI_SUCCESS==ierr); (void)ierr;
obj_value = obj_global;
#endif
return true;
Expand Down Expand Up @@ -220,7 +220,7 @@ bool DenseConsEx4::eval_cons(const size_type& n,
#ifdef HIOP_USE_MPI
if(num_cons>0) {
double* cons_global = new double[num_cons];
int ierr = MPI_Allreduce(cons, cons_global, num_cons, MPI_DOUBLE, MPI_SUM, comm); assert(ierr==MPI_SUCCESS);
int ierr = MPI_Allreduce(cons, cons_global, num_cons, MPI_DOUBLE, MPI_SUM, comm); assert(MPI_SUCCESS==ierr); (void)ierr;
memcpy(cons, cons_global, num_cons*sizeof(double));
delete[] cons_global;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Dense/NlpDenseConsEx4Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int ierr = MPI_Comm_rank(MPI_COMM_WORLD,&rank);
assert(MPI_SUCCESS==ierr);
assert(MPI_SUCCESS==ierr); (void)ierr;
//if(0==rank) printf("Support for MPI is enabled\n");
#endif
bool selfCheck;
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/MDS/NlpMdsEx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ int main(int argc, char **argv) {
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
//int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
//int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr); (void)ierr;
if(comm_size != 1) {
printf("[error] driver detected more than one rank but the driver should be run "
"in serial only; will exit\n");
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/MDS/NlpMdsEx1Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
//int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
//int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr); (void)ierr;
if(comm_size != 1) {
printf("[error] driver detected more than one rank but the driver should be run "
"in serial only; will exit\n");
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/MDS/NlpMdsEx1RajaDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
//int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
//int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr); (void)ierr;
if(comm_size != 1) {
printf("[error] driver detected more than one rank but the driver should be run "
"in serial only; will exit\n");
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/MDS/NlpMdsEx2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ class MdsEx2 : public hiop::hiopInterfaceMDS
//values for sparse Jacobian if requested by the solver
if(MJacS!=NULL) {
int nnzit=0;
int con_idx=0;
int con_idx=0; (void)con_idx;

//sparse Jacobian EQ w.r.t. x and s
for(int i=0; i<ns_; i++) {
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/MDS/NlpMdsEx2Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
//int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
//int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr); (void)ierr;
if(comm_size != 1) {
printf("[error] driver detected more than one rank but the driver should be run "
"in serial only; will exit\n");
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/PriDec/NlpPriDecEx1Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr); (void)ierr;
#endif

#ifdef HIOP_USE_MAGMA
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/PriDec/NlpPriDecEx2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ bool PriDecMasterProbleEx2::eval_f_rterm(size_type idx, const int& n, const doub
assert(nx_==n);
rval=-1e+20;
double* xi;
hiopSolveStatus status;
hiopSolveStatus status; (void)status;

#ifdef HIOP_USE_MPI
// uncomment if want to monitor contingency computing time
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/PriDec/NlpPriDecEx2Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr); (void)ierr;
#endif

#ifdef HIOP_USE_MAGMA
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/PriDec/NlpPriDecEx2Sparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool PriDecMasterProbleEx2Sparse::eval_f_rterm(size_type idx, const int& n, cons
{
assert(nx_==n);
rval=-1e+20;
hiopSolveStatus status;
hiopSolveStatus status; (void)status;
double* xi;

#ifdef HIOP_USE_MPI
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/PriDec/NlpPriDecEx2SparseDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr); (void)ierr;
#endif

int nx = 20; //nx == ny for this problem
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/PriDec/NlpPriDecEx2SparseRajaDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr); (void)ierr;
#endif

#ifdef HIOP_USE_MAGMA
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/PriDec/NlpPriDecEx2UserBasecase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class PriDecBasecaseProbleEx2 : public SparseEx1

void get_rec_obj(const size_type& n, const double* x, double& obj_value)
{
bool temp = rec_evaluator_->eval_f(n, x, false, obj_value);
bool temp = rec_evaluator_->eval_f(n, x, false, obj_value); (void)temp;
assert(temp);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/PriDec/NlpPriDecEx3SparseDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr); (void)ierr;
double t3 = MPI_Wtime();
double t4 = 0.;
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/Sparse/NlpSparseCEx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ int main(int argc, char **argv) {
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
//int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
//int ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); assert(MPI_SUCCESS==ierr); (void)ierr;
if(comm_size != 1) {
printf("[error] driver detected more than one rank but the driver should be run "
"in serial only; will exit\n");
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Sparse/NlpSparseEx1Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
if(comm_size != 1) {
printf("[error] driver detected more than one rank but the driver should be run "
"in serial only; will exit\n");
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Sparse/NlpSparseEx2Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
if(comm_size != 1) {
printf("[error] driver detected more than one rank but the driver should be run "
"in serial only; will exit\n");
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Sparse/NlpSparseEx3Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
if(comm_size != 1) {
printf("[error] driver detected more than one rank but the driver should be run "
"in serial only; will exit\n");
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Sparse/NlpSparseEx4Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
if(comm_size != 1) {
printf("[error] driver detected more than one rank but the driver should be run "
"in serial only; will exit\n");
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Sparse/NlpSparseRajaEx2Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ int main(int argc, char **argv)
#ifdef HIOP_USE_MPI
MPI_Init(&argc, &argv);
int comm_size;
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr);
int ierr = MPI_Comm_size(MPI_COMM_WORLD, &comm_size); assert(MPI_SUCCESS==ierr); (void)ierr;
if(comm_size != 1) {
printf("[error] driver detected more than one rank but the driver should be run "
"in serial only; will exit\n");
Expand Down
2 changes: 1 addition & 1 deletion src/Interface/chiopInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int hiop_mds_create_problem(cHiopMDSProblem *prob) {
}

int hiop_mds_solve_problem(cHiopMDSProblem *prob) {
hiopSolveStatus status;
hiopSolveStatus status; (void)status;
hiopAlgFilterIPMNewton solver(prob->refcppHiop);
status = solver.run();
assert(status<=hiopSolveStatus::User_Stopped); //check solver status if necessary
Expand Down
2 changes: 1 addition & 1 deletion src/LinAlg/hiopMatrixComplexDense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace hiop
int P=0;
if(col_part) {
#ifdef HIOP_USE_MPI
int ierr=MPI_Comm_rank(comm_, &P); assert(ierr==MPI_SUCCESS);
int ierr=MPI_Comm_rank(comm_, &P); assert(MPI_SUCCESS==ierr); (void)ierr;
#endif
glob_jl_=col_part[P]; glob_ju_=col_part[P+1];
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/LinAlg/hiopMatrixComplexSparseTriplet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ namespace hiop
int* iRow = stM->i_row();
int* jCol = stM->j_col();
int nnz = stM->numberOfNonzeros();
#ifndef NDEBUG
int ncols = stM->n();
#endif
// y += alpha*this*x
for(int i=0; i<nnz; i++) {
assert(iRow[i] < nrows);
Expand Down
Loading

0 comments on commit 40fe440

Please sign in to comment.