From 954450a84145fe2a3feda908a2a7029efc02fab5 Mon Sep 17 00:00:00 2001 From: Miriam Date: Wed, 4 Nov 2020 16:58:43 +0000 Subject: [PATCH 01/14] Fixed several bugs related to decay-rate 1) In mdgxs.py, DecayRate, get_xs(). There is no need to reverse the order since there isn't an energy group filter anymore. Also, the new_shape addition formats the cross section like all the others. I updated mgxs_library_hdf5 test results accordingly. 2) In material.cpp. If you use a macroscopic dnesity other than 1.0, the code still pushed back '1.0'. My change fixes that. Using a macro density other than 1.0 wasn't tested anywhere, so I modifed mg_convert to take a density of 1.1. The default macro density of 1.0 is used in many other tests. 3) tally_scoring.cpp. Notice that the score is accumulated, then sent to the function score_fission_delayed_dg where the tally is accumulated. This amounts to "double accumulation". It makes sense to accumulate the score over the delayed groups if there is no delayed group filter, but in this case, when delayed group filter is not None, the score needs to reset each time. In other parts of SCORE_DECAY_RATE, I think the distinction between accumulating and resetting the score is correct. The only place I wasn't sure was line 1057 (and its equivalent in multi-group, line 1962). It's too bad the decay-rate isn't tested very thoroughly. Although I don't have time to do it myself, I think adding a DelayedGroups filter to the mg_tallies test would be a good start. --- openmc/mgxs/mdgxs.py | 6 +---- src/material.cpp | 4 ++-- src/tallies/tally_scoring.cpp | 4 ++-- .../mg_convert/inputs_true.dat | 2 +- .../mg_convert/results_true.dat | 24 +++++++++---------- tests/regression_tests/mg_convert/test.py | 2 +- .../mgxs_library_hdf5/results_true.dat | 16 +++++++++---- 7 files changed, 31 insertions(+), 27 deletions(-) diff --git a/openmc/mgxs/mdgxs.py b/openmc/mgxs/mdgxs.py index 8f35d58799..f511579528 100644 --- a/openmc/mgxs/mdgxs.py +++ b/openmc/mgxs/mdgxs.py @@ -2044,13 +2044,9 @@ class DecayRate(MDGXS): num_delayed_groups) else: new_shape = (num_subdomains, num_delayed_groups) + new_shape += xs.shape[1:] xs = np.reshape(xs, new_shape) - # Reverse data if user requested increasing energy groups since - # tally data is stored in order of increasing energies - if order_groups == 'increasing': - xs = xs[..., ::-1, :] - if squeeze: # We want to squeeze out everything but the polar, azimuthal, # delayed group, and energy group data. diff --git a/src/material.cpp b/src/material.cpp index 1d4e18108e..fed915043c 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -149,7 +149,7 @@ Material::Material(pugi::xml_node node) // Set density for macroscopic data if (units == "macro") { - densities.push_back(1.0); + densities.push_back(density_); } else { fatal_error("Units can only be macro for macroscopic data " + name); } @@ -169,7 +169,7 @@ Material::Material(pugi::xml_node node) // Check if no atom/weight percents were specified or if both atom and // weight percents were specified if (units == "macro") { - densities.push_back(1.0); + densities.push_back(density_); } else { bool has_ao = check_for_node(node_nuc, "ao"); bool has_wo = check_for_node(node_nuc, "wo"); diff --git a/src/tallies/tally_scoring.cpp b/src/tallies/tally_scoring.cpp index 396ab2f82b..0ffcf821bd 100644 --- a/src/tallies/tally_scoring.cpp +++ b/src/tallies/tally_scoring.cpp @@ -1995,13 +1995,13 @@ score_general_mg(Particle& p, int i_tally, int start_index, int filter_index, for (auto d_bin = 0; d_bin < filt.n_bins(); ++d_bin) { auto d = filt.groups()[d_bin] - 1; if (i_nuclide >= 0) { - score += atom_density * flux + score = atom_density * flux * nuc_xs.get_xs(MgxsType::DECAY_RATE, p_g, nullptr, nullptr, &d) * nuc_xs.get_xs(MgxsType::DELAYED_NU_FISSION, p_g, nullptr, nullptr, &d); } else { - score += flux + score = flux * macro_xs.get_xs(MgxsType::DECAY_RATE, p_g, nullptr, nullptr, &d) * macro_xs.get_xs(MgxsType::DELAYED_NU_FISSION, p_g, nullptr, diff --git a/tests/regression_tests/mg_convert/inputs_true.dat b/tests/regression_tests/mg_convert/inputs_true.dat index e2c3a01fa7..9db9b7d7c3 100644 --- a/tests/regression_tests/mg_convert/inputs_true.dat +++ b/tests/regression_tests/mg_convert/inputs_true.dat @@ -10,7 +10,7 @@ ./mgxs.h5 - + diff --git a/tests/regression_tests/mg_convert/results_true.dat b/tests/regression_tests/mg_convert/results_true.dat index a52b929dcf..5a17fe1073 100644 --- a/tests/regression_tests/mg_convert/results_true.dat +++ b/tests/regression_tests/mg_convert/results_true.dat @@ -1,24 +1,24 @@ k-combined: -9.930873E-01 2.221904E-03 +9.834385E-01 7.095193E-03 k-combined: -9.948148E-01 1.216270E-03 +9.936965E-01 4.118371E-03 k-combined: -9.930873E-01 2.221904E-03 +9.834385E-01 7.095193E-03 k-combined: -9.755034E-01 6.178296E-03 +9.977232E-01 1.084193E-02 k-combined: -9.738059E-01 4.529068E-03 +9.945011E-01 5.571771E-03 k-combined: -9.866847E-01 9.485912E-03 +9.982627E-01 2.662444E-03 k-combined: -9.755024E-01 6.179047E-03 +9.977232E-01 1.084193E-02 k-combined: -9.738061E-01 4.529462E-03 +9.945007E-01 5.571589E-03 k-combined: -9.866835E-01 9.485832E-03 +9.982620E-01 2.662746E-03 k-combined: -9.719024E-01 4.213166E-03 +1.000071E+00 3.364791E-03 k-combined: -9.930873E-01 2.221904E-03 +9.834385E-01 7.095193E-03 k-combined: -9.930873E-01 2.221904E-03 +9.834385E-01 7.095193E-03 diff --git a/tests/regression_tests/mg_convert/test.py b/tests/regression_tests/mg_convert/test.py index 4cc6b656a2..f22c15dc07 100755 --- a/tests/regression_tests/mg_convert/test.py +++ b/tests/regression_tests/mg_convert/test.py @@ -67,7 +67,7 @@ class MGXSTestHarness(PyAPITestHarness): # Instantiate some Materials and register the appropriate objects mat = openmc.Material(material_id=1, name='UO2 fuel') - mat.set_density('macro', 1.0) + mat.set_density('macro', 1.1) mat.add_macroscopic(uo2_data) # Instantiate a Materials collection and export to XML diff --git a/tests/regression_tests/mgxs_library_hdf5/results_true.dat b/tests/regression_tests/mgxs_library_hdf5/results_true.dat index 4a796b0a51..4aa243b9e3 100644 --- a/tests/regression_tests/mgxs_library_hdf5/results_true.dat +++ b/tests/regression_tests/mgxs_library_hdf5/results_true.dat @@ -193,10 +193,18 @@ domain=1 type=beta [1.21876271e-04 8.77101834e-05] [4.95946084e-05 3.67414816e-05]] domain=1 type=decay-rate -[1.33568413e-02 3.25887984e-02 1.21105565e-01 3.06139633e-01 - 8.62763808e-01 2.89789222e+00] -[9.57055016e-04 2.28222032e-03 8.35436401e-03 2.06734948e-02 - 5.63019289e-02 1.89486538e-01] +[[1.33568413e-02] + [3.25887984e-02] + [1.21105565e-01] + [3.06139633e-01] + [8.62763808e-01] + [2.89789222e+00]] +[[9.57055016e-04] + [2.28222032e-03] + [8.35436401e-03] + [2.06734948e-02] + [5.63019289e-02] + [1.89486538e-01]] domain=1 type=delayed-nu-fission matrix [[[0.00000000e+00 0.00000000e+00] [0.00000000e+00 0.00000000e+00]] From 37944edd95ac7ff8dcfb6120f6749e15714ce94f Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 11 Dec 2020 20:04:26 +0000 Subject: [PATCH 02/14] Adding a GitHub actions CI file. --- .github/workflows/ci.yml | 102 +++++++++++++++++++ src/summary.cpp | 5 + tests/regression_tests/cpp_driver/driver.cpp | 4 + tools/ci/travis-install.py | 1 + tools/ci/travis-install.sh | 10 +- 5 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..42cf53762d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,102 @@ +name: CI + +on: [push] + +env: + MPI_DIR: /usr + DAGMC_ROOT: $HOME/DAGMC + HDF5_ROOT: /usr + OMP_NUM_THREADS: 2 + OPENMC_CROSS_SECTIONS: $HOME/nndc_hdf5/cross_sections.xml + OPENMC_ENDF_DATA: $HOME/endf-b-vii.1 + COVERALLS_PARALLEL: true + NUMPY_EXPERIMENTAL_ARRAY_FUNCTION: 0 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + +jobs: + main: + runs-on: ubuntu-16.04 + strategy: + matrix: + python-version: [3.8] + mpi: [n, y] + omp: [n, y] + dagmc: [n] + event: [n] + vectfit: [n] + + include: + - python-version: 3.6 + omp: n + mpi: n + - python-version: 3.7 + omp: n + mpi: n + - dagmc: y + python-version: 3.8 + mpi: y + omp: y + - event: y + python-version: 3.8 + omp: y + mpi: n + - vectfit: y + python-version: 3.8 + omp: n + mpi: y + + steps: + - + uses: actions/checkout@v2 + + - + name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - + name: Environment Variables + run: | + echo "OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV + echo "OPENMC_ENDF_DATA=$HOME/endf-b-vii.1" >> $GITHUB_ENV + echo "MPI=${{ matrix.mpi }}" >> $GITHUB_ENV + echo "PHDF5=${{ matrix.mpi }}" >> $GITHUB_ENV + echo "OMP=${{ matrix.omp }}" >> $GITHUB_ENV + echo "DAGMC=${{ matrix.dagmc }}" >> $GITHUB_ENV + echo "EVENT=${{ matrix.event }}" >> $GITHUB_ENV + echo "VECTFIT=${{ matrix.vectfit }}" >> $GITHUB_ENV + + - + name: Apt dependencies + shell: bash + run: | + sudo apt -y update + sudo apt install -y mpich \ + libmpich-dev \ + libhdf5-serial-dev \ + libhdf5-mpich-dev \ + libeigen3-dev + - + name: install + shell: bash + run: | + echo "$HOME/NJOY2016/build" >> $GITHUB_PATH + $GITHUB_WORKSPACE/tools/ci/travis-install.sh + - + name: before + shell: bash + run: $GITHUB_WORKSPACE/tools/ci/travis-before-script.sh + + - + name: test + shell: bash + run: $GITHUB_WORKSPACE/tools/ci/travis-script.sh + + - + name: after_success + shell: bash + run: | + cpp-coveralls -i src -i include --exclude-pattern "/usr/*" --dump cpp_cov.json + coveralls --merge=cpp_cov.json diff --git a/src/summary.cpp b/src/summary.cpp index 1f5f7a097b..cb7527208e 100644 --- a/src/summary.cpp +++ b/src/summary.cpp @@ -14,6 +14,11 @@ namespace openmc { void write_summary() { + +#ifdef MPI + if (!mpi::master) return; +#endif + // Display output message write_message("Writing summary.h5 file...", 5); diff --git a/tests/regression_tests/cpp_driver/driver.cpp b/tests/regression_tests/cpp_driver/driver.cpp index f6fde30fd3..db6137f1d9 100644 --- a/tests/regression_tests/cpp_driver/driver.cpp +++ b/tests/regression_tests/cpp_driver/driver.cpp @@ -48,7 +48,11 @@ int main(int argc, char** argv) { // the summary file will be used to check that // temperatures were set correctly so clear // error output can be provided +#ifdef OPENMC_MPI + if (openmc::mpi::master) openmc::write_summary(); +#else openmc::write_summary(); +#endif openmc_run(); openmc_finalize(); diff --git a/tools/ci/travis-install.py b/tools/ci/travis-install.py index a2b1b61753..2f573b1a97 100644 --- a/tools/ci/travis-install.py +++ b/tools/ci/travis-install.py @@ -47,6 +47,7 @@ def install(omp=False, mpi=False, phdf5=False, dagmc=False): if dagmc: cmake_cmd.append('-Ddagmc=ON') + cmake_cmd.append('-DCMAKE_PREFIX_PATH=~/DAGMC') # Build in coverage mode for coverage testing cmake_cmd.append('-Dcoverage=on') diff --git a/tools/ci/travis-install.sh b/tools/ci/travis-install.sh index 7bbe160aa5..4e5da241a9 100755 --- a/tools/ci/travis-install.sh +++ b/tools/ci/travis-install.sh @@ -1,6 +1,11 @@ #!/bin/bash set -ex +# Upgrade pip, pytest, numpy before doing anything else +pip install --upgrade pip +pip install --upgrade pytest +pip install --upgrade numpy + # Install NJOY 2016 ./tools/ci/travis-install-njoy.sh @@ -14,11 +19,6 @@ if [[ $VECTFIT = 'y' ]]; then ./tools/ci/travis-install-vectfit.sh fi -# Upgrade pip, pytest, numpy before doing anything else -pip install --upgrade pip -pip install --upgrade pytest -pip install --upgrade numpy - # Install mpi4py for MPI configurations if [[ $MPI == 'y' ]]; then pip install --no-binary=mpi4py mpi4py From 793f4253727002995d5dd484d3dd224d9f9ed0f0 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 14 Dec 2020 05:50:03 +0000 Subject: [PATCH 03/14] Updating ubuntu version. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42cf53762d..5750053eba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ env: jobs: main: - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 strategy: matrix: python-version: [3.8] From 1734a07295f0cd286670690943279a531c3f3127 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 14 Dec 2020 06:18:41 +0000 Subject: [PATCH 04/14] Adding message passing header to the C++ driver test. --- tests/regression_tests/cpp_driver/driver.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/regression_tests/cpp_driver/driver.cpp b/tests/regression_tests/cpp_driver/driver.cpp index db6137f1d9..3b4bd1daa2 100644 --- a/tests/regression_tests/cpp_driver/driver.cpp +++ b/tests/regression_tests/cpp_driver/driver.cpp @@ -2,6 +2,7 @@ #include "openmc/capi.h" #include "openmc/cell.h" #include "openmc/geometry.h" +#include "openmc/message_passing.h" #include "openmc/summary.h" #include "openmc/tallies/filter.h" #include "openmc/tallies/filter_cell.h" From 1f0d53f693a9fa7b658d405983f4bfe47869fc86 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 14 Dec 2020 16:25:41 +0000 Subject: [PATCH 05/14] Removing unecessary variables in environment. --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5750053eba..bfdaf51dec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,6 @@ env: OPENMC_CROSS_SECTIONS: $HOME/nndc_hdf5/cross_sections.xml OPENMC_ENDF_DATA: $HOME/endf-b-vii.1 COVERALLS_PARALLEL: true - NUMPY_EXPERIMENTAL_ARRAY_FUNCTION: 0 - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - jobs: main: From f6e1d64beabc41bb0fb56ae66edfe2f45cb06eba Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 14 Dec 2020 16:56:58 +0000 Subject: [PATCH 06/14] Re-adding GitHub token to CI file -- used to push coveralls results. --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfdaf51dec..9cb51aa0f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,12 @@ env: OPENMC_CROSS_SECTIONS: $HOME/nndc_hdf5/cross_sections.xml OPENMC_ENDF_DATA: $HOME/endf-b-vii.1 COVERALLS_PARALLEL: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + jobs: main: - runs-on: ubuntu-18.04 + runs-on: ubuntu-16.04 strategy: matrix: python-version: [3.8] From 3b4a6ae0b8e147ded7df17bc79a0c17875998616 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 14 Dec 2020 16:57:16 +0000 Subject: [PATCH 07/14] Adding GitHub actions badge to the README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0bb67989d..5a1a8d3d53 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # OpenMC Monte Carlo Particle Transport Code [![License](https://img.shields.io/github/license/openmc-dev/openmc.svg)](http://openmc.readthedocs.io/en/latest/license.html) -[![Travis CI build status (Linux)](https://travis-ci.org/openmc-dev/openmc.svg?branch=develop)](https://travis-ci.org/openmc-dev/openmc) +[![GitHub Actions build status (Linux)](https://github.com/pshriwise/openmc/workflows/CI/badge.svg?branch=develop) [![Code Coverage](https://coveralls.io/repos/github/openmc-dev/openmc/badge.svg?branch=develop)](https://coveralls.io/github/openmc-dev/openmc?branch=develop) The OpenMC project aims to provide a fully-featured Monte Carlo particle From 7a294ce2673c0c0d1931e2a57aa35b91d8e1e704 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 14 Dec 2020 16:59:23 +0000 Subject: [PATCH 08/14] Updating CI triggers. --- .github/workflows/ci.yml | 10 +++++++++- README.md | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cb51aa0f6..3945f19d5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,14 @@ name: CI -on: [push] +on: + pull_request: + branches: + - develop + - master + push: + branches: + - develop + - master env: MPI_DIR: /usr diff --git a/README.md b/README.md index 5a1a8d3d53..92ea1d8db3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # OpenMC Monte Carlo Particle Transport Code [![License](https://img.shields.io/github/license/openmc-dev/openmc.svg)](http://openmc.readthedocs.io/en/latest/license.html) -[![GitHub Actions build status (Linux)](https://github.com/pshriwise/openmc/workflows/CI/badge.svg?branch=develop) +[![GitHub Actions build status (Linux)](https://github.com/pshriwise/openmc/workflows/CI/badge.svg?branch=develop)](https://github.com/openmc-dev/openmc/actions) [![Code Coverage](https://coveralls.io/repos/github/openmc-dev/openmc/badge.svg?branch=develop)](https://coveralls.io/github/openmc-dev/openmc?branch=develop) The OpenMC project aims to provide a fully-featured Monte Carlo particle From f0d09e4c7d29c10cc76aa7671cef1ca1aee58bab Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 14 Dec 2020 18:25:07 +0000 Subject: [PATCH 09/14] Reverting change in summary file. --- src/summary.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/summary.cpp b/src/summary.cpp index cb7527208e..1f5f7a097b 100644 --- a/src/summary.cpp +++ b/src/summary.cpp @@ -14,11 +14,6 @@ namespace openmc { void write_summary() { - -#ifdef MPI - if (!mpi::master) return; -#endif - // Display output message write_message("Writing summary.h5 file...", 5); From a0d8c5dfa6b5ebe670856b0c930ecfb1135fb925 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 16 Dec 2020 08:24:52 -0600 Subject: [PATCH 10/14] Update README.md Co-authored-by: Paul Romano --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92ea1d8db3..a905a501c0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # OpenMC Monte Carlo Particle Transport Code [![License](https://img.shields.io/github/license/openmc-dev/openmc.svg)](http://openmc.readthedocs.io/en/latest/license.html) -[![GitHub Actions build status (Linux)](https://github.com/pshriwise/openmc/workflows/CI/badge.svg?branch=develop)](https://github.com/openmc-dev/openmc/actions) +[![GitHub Actions build status (Linux)](https://github.com/openmc-dev/openmc/workflows/CI/badge.svg?branch=develop)](https://github.com/openmc-dev/openmc/actions) [![Code Coverage](https://coveralls.io/repos/github/openmc-dev/openmc/badge.svg?branch=develop)](https://coveralls.io/github/openmc-dev/openmc?branch=develop) The OpenMC project aims to provide a fully-featured Monte Carlo particle From d08baece5f552967e682dcb9b370f42f06b8a54e Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 16 Dec 2020 14:28:51 +0000 Subject: [PATCH 11/14] Addressing comments from @paulromano. --- .github/workflows/ci.yml | 18 ++++-- .travis.yml | 60 ------------------- ...-before-script.sh => gha-before-script.sh} | 0 ...-install-dagmc.sh => gha-install-dagmc.sh} | 0 ...is-install-njoy.sh => gha-install-njoy.sh} | 0 ...tall-vectfit.sh => gha-install-vectfit.sh} | 0 .../ci/{travis-install.py => gha-install.py} | 0 .../ci/{travis-install.sh => gha-install.sh} | 0 tools/ci/{travis-script.sh => gha-script.sh} | 0 9 files changed, 13 insertions(+), 65 deletions(-) delete mode 100644 .travis.yml rename tools/ci/{travis-before-script.sh => gha-before-script.sh} (100%) rename tools/ci/{travis-install-dagmc.sh => gha-install-dagmc.sh} (100%) rename tools/ci/{travis-install-njoy.sh => gha-install-njoy.sh} (100%) rename tools/ci/{travis-install-vectfit.sh => gha-install-vectfit.sh} (100%) rename tools/ci/{travis-install.py => gha-install.py} (100%) rename tools/ci/{travis-install.sh => gha-install.sh} (100%) rename tools/ci/{travis-script.sh => gha-script.sh} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3945f19d5e..5088f283eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,8 +66,6 @@ jobs: - name: Environment Variables run: | - echo "OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV - echo "OPENMC_ENDF_DATA=$HOME/endf-b-vii.1" >> $GITHUB_ENV echo "MPI=${{ matrix.mpi }}" >> $GITHUB_ENV echo "PHDF5=${{ matrix.mpi }}" >> $GITHUB_ENV echo "OMP=${{ matrix.omp }}" >> $GITHUB_ENV @@ -90,16 +88,16 @@ jobs: shell: bash run: | echo "$HOME/NJOY2016/build" >> $GITHUB_PATH - $GITHUB_WORKSPACE/tools/ci/travis-install.sh + $GITHUB_WORKSPACE/tools/ci/gha-install.sh - name: before shell: bash - run: $GITHUB_WORKSPACE/tools/ci/travis-before-script.sh + run: $GITHUB_WORKSPACE/tools/ci/gha-before-script.sh - name: test shell: bash - run: $GITHUB_WORKSPACE/tools/ci/travis-script.sh + run: $GITHUB_WORKSPACE/tools/ci/gha-script.sh - name: after_success @@ -107,3 +105,13 @@ jobs: run: | cpp-coveralls -i src -i include --exclude-pattern "/usr/*" --dump cpp_cov.json coveralls --merge=cpp_cov.json + + finish: + needs: main + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6eee7f7429..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,60 +0,0 @@ - -sudo: required -dist: xenial -language: python -addons: - apt: - packages: - - mpich - - libmpich-dev - - libhdf5-serial-dev - - libhdf5-mpich-dev - - libeigen3-dev - config: - retries: true -services: - - xvfb -cache: - directories: - - $HOME/nndc_hdf5 - - $HOME/endf-b-vii.1 -env: - global: - - MPI_DIR=/usr - - DAGMC_ROOT=$HOME/DAGMC - - HDF5_ROOT=/usr - - OMP_NUM_THREADS=2 - - OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml - - OPENMC_ENDF_DATA=$HOME/endf-b-vii.1 - - PATH=$PATH:$HOME/NJOY2016/build - - COVERALLS_PARALLEL=true - - NUMPY_EXPERIMENTAL_ARRAY_FUNCTION=0 -matrix: - include: - - python: "3.6" - env: OMP=n MPI=n PHDF5=n - - python: "3.7" - env: OMP=n MPI=n PHDF5=n - - python: "3.8" - env: OMP=n MPI=n PHDF5=n - - python: "3.8" - env: OMP=y MPI=n PHDF5=n - - python: "3.8" - env: OMP=n MPI=y PHDF5=n VECTFIT=y - - python: "3.8" - env: OMP=n MPI=y PHDF5=y - - python: "3.8" - env: OMP=y MPI=y PHDF5=y DAGMC=y - - python: "3.8" - env: OMP=y MPI=n PHDF5=n EVENT=y -notifications: - webhooks: https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -install: - - ./tools/ci/travis-install.sh -before_script: - - ./tools/ci/travis-before-script.sh -script: - - ./tools/ci/travis-script.sh -after_success: - - cpp-coveralls -i src -i include --exclude-pattern "/usr/*" --dump cpp_cov.json - - coveralls --merge=cpp_cov.json diff --git a/tools/ci/travis-before-script.sh b/tools/ci/gha-before-script.sh similarity index 100% rename from tools/ci/travis-before-script.sh rename to tools/ci/gha-before-script.sh diff --git a/tools/ci/travis-install-dagmc.sh b/tools/ci/gha-install-dagmc.sh similarity index 100% rename from tools/ci/travis-install-dagmc.sh rename to tools/ci/gha-install-dagmc.sh diff --git a/tools/ci/travis-install-njoy.sh b/tools/ci/gha-install-njoy.sh similarity index 100% rename from tools/ci/travis-install-njoy.sh rename to tools/ci/gha-install-njoy.sh diff --git a/tools/ci/travis-install-vectfit.sh b/tools/ci/gha-install-vectfit.sh similarity index 100% rename from tools/ci/travis-install-vectfit.sh rename to tools/ci/gha-install-vectfit.sh diff --git a/tools/ci/travis-install.py b/tools/ci/gha-install.py similarity index 100% rename from tools/ci/travis-install.py rename to tools/ci/gha-install.py diff --git a/tools/ci/travis-install.sh b/tools/ci/gha-install.sh similarity index 100% rename from tools/ci/travis-install.sh rename to tools/ci/gha-install.sh diff --git a/tools/ci/travis-script.sh b/tools/ci/gha-script.sh similarity index 100% rename from tools/ci/travis-script.sh rename to tools/ci/gha-script.sh From 8d92d4517ebd9b7138a9832adafc88c459411af4 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 16 Dec 2020 14:33:12 +0000 Subject: [PATCH 12/14] Changing name of ci scripts in ci scripts. --- tools/ci/gha-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/ci/gha-install.sh b/tools/ci/gha-install.sh index 4e5da241a9..debf833145 100755 --- a/tools/ci/gha-install.sh +++ b/tools/ci/gha-install.sh @@ -7,16 +7,16 @@ pip install --upgrade pytest pip install --upgrade numpy # Install NJOY 2016 -./tools/ci/travis-install-njoy.sh +./tools/ci/gha-install-njoy.sh # Install DAGMC if needed if [[ $DAGMC = 'y' ]]; then - ./tools/ci/travis-install-dagmc.sh + ./tools/ci/gha-install-dagmc.sh fi # Install vectfit for WMP generation if needed if [[ $VECTFIT = 'y' ]]; then - ./tools/ci/travis-install-vectfit.sh + ./tools/ci/gha-install-vectfit.sh fi # Install mpi4py for MPI configurations @@ -25,7 +25,7 @@ if [[ $MPI == 'y' ]]; then fi # Build and install OpenMC executable -python tools/ci/travis-install.py +python tools/ci/gha-install.py # Install Python API in editable mode pip install -e .[test,vtk] From 81c50485a031f55513391437e473b631e144dce0 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 16 Dec 2020 16:34:12 +0000 Subject: [PATCH 13/14] Updating enrivonment handling. Using env block where possible. --- .github/workflows/ci.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5088f283eb..5509e85c0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: CI on: + # allows us to run workflows manually + workflow_dispatch: + pull_request: branches: - develop @@ -15,8 +18,6 @@ env: DAGMC_ROOT: $HOME/DAGMC HDF5_ROOT: /usr OMP_NUM_THREADS: 2 - OPENMC_CROSS_SECTIONS: $HOME/nndc_hdf5/cross_sections.xml - OPENMC_ENDF_DATA: $HOME/endf-b-vii.1 COVERALLS_PARALLEL: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -53,6 +54,14 @@ jobs: omp: n mpi: y + env: + MPI: ${{ matrix.mpi }} + PHDF5: ${{ matrix.mpi }} + OMP: ${{ matrix.omp }} + DAGMC: ${{ matrix.dagmc }} + EVENT: ${{ matrix.event }} + VECTFIT: ${{ matrix.vectfit }} + steps: - uses: actions/checkout@v2 @@ -66,13 +75,9 @@ jobs: - name: Environment Variables run: | - echo "MPI=${{ matrix.mpi }}" >> $GITHUB_ENV - echo "PHDF5=${{ matrix.mpi }}" >> $GITHUB_ENV - echo "OMP=${{ matrix.omp }}" >> $GITHUB_ENV - echo "DAGMC=${{ matrix.dagmc }}" >> $GITHUB_ENV - echo "EVENT=${{ matrix.event }}" >> $GITHUB_ENV - echo "VECTFIT=${{ matrix.vectfit }}" >> $GITHUB_ENV - + echo "OPENMC_CROSS_SECTIONS=${{ env.HOME }}/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV + echo "OPENMC_ENDF_DATA=${{ env.HOME }}/endf-b-vii.1" >> $GITHUB_ENV + - name: Apt dependencies shell: bash From d77bc644c324a2547129c7fb3911113a4bf16767 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 16 Dec 2020 18:35:39 +0000 Subject: [PATCH 14/14] Abandoning the use of env context for now. Back to the bash HOME variable. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5509e85c0a..f8ab9235ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,6 @@ on: env: MPI_DIR: /usr - DAGMC_ROOT: $HOME/DAGMC HDF5_ROOT: /usr OMP_NUM_THREADS: 2 COVERALLS_PARALLEL: true @@ -75,8 +74,9 @@ jobs: - name: Environment Variables run: | - echo "OPENMC_CROSS_SECTIONS=${{ env.HOME }}/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV - echo "OPENMC_ENDF_DATA=${{ env.HOME }}/endf-b-vii.1" >> $GITHUB_ENV + echo "DAGMC_ROOT=$HOME/DAGMC" + echo "OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml" >> $GITHUB_ENV + echo "OPENMC_ENDF_DATA=$HOME/endf-b-vii.1" >> $GITHUB_ENV - name: Apt dependencies