Skip to content

Commit

Permalink
ci test for Poisson ROM operator
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer2368 committed Jul 15, 2024
1 parent 034aa35 commit def7b15
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,21 @@ jobs:
submodules: 'true'
- name: cmake
run: |
mkdir build
cd build
mkdir ${GITHUB_WORKSPACE}/build
cd ${GITHUB_WORKSPACE}/build
cmake .. -DCMAKE_CXX_COMPILER=mpic++ -DCMAKE_Fortran_COMPILER=mpif90 -DMPIEXEC_PREFLAGS="--oversubscribe" -DUSE_LIBROM=On -DLIBROM_PATH=/env/dependencies/libROM
- name: make
run: |
cd build && make -j 4
cd ${GITHUB_WORKSPACE}/build && make -j 4
- name: test
run: |
cd build && ctest --no-compress-output -V -T Test -I 1,20,1
cd ${GITHUB_WORKSPACE}/build && ctest --no-compress-output -V -T Test -I 1,20,1
- name: test ROM Poisson operator
run: |
cd ${GITHUB_WORKSPACE}/tests/ROM/test_rom_poisson
ln -s ${GITHUB_WORKSPACE}/build/src/mgmol-rom .
ln -s ${GITHUB_WORKSPACE}/potentials/* .
mpirun -n 3 --oversubscribe ./mgmol-rom -c carbyne.cfg -i carbyne.in
# code-style:
# runs-on: ubuntu-latest
# needs: [docker-image]
Expand Down
3 changes: 3 additions & 0 deletions src/rom_workflows.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ void testROMPoissonOperator(MGmolInterface *mgmol_)
testsol_gf -= fomsol_gf;
double rel_error = testsol_gf.norm2() / fomsol_gf.norm2();
printf("%d-th sample relative error: %.3e\n", s, rel_error);

if (rel_error > 1.0e-9)
abort();
}

/* clean up pointers */
Expand Down

0 comments on commit def7b15

Please sign in to comment.