Skip to content

Commit

Permalink
EQP criterion option (#52)
Browse files Browse the repository at this point in the history
* nnls criterion option

* minor fix

* using nick-fields/retry@v3
  • Loading branch information
dreamer2368 authored Jul 10, 2024
1 parent 28d1552 commit e8d940c
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 159 deletions.
226 changes: 155 additions & 71 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,97 +38,181 @@ jobs:
cmake .. -DBUILD_SKETCHES=On
make -j 4
- name: Test parser
run: |
cd ${GITHUB_WORKSPACE}/build/test
./test_parser
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./test_parser
- name: Test DG integrator
run: |
cd ${GITHUB_WORKSPACE}/build/test
./dg_integ_mms
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./dg_integ_mms
- name: Test linalg_utils
run: |
cd ${GITHUB_WORKSPACE}/build/test
./test_linalg_utils
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./test_linalg_utils
- name: Test nonlinear integrator gradient
run: |
cd ${GITHUB_WORKSPACE}/build/test
./nonlinear_integ_grad
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./nonlinear_integ_grad
- name: Test nonlinear interface integrator gradient
run: |
cd ${GITHUB_WORKSPACE}/build/test
./interfaceinteg_grad
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./interfaceinteg_grad
- name: Test ROM NonlinearForm
run: |
cd ${GITHUB_WORKSPACE}/build/test
./test_rom_nonlinearform
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./test_rom_nonlinearform
- name: Test ROM InterfaceForm
run: |
cd ${GITHUB_WORKSPACE}/build/test
./test_rom_interfaceform
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./test_rom_interfaceform
- name: Test Poisson DD solver
run: |
cd ${GITHUB_WORKSPACE}/build/test
./poisson_dd_mms
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./poisson_dd_mms
- name: Test Stokes DD solver
run: |
cd ${GITHUB_WORKSPACE}/build/test
./stokes_dd_mms
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./stokes_dd_mms
- name: Test SteadyNS DD solver
run: |
cd ${GITHUB_WORKSPACE}/build/test
./steady_ns_dd_mms
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./steady_ns_dd_mms
- name: Test UnsteadyNS DD solver
run: |
cd ${GITHUB_WORKSPACE}/build/test
./unsteady_ns_dd_mms
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./unsteady_ns_dd_mms
- name: Test LinearElastic DD solver
run: |
cd ${GITHUB_WORKSPACE}/build/test
./linelast_dd_mms
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./linelast_dd_mms
- name: Test parametrized problem
run: |
cd ${GITHUB_WORKSPACE}/build/test
./test_param_prob
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./test_param_prob
- name: Test workflow
run: |
cd ${GITHUB_WORKSPACE}/build/test
./test_workflow
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./test_workflow
- name: Test hdf5 utils
run: |
cd ${GITHUB_WORKSPACE}/build/test
./test_hdf5
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./test_hdf5
- name: Test component topology handler
run: |
cd ${GITHUB_WORKSPACE}/build/test
./test_topol
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./test_topol
- name: Test block matrix preconditioner
run: |
cd ${GITHUB_WORKSPACE}/build/test
./test_block_smoother
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./test_block_smoother
- name: Test multi-component domain decomposition
run: |
cd ${GITHUB_WORKSPACE}/build/test/gmsh
echo 'if [ -f "./multi_comp_dd_mms" ]; then ./multi_comp_dd_mms; else echo "multi_comp_dd_mms does not exist. Passing the test."; fi' >> command.sh
sh command.sh
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test/gmsh
echo 'if [ -f "./multi_comp_dd_mms" ]; then ./multi_comp_dd_mms; else echo "multi_comp_dd_mms does not exist. Passing the test."; fi' >> command.sh
sh command.sh
- name: Test Stokes multi-component domain decomposition
run: |
cd ${GITHUB_WORKSPACE}/build/test/gmsh
echo 'if [ -f "./stokes_multi_comp_dd_mms" ]; then ./stokes_multi_comp_dd_mms; else echo "stokes_multi_comp_dd_mms does not exist. Passing the test."; fi' >> command.sh
sh command.sh
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test/gmsh
echo 'if [ -f "./stokes_multi_comp_dd_mms" ]; then ./stokes_multi_comp_dd_mms; else echo "stokes_multi_comp_dd_mms does not exist. Passing the test."; fi' >> command.sh
sh command.sh
- name: Test multi-component workflow
run: |
cd ${GITHUB_WORKSPACE}/build/test/gmsh
echo 'if [ -f "./test_multi_comp_workflow" ]; then ./test_multi_comp_workflow; else echo "test_multi_comp_workflow does not exist. Passing the test."; fi' >> command.sh
sh command.sh
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test/gmsh
echo 'if [ -f "./test_multi_comp_workflow" ]; then ./test_multi_comp_workflow; else echo "test_multi_comp_workflow does not exist. Passing the test."; fi' >> command.sh
sh command.sh
- name: Test parallel POD/EQP
run: |
cd ${GITHUB_WORKSPACE}/build/test
./test_ns_parallel --gtest_filter=NSTensor.Sampling
mpirun -n 3 --oversubscribe ./test_ns_parallel --gtest_filter=NSTensor.Train
./test_ns_parallel --gtest_filter=NSTensor.Build_SingleRun
./test_ns_parallel --gtest_filter=NSEQP.Sampling
mpirun -n 3 --oversubscribe ./test_ns_parallel --gtest_filter=NSEQP.Train
./test_ns_parallel --gtest_filter=NSEQP.Build_SingleRun
uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 3
command: |
cd ${GITHUB_WORKSPACE}/build/test
./test_ns_parallel --gtest_filter=NSTensor.Sampling
mpirun -n 3 --oversubscribe ./test_ns_parallel --gtest_filter=NSTensor.Train
./test_ns_parallel --gtest_filter=NSTensor.Build_SingleRun
./test_ns_parallel --gtest_filter=NSEQP.Sampling
mpirun -n 3 --oversubscribe ./test_ns_parallel --gtest_filter=NSEQP.Train
./test_ns_parallel --gtest_filter=NSEQP.Build_SingleRun
# - name: Upload the compiled artifacts
# uses: actions/upload-artifact@master
# with:
Expand Down
79 changes: 0 additions & 79 deletions dependencies/FindMETIS.cmake

This file was deleted.

6 changes: 2 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WORKDIR $LIB_DIR
RUN sudo git clone https://github.com/scivision/mumps.git
WORKDIR ./mumps
RUN sudo git checkout v5.6.2.1
RUN sudo wget -O cmake/FindMETIS.cmake https://github.com/LLNL/scaleupROM/raw/install/dependencies/FindMETIS.cmake
RUN sudo wget -O cmake/FindMETIS.cmake "https://raw.githubusercontent.com/LLNL/scaleupROM/main/install-helper/mumps/FindMETIS.cmake"
# RUN sudo sed -i 's/if(parallel IN_LIST METIS_FIND_COMPONENTS)/if("parallel" IN_LIST METIS_FIND_COMPONENTS)/g' cmake/FindMETIS.cmake

# RUN sudo sed -i 's/option(CMAKE_TLS_VERIFY "Verify TLS certificates" ON)/option(CMAKE_TLS_VERIFY "Verify TLS certificates" OFF)/g' options.cmake
Expand Down Expand Up @@ -52,9 +52,7 @@ ENV YAML_DIR=$LIB_DIR/yaml-cpp
# install libROM for scaleupROM
WORKDIR $LIB_DIR
RUN sudo git clone https://github.com/LLNL/libROM.git
WORKDIR ./libROM
RUN sudo git pull && sudo git checkout mpi-io
WORKDIR ./build
WORKDIR ./libROM/build
# libROM is using the MFEM without MUMPS right now.
RUN sudo cmake .. -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DUSE_MFEM=OFF -DMFEM_USE_GSLIB=${MFEM_USE_GSLIB}
RUN sudo make -j 16
Expand Down
4 changes: 4 additions & 0 deletions include/rom_interfaceform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "rom_handler.hpp"
#include "hdf5_utils.hpp"
#include "hyperreduction_integ.hpp"
#include "linalg/NNLS.h"

namespace mfem
{
Expand Down Expand Up @@ -55,6 +56,9 @@ class ROMInterfaceForm : public InterfaceForm
/// @brief Flag for precomputing necessary coefficients for fast computation.
bool precompute = false;

/// @brief Energy norm criterion for NNLS.
CAROM::NNLS_termination nnls_criterion = CAROM::NNLS_termination::L2;

public:
ROMInterfaceForm(Array<Mesh *> &meshes_, Array<FiniteElementSpace *> &fes_,
Array<FiniteElementSpace *> &comp_fes_, TopologyHandler *topol_);
Expand Down
3 changes: 3 additions & 0 deletions include/rom_nonlinearform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class ROMNonlinearForm : public NonlinearForm
/// @brief Flag for precomputing necessary coefficients for fast computation.
bool precompute = false;

/// @brief Energy norm criterion for NNLS.
CAROM::NNLS_termination nnls_criterion = CAROM::NNLS_termination::L2;

/*
Flag for being reference ROMNonlinearForm.
If not reference, all EQPElement arrays are view arrays, not owning them.
Expand Down
4 changes: 2 additions & 2 deletions sketches/librom_qr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int main(int argc, char *argv[])
}
printf("\n");

CAROM::Matrix* Q = rand_proj->qr_factorize();
CAROM::Matrix* Q = rand_proj->qr_factorize().get();
printf("Q (%d x %d) in RandomizedSVD::computeSVD.\n", Q->numRows(), Q->numColumns());
for (int i = 0; i < Q->numRows(); i++) {
for (int j = 0; j < Q->numColumns(); j++) {
Expand All @@ -86,7 +86,7 @@ int main(int argc, char *argv[])
printf("\n");

rand_proj = snapshot_matrix->mult(rand_mat);
Q = rand_proj->qr_factorize();
Q = rand_proj->qr_factorize().get();
printf("After perturbation, 2nd/3rd columns of Q totally changed.\n");
for (int i = 0; i < Q->numRows(); i++) {
for (int j = 0; j < Q->numColumns(); j++) {
Expand Down
Loading

0 comments on commit e8d940c

Please sign in to comment.