Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCOPFLOW HiOp Patch #2

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ install/*
.ubuild.json
*__pycache__*
*nvblas.conf
spack*
spack-*
.vscode/
coinhsl-*
node_modules
Expand Down
2 changes: 1 addition & 1 deletion buildsystem/spack/ascent/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spack:
exago:
require: +raja+hiop+ipopt
hiop:
require: '@1.0.0+sparse+mpi+ginkgo+kron+cusolver_lu'
require: '@develop+sparse+mpi+ginkgo+kron+cusolver_lu'
coinhsl:
require: '@2019.05.21'
ipopt:
Expand Down
2 changes: 1 addition & 1 deletion buildsystem/spack/deception/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spack:
exago:
require: +raja+hiop+ipopt
hiop:
require: '@1.0.0+sparse+mpi+ginkgo+kron'
require: '@develop+sparse+mpi+ginkgo+kron'
magma:
require: '@2.6.2'
coinhsl:
Expand Down
4 changes: 2 additions & 2 deletions buildsystem/spack/incline/modules/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ module load ipopt/3.12.10-clang-15.0.0-rocm5.3.0-7o6pau6
module load python/3.11.4-clang-15.0.0-rocm5.3.0-hpuu3g4
# petsc@=3.18.6%clang@=15.0.0-rocm5.3.0 cxxflags="--gcc-toolchain=/share/apps/gcc/8.4.0/" ~X~batch~cgns~complex~cuda~debug+double~exodusii~fftw+fortran~giflib~hdf5~hpddm~hwloc~hypre~int64~jpeg~knl~kokkos~libpng~libyaml~memkind~metis~mkl-pardiso~mmg~moab~mpfr+mpi~mumps~openmp~p4est~parmmg~ptscotch~random123~rocm~saws~scalapack+shared~strumpack~suite-sparse~superlu-dist~tetgen~trilinos~valgrind build_system=generic clanguage=C memalign=none arch=linux-centos7-zen
module load petsc/3.18.6-clang-15.0.0-rocm5.3.0-42hbmrj
# exago@=develop%clang@=15.0.0-rocm5.3.0 cxxflags="--gcc-toolchain=/share/apps/gcc/8.4.0/" ~cuda+hiop~ipo+ipopt~logging+mpi~python+raja+rocm amdgpu_target=gfx908 build_system=cmake build_type=Release dev_path=/people/svcexasgd/gitlab/23508/spack_incline generator=make arch=linux-centos7-zen
## module load exago/develop-clang-15.0.0-rocm5.3.0-fzoncup
# exago@=develop%clang@=15.0.0-rocm5.3.0 cxxflags="--gcc-toolchain=/share/apps/gcc/8.4.0/" ~cuda+hiop~ipo+ipopt~logging+mpi~python+raja+rocm amdgpu_target=gfx908 build_system=cmake build_type=Release dev_path=/people/svcexasgd/gitlab/25308/spack_incline generator=make arch=linux-centos7-zen
## module load exago/develop-clang-15.0.0-rocm5.3.0-n5ll2cc
4 changes: 2 additions & 2 deletions buildsystem/spack/incline/modules/exago.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module use -a /qfs/projects/exasgd/src/ci-incline/install/modules/linux-centos7-zen
# exago@=develop%clang@=15.0.0-rocm5.3.0 cxxflags="--gcc-toolchain=/share/apps/gcc/8.4.0/" ~cuda+hiop~ipo+ipopt~logging+mpi~python+raja+rocm amdgpu_target=gfx908 build_system=cmake build_type=Release dev_path=/people/svcexasgd/gitlab/23508/spack_incline generator=make arch=linux-centos7-zen
module load exago/develop-clang-15.0.0-rocm5.3.0-fzoncup
# exago@=develop%clang@=15.0.0-rocm5.3.0 cxxflags="--gcc-toolchain=/share/apps/gcc/8.4.0/" ~cuda+hiop~ipo+ipopt~logging+mpi~python+raja+rocm amdgpu_target=gfx908 build_system=cmake build_type=Release dev_path=/people/svcexasgd/gitlab/25308/spack_incline generator=make arch=linux-centos7-zen
module load exago/develop-clang-15.0.0-rocm5.3.0-n5ll2cc
2 changes: 1 addition & 1 deletion buildsystem/spack/incline/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spack:
hiop:
# TODO - build with Ginkgo #463
# TODO - updgrade to develop / 1.0.0 #28
require: '@1.0.0+sparse+mpi+raja+rocm~ginkgo+kron'
require: '@develop+sparse+mpi+raja+rocm~ginkgo+kron'
ipopt:
require: '@3.12.10~metis+coinhsl~mumps'
# Pin version of OpenBlas for testing results
Expand Down
2 changes: 1 addition & 1 deletion buildsystem/spack/newell/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spack:
exago:
require: +raja+hiop+ipopt
hiop:
require: '@1.0.0+sparse+mpi+ginkgo+kron'
require: '@develop+sparse+mpi+ginkgo+kron'
magma:
require: '@2.6.2'
coinhsl:
Expand Down
13 changes: 7 additions & 6 deletions src/scopflow/solver/hiop/scopflow_hiop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ extern PetscErrorCode SCOPFLOWUpdateOPFLOWVariableBounds(OPFLOW, Vec, Vec,
/* Note: x only holds the coupled variables which, in this case, are the
generator real power variables for the base-case
*/
bool SCOPFLOWHIOPInterface::eval_f_rterm(size_t idx, const int &n,
bool SCOPFLOWHIOPInterface::eval_f_rterm(hiop::size_type idx, const int &n,
const double *x, double &rval) {
PetscErrorCode ierr;
OPFLOW opflow0; /* base case OPFLOW */
Expand Down Expand Up @@ -245,7 +245,8 @@ bool SCOPFLOWHIOPInterface::eval_f_rterm(size_t idx, const int &n,
return true;
}

bool SCOPFLOWHIOPInterface::eval_grad_rterm(size_t idx, const int &n, double *x,
bool SCOPFLOWHIOPInterface::eval_grad_rterm(hiop::size_type idx, const int &n,
double *x,
hiop::hiopVector &gradvec) {
(void)idx;
(void)n;
Expand Down Expand Up @@ -310,12 +311,12 @@ bool SCOPFLOWHIOPInterface::eval_grad_rterm(size_t idx, const int &n, double *x,
return true;
}

size_t SCOPFLOWHIOPInterface::get_num_rterms() const {
return scopflow->Nc - 1;
hiop::size_type SCOPFLOWHIOPInterface::get_num_rterms() const {
return (hiop::size_type)scopflow->Nc - 1;
}

size_t SCOPFLOWHIOPInterface::get_num_vars() const {
return scopflow->opflow0->nx;
hiop::size_type SCOPFLOWHIOPInterface::get_num_vars() const {
return (hiop::size_type)scopflow->opflow0->nx;
}

void SCOPFLOWHIOPInterface::get_solution(double *x) const {
Expand Down
9 changes: 5 additions & 4 deletions src/scopflow/solver/hiop/scopflow_hiop.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ class SCOPFLOWHIOPInterface : public hiop::hiopInterfacePriDecProblem {
const double *hess,
const char *master_options_file);

bool eval_f_rterm(size_t idx, const int &n, const double *x, double &rval);
bool eval_grad_rterm(size_t idx, const int &n, double *x,
bool eval_f_rterm(hiop::size_type idx, const int &n, const double *x,
double &rval);
bool eval_grad_rterm(hiop::size_type idx, const int &n, double *x,
hiop::hiopVector &grad);

size_t get_num_rterms() const;
hiop::size_type get_num_rterms() const;

size_t get_num_vars() const;
hiop::size_type get_num_vars() const;

void get_solution(double *x) const;

Expand Down
9 changes: 5 additions & 4 deletions src/sopflow/solver/hiop/sopflow_hiop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ extern PetscErrorCode SOPFLOWUpdateOPFLOWVariableBounds(OPFLOW, Vec, Vec,
/* Note: x only holds the coupled variables which, in this case, are the
generator real power variables for the base-case
*/
bool SOPFLOWHIOPInterface::eval_f_rterm(size_t idx, const int &n,
bool SOPFLOWHIOPInterface::eval_f_rterm(hiop::size_type idx, const int &n,
const double *x, double &rval) {
(void)n;
PetscErrorCode ierr;
Expand Down Expand Up @@ -283,7 +283,8 @@ bool SOPFLOWHIOPInterface::eval_f_rterm(size_t idx, const int &n,
return true;
}

bool SOPFLOWHIOPInterface::eval_grad_rterm(size_t idx, const int &n, double *x,
bool SOPFLOWHIOPInterface::eval_grad_rterm(hiop::size_type idx, const int &n,
double *x,
hiop::hiopVector &gradvec) {
(void)idx;
(void)n;
Expand Down Expand Up @@ -349,11 +350,11 @@ bool SOPFLOWHIOPInterface::eval_grad_rterm(size_t idx, const int &n, double *x,
return true;
}

size_t SOPFLOWHIOPInterface::get_num_rterms() const {
hiop::size_type SOPFLOWHIOPInterface::get_num_rterms() const {
return (sopflow->Ns * sopflow->Nc) - 1;
}

size_t SOPFLOWHIOPInterface::get_num_vars() const {
hiop::size_type SOPFLOWHIOPInterface::get_num_vars() const {
return sopflow->opflow0->nx;
}

Expand Down
9 changes: 5 additions & 4 deletions src/sopflow/solver/hiop/sopflow_hiop.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ class SOPFLOWHIOPInterface : public hiop::hiopInterfacePriDecProblem {
const double *hess,
const char *master_options_file);

bool eval_f_rterm(size_t idx, const int &n, const double *x, double &rval);
bool eval_grad_rterm(size_t idx, const int &n, double *x,
bool eval_f_rterm(hiop::size_type idx, const int &n, const double *x,
double &rval);
bool eval_grad_rterm(hiop::size_type idx, const int &n, double *x,
hiop::hiopVector &grad);

size_t get_num_rterms() const;
hiop::size_type get_num_rterms() const;

size_t get_num_vars() const;
hiop::size_type get_num_vars() const;

void get_solution(double *x) const;

Expand Down
28 changes: 0 additions & 28 deletions tests/functionality/scopflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ if(EXAGO_INSTALL_TESTS)
HOST
)

if(EXAGO_ENABLE_IPOPT AND EXAGO_ENABLE_HIOP)
set_tests_properties(
FUNCTIONALITY_TEST_SCOPFLOW_HIOP_PBHIOP_TESTSUITE
PROPERTIES LABELS "newell-skip;deception-skip"
)
endif()

exago_add_test(
NAME
FUNCTIONALITY_TEST_SCOPFLOW_HIOP_PBHIOP_MPI_TESTSUITE
Expand Down Expand Up @@ -120,13 +113,6 @@ if(EXAGO_INSTALL_TESTS)
${CMAKE_CURRENT_SOURCE_DIR}/hiop_cont_mpi.toml
)

if(EXAGO_ENABLE_IPOPT AND EXAGO_ENABLE_HIOP)
set_tests_properties(
FUNCTIONALITY_TEST_SCOPFLOW_HIOP_MPI_TESTSUITE PROPERTIES LABELS
"incline-skip"
)
endif()

exago_add_test(
NAME
FUNCTIONALITY_TEST_SCOPFLOW_HIOP_SERIAL_TESTSUITE
Expand All @@ -141,13 +127,6 @@ if(EXAGO_INSTALL_TESTS)
${CMAKE_CURRENT_SOURCE_DIR}/hiop_serial.toml
)

if(EXAGO_ENABLE_IPOPT AND EXAGO_ENABLE_HIOP)
set_tests_properties(
FUNCTIONALITY_TEST_SCOPFLOW_HIOP_SERIAL_TESTSUITE
PROPERTIES LABELS "incline-skip;deception-skip"
)
endif()

exago_add_test(
NAME
FUNCTIONALITY_TEST_SCOPFLOW_HIOP_RAJA_TESTSUITE
Expand All @@ -162,13 +141,6 @@ if(EXAGO_INSTALL_TESTS)
${CMAKE_CURRENT_SOURCE_DIR}/hiop_raja.toml
)

if(EXAGO_ENABLE_IPOPT AND EXAGO_ENABLE_HIOP)
set_tests_properties(
FUNCTIONALITY_TEST_SCOPFLOW_HIOP_RAJA_TESTSUITE
PROPERTIES LABELS "incline-skip;deception-skip"
)
endif()

foreach(fmt "MATPOWER" "CSV" "JSON" "MINIMAL")
set(tname "SCOPFLOW_SOLUTION_OUTPUT_${fmt}")
exago_add_test(
Expand Down