Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
cnpetra committed Sep 13, 2024
1 parent a664e35 commit 261ccf9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/Drivers/Dense/NlpDenseConsEx1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ bool DenseConsEx1::iterate_callback(int iter,
{
#ifdef HIOP_USE_AXOM
//save state to sidre::Group every 5 iterations if a solver/algorithm object was provided
if(iter > 0 && (iter % 5 == 0) &&nullptr!=solver_) {
if(iter > 0 && (iter % 5 == 0) && nullptr!=solver_) {
//
//Example of how to save HiOp state to axom::sidre::Group
//
Expand All @@ -222,7 +222,7 @@ bool DenseConsEx1::iterate_callback(int iter,
//the actual saving of state to group
try {
solver_->save_state_to_sidre_group(*group);
} catch(::std::runtime_error& e) {
} catch(std::runtime_error& e) {
//user chooses action when an error occured in saving the state...
//we choose to stop HiOp
return false;
Expand Down
11 changes: 0 additions & 11 deletions src/Drivers/Dense/NlpDenseConsEx1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@
#define MPI_Comm int
#endif

#ifdef HIOP_USE_AXOM
namespace axom {
namespace sidre {
// forward declarations
class DataStore;
class Group;
}
}
#endif


#include <iostream>

/* Example 1: a simple infinite-dimensional QP in the optimiz. function variable x:[0,1]->R
Expand Down
6 changes: 3 additions & 3 deletions src/Drivers/Dense/NlpDenseConsEx1Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ static bool do_load_checkpoint_test(const size_type& mesh_size,

//Supposedly, the user code should have the group in hand before asking HiOp to load from it.
//We will manufacture it by loading a sidre checkpoint file. Here the checkpoint file
// "hiop_state_ex1.root" was created from the interface class' iterate_callback method
// (saved every 5 iterations)
//"hiop_state_ex1.root" was created from the interface class' iterate_callback method
//(saved every 5 iterations)
sidre::DataStore ds;

try {
Expand All @@ -199,7 +199,7 @@ static bool do_load_checkpoint_test(const size_type& mesh_size,

//the actual API call
try {
const sidre::Group* group = ds.getRoot()->getGroup("hiop state ex11");
const sidre::Group* group = ds.getRoot()->getGroup("hiop state ex1");
solver.load_state_from_sidre_group(*group);
} catch(std::runtime_error& e) {
printf("Failed to load from sidre::group. Error: [%s]", e.what());
Expand Down
2 changes: 0 additions & 2 deletions src/Optimization/hiopAlgFilterIPM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,8 @@ class hiopAlgFilterIPMQuasiNewton : public hiopAlgFilterIPMBase

private:
hiopNlpDenseConstraints* nlpdc;
#ifdef HIOP_USE_AXOM
///@brief Indicates whether load checkpoint API was called previous to run method.
bool load_state_api_called_;
#endif // HIOP_USE_AXOM

private:
hiopAlgFilterIPMQuasiNewton() : hiopAlgFilterIPMBase(NULL) {};
Expand Down

0 comments on commit 261ccf9

Please sign in to comment.