Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
07a5861
Moved base-tests into separate job. Tests with special env are kept
jakob-fritz Apr 29, 2024
8bfe003
Moved test-files into project dirs
jakob-fritz Apr 29, 2024
5b3be35
Ignore projects without tests in base-env
jakob-fritz Apr 29, 2024
a1ef2a1
Monodomain needs more packages, therefore moved to separate env
jakob-fritz Apr 29, 2024
f9eb388
Moved libpressio and monodomain-tests back to where they were
jakob-fritz Apr 30, 2024
6ee4c5c
Forgot to move them in subdir "test_projects"
jakob-fritz Apr 30, 2024
6103952
Same path as earlier
jakob-fritz Apr 30, 2024
7773347
Moved monodomain and compression tests again
jakob-fritz Apr 30, 2024
120b437
Add (mostly empty) files with additional requirements for projects
jakob-fritz Apr 30, 2024
10b35fb
Empty env-files are not allowed. Therefore added pytest to all files …
jakob-fritz Apr 30, 2024
c1d5c05
Removed python-versions from matrix for faster CI (and debugging)
jakob-fritz Apr 30, 2024
bce66a9
Don't stop other jobs of matrix if a single one fails
jakob-fritz Apr 30, 2024
623a44a
additional dependency needed
jakob-fritz Apr 30, 2024
14f0760
Corrected typo in dependency
jakob-fritz Apr 30, 2024
838928e
Add mpi4py to more projects
jakob-fritz Apr 30, 2024
d0acf31
Changed order for faster results across env and projects
jakob-fritz Apr 30, 2024
c040884
Resilience needs additional package
jakob-fritz Apr 30, 2024
08126f2
Limiting version of petsc4py
jakob-fritz Apr 30, 2024
a15148a
Adapted requirements from mpi4py-env
jakob-fritz Apr 30, 2024
4af3596
Increase timeout for single test
jakob-fritz Apr 30, 2024
bec0978
Added parallel execution and moved pytest-order to only job where it …
jakob-fritz Apr 30, 2024
c65f7dd
Fixed linting error and added parallel kw to coverage
jakob-fritz Apr 30, 2024
7822ca2
Removed pytest-parallel again
jakob-fritz Apr 30, 2024
c759c3a
Adde first version of documentation for new projects
jakob-fritz May 2, 2024
9089191
Moved pytest dependencies into separate file
jakob-fritz May 2, 2024
0c4252a
Corrected typo
jakob-fritz May 2, 2024
d927cd3
Moved requirements for projects into separate files
jakob-fritz May 2, 2024
cb20190
Used wrong filename
jakob-fritz May 2, 2024
f217ea1
Postprocessing needs other environment
jakob-fritz May 2, 2024
c2b202b
Updated documentation
jakob-fritz May 2, 2024
51a6f39
This environment-file makes job run faster locally (and succeed)
jakob-fritz May 2, 2024
0765de6
Moved sphinx into separate environment for creation of pages
jakob-fritz May 2, 2024
eebbdd3
Added more python-versions again
jakob-fritz May 3, 2024
b858c33
Readded pytest markers for libpressio and monodomain
jakob-fritz May 3, 2024
1a4b58f
Added text from robert about how to get a pySDC-version
jakob-fritz May 3, 2024
4c16d0f
Added fail-fast as false to always test complete matrix
jakob-fritz May 3, 2024
087befd
Removed upper limit of matplotlib.
jakob-fritz May 3, 2024
8a0271f
Removed lines in docs
jakob-fritz May 3, 2024
782c0bc
Added mpich for project resilience
jakob-fritz May 3, 2024
6ba1eba
Readded upper limit for matplotlib
jakob-fritz May 3, 2024
8b127fa
Unified two similar tests
jakob-fritz May 3, 2024
170ffac
Exclude combination of parallelSDC and newer python
jakob-fritz May 3, 2024
e40f68d
Reformatted
jakob-fritz May 3, 2024
33e00d8
Print content of data-dir for debugging
jakob-fritz May 6, 2024
3e9ada1
Added dependencies to postprocessing
jakob-fritz May 6, 2024
dbfef28
Updated path to CI-File in documentation
jakob-fritz May 6, 2024
b851eeb
Removed printing in CI again (added for debugging)
jakob-fritz May 6, 2024
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
85 changes: 81 additions & 4 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python: ['3.8', '3.9', '3.10']
env: ['base', 'fenics', 'mpi4py', 'petsc']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']

defaults:
run:
Expand All @@ -60,6 +61,10 @@ jobs:
create-args: >-
python=${{ matrix.python }}

- name: Install additional packages as needed
run: |
micromamba install -y --file etc/environment-tests.yml --freeze-installed

- name: Run pytest for CPU stuff
run: |
echo "print('Loading sitecustomize.py...')
Expand All @@ -82,6 +87,77 @@ jobs:
data_3.10
coverage_${{ matrix.env }}_3.10.dat

project_cpu_tests_linux:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
env:
- AllenCahn_Bayreuth
- AsympConv
- DAE
- FastWaveSlowWave
# - GPU
- Hamiltonian
- matrixPFASST
- parallelSDC
- parallelSDC_reloaded
- PinTSimE
- RDC
- Resilience
- SDC_showdown
- Second_orderSDC
- soft_failure
- TOMS
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- env: parallelSDC
python: '3.11'
- env: parallelSDC
python: '3.12'

defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: "pySDC/projects/${{ matrix.env }}/environment.yml"
create-args: >-
python=${{ matrix.python }}

- name: Install additional packages as needed
run: |
micromamba install -y --file etc/environment-tests.yml --freeze-installed

- name: Run pytest for CPU stuff
run: |
echo "print('Loading sitecustomize.py...')
import coverage
coverage.process_startup() " > sitecustomize.py
coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/projects/${{ matrix.env }}/tests

- name: Make coverage report
run: |
mv data data_${{ matrix.python }}
coverage combine
mv .coverage coverage_${{ matrix.env }}_${{ matrix.python }}.dat

- name: Uploading artifacts
uses: actions/upload-artifact@v3
if: matrix.python == '3.10'
with:
name: cpu-test-artifacts
path: |
data_3.10
coverage_${{ matrix.env }}_3.10.dat

user_libpressio_tests:
runs-on: ubuntu-latest

Expand All @@ -108,7 +184,7 @@ jobs:
source /opt/spack/share/spack/setup-env.sh
spack load libpressio

coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/tests -m libpressio
coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/projects/compression/tests -m libpressio

- name: Make coverage report
run: |
Expand Down Expand Up @@ -156,7 +232,7 @@ jobs:
echo "print('Loading sitecustomize.py...')
import coverage
coverage.process_startup() " > sitecustomize.py
coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/tests -m monodomain
coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/projects/Monodomain/tests -m monodomain

- name: Make coverage report
run: |
Expand Down Expand Up @@ -215,6 +291,7 @@ jobs:
needs:
- lint
- user_cpu_tests_linux
- project_cpu_tests_linux
- user_libpressio_tests
- user_monodomain_tests_linux
# - wait_for_gitlab
Expand All @@ -230,7 +307,7 @@ jobs:
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: "etc/environment-base.yml"
environment-file: "etc/environment-postprocess.yml"

- name: Downloading artifacts
uses: actions/download-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ This follows a specific OOP framework, you can look at the page on [custom imple
4. [Naming Conventions](./docs/contrib/03_naming_conventions.md)
5. [Custom Implementations](./docs/contrib/04_custom_implementations.md)
6. [Documenting Code](./docs/contrib/05_documenting_code.md)
7. [Adding a project](./docs/contrib/06_new_project.md)

:arrow_left: [Back to main page](./README.md)
2 changes: 1 addition & 1 deletion docs/contrib/05_documenting_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ A more detailed example is given [here ...](https://sphinxcontrib-napoleon.readt

:arrow_left: [Back to custom implementations](./04_custom_implementations.md) ---
:arrow_up: [Contributing Summary](./../../CONTRIBUTING.md) ---
:arrow_right: [Next to a cute picture of cat](https://www.vecteezy.com/photo/2098203-silver-tabby-cat-sitting-on-green-background)
:arrow_right: [Next to Adding a new project](./06_new_project.md)
57 changes: 57 additions & 0 deletions docs/contrib/06_new_project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Adding a project to pySDC (and automatic testing)

When you do a project with pySDC we appreciate it if you merge it back to the main repository.
We are committed to keeping your work reproducible and prevent it from fading into oblivion.
To that end, please write extensive tests for your code and add them to the project.
See the [contribution guide](./../../CONTRIBUTING.md) for general advice on testing etc.
This guide will detail only how to add a project to pySDC.

## Add a directory in 'pySDC/projects'

First, create a new directory in `pySDC/projects` with the name of your project.
The code of the new project should go into that newly created directory.

## Add an environment-file

The testing pipeline uses [micromamba](<https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html>)
and requires an environment file for setup.
This includes the dependencies that are required for your project to run.
The file needs to be named `environment.yml` and needs to follow the structure shown below:

```yaml
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- numpy
```

The list of dependencies can be extended as needed.
The name should stay `pySDC`. The channels cover most of the usual packages.
If a package is needed that cannot be found in those channels by conda (or mamba),
please add the correct channel to the list.

## Add tests to the project

In order to automatically find the tests of your project, please add the tests to a subdirectory called `tests` in the directory of your project.
Furthermore, the files should start with `test_` and the functions should also start with that.
For more information see the documentation of pytest on [test discovery](<https://docs.pytest.org/en/8.2.x/explanation/goodpractices.html#tests-as-part-of-application-code>).

## Add the project to the continuous integration pipeline

To run the tests of all projects in parallel, the projects are explicitly mentioned in the CI-file.
In order to run the tests of your project, please add the name of your project **as your directory is named**
in the [CI-File](<https://github.com/Parallel-in-Time/pySDC/blob/master/.github/workflows/ci_pipeline.yml>)
in the job `project_cpu_tests_linux` in the list `strategy/matrix/env`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, we need to make sure that this is correct in the end. If we decide to use the. pytest markers (I vote we do) we need to detail here how to add you own.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to actually submit the following comment yesterday afternoon:
Sure, we can go for pytest markers if you really want to. I think it is no necessary, as the tests are already sorted by directory and it is additional work and error-prone. But we can do it.
In case we go that way, we should definitely add it in the docs!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the markers because they assign the tests to the respective environments in a very explicit way. But I can see that we disagree on this issue. @pancetta, please note your preference and we'll go with that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markers were used originally because we wanted to filter the tests by a certain property. Adding new ones is pretty clumsy and forgetting to set a marker was also easily possible. So, if we don't need markers, we should get rid of them. But if we need to do other filter magic instead, we should keep them. So, what would happen if we drop markers?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case, we should not mix markers and non-markers. If we decide to use markers, we should only use markers. If we decide to get rid of markers, we should get fully rid of them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jakob currently set things up so that the project tests are in the project folders and the pipeline just runs all tests in a project folder with the environment file in the same folder. The remaining tests are still in the separate tests directory and use the markers base, mpi4py, ...
So then you don't need to add markers when adding a new project. Fine. I agree that it's a bit simpler ;)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to avoid confusion: We can get rid of all markers within the tests for projects. But currently we still use pytest-markers for all tests outside of projects. I wanted to explicitly state that as it slightly contradicts the statement of @pancetta about using markers everywhere or nowhere.
Is that fine with you, that we use them nowhere within the project-tests and everywhere outside of project-tests, @pancetta ?
I don't see a good way to get rid of the markers for the tests outside of projects, but don't think we need them within project-tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we did introduce inconsistencies here, too (see also my other comment below).


## Getting a DOI of pySDC for publication

If your project is published and you need a dedicated pySDC version with a DOI, please get in touch with us and/or open a new issue.
We will help you with this as soon as possible.
Note that a final DOI is usually only necessary once a paper is accepted and the final proofs are due.
We strongly encourage to describe and cite the current version of pySDC already during initial submission, though.

:arrow_left: [Back to Documenting Code](./05_documenting_code.md) ---
:arrow_up: [Contributing Summary](./../../CONTRIBUTING.md) ---
:arrow_right: [Next to a cute picture of cat](https://www.vecteezy.com/photo/2098203-silver-tabby-cat-sitting-on-green-background)
6 changes: 0 additions & 6 deletions etc/environment-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,3 @@ dependencies:
- sympy>=1.0
- numba>=0.35
- dill>=0.2.6
- pytest
- pytest-benchmark
- pytest-timeout
- pytest-order
- coverage[toml]
- sphinx
4 changes: 0 additions & 4 deletions etc/environment-cupy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@ dependencies:
- scipy>=0.17.1
- matplotlib>=3.0
- dill>=0.2.6
- pytest
- pytest-cov
- pytest-timeout
- pytest-order
- cupy
4 changes: 0 additions & 4 deletions etc/environment-fenics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ dependencies:
- dill>=0.2.6
- fenics>=2019.1.0
- mpi4py<=3.1.4
- pytest
- pytest-cov
- pytest-timeout
- pytest-order
5 changes: 1 addition & 4 deletions etc/environment-mpi4py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ channels:
dependencies:
- numpy>=1.15.4
- scipy>=0.17.1
- matplotlib>=3.0,<=3.5.3
- matplotlib>=3.0
- dill>=0.2.6
- mpich
- mpi4py-fft>=2.0.2
- mpi4py>=3.0.0
- pytest
- pytest-cov
- pytest-timeout
4 changes: 0 additions & 4 deletions etc/environment-petsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,3 @@ dependencies:
- mpich
- petsc4py<3.20
- mpi4py>=3.0.0
- pytest
- pytest-cov
- pytest-timeout
- pytest-order
12 changes: 12 additions & 0 deletions etc/environment-postprocess.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- coverage[toml]
- sphinx
- numpy
- scipy
- matplotlib
- dill
- numba
10 changes: 10 additions & 0 deletions etc/environment-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- pytest
- pytest-benchmark
- pytest-timeout
- pytest-order
- coverage[toml]
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
dependencies:
- numpy>=1.15.4
- scipy>=0.17.1
- matplotlib>=3.0,<=3.5.3
- matplotlib>=3.0
- dill>=0.2.6
- mpich
- mpi4py>=3.0.0
Expand Down
11 changes: 11 additions & 0 deletions pySDC/projects/AllenCahn_Bayreuth/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- mpi4py>=3.0.0
- mpi4py-fft>=2.0.2
- matplotlib>=3.0
- dill>=0.2.6
- scipy>=0.17.1

8 changes: 8 additions & 0 deletions pySDC/projects/AsympConv/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- matplotlib>=3.0
- scipy>=0.17.1
- dill>=0.2.6
8 changes: 8 additions & 0 deletions pySDC/projects/DAE/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- numpy
- scipy>=0.17.1
- dill>=0.2.6
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ def test_WSCC9_update_YBus():
), 'YBus after line outage does not match with the one it should supposed to!'


@pytest.mark.timeout(360)
@pytest.mark.base
def test_WSCC9_SDC_detection():
"""
Expand Down
10 changes: 10 additions & 0 deletions pySDC/projects/FastWaveSlowWave/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- numpy
- matplotlib>=3.0
- scipy>=0.17.1
- sympy>=1.0
- dill>=0.2.6
9 changes: 9 additions & 0 deletions pySDC/projects/Hamiltonian/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- dill>=0.2.6
- numpy
- matplotlib>=3.0
- scipy>=0.17.1
9 changes: 9 additions & 0 deletions pySDC/projects/PinTSimE/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- numpy
- scipy>=0.17.1
- dill>=0.2.6
- matplotlib>=3.0
8 changes: 8 additions & 0 deletions pySDC/projects/RDC/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- numpy
- dill>=0.2.6
- scipy>=0.17.1
11 changes: 11 additions & 0 deletions pySDC/projects/Resilience/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- mpi4py>=3.0.0
- mpi4py-fft>=2.0.2
- mpich
- matplotlib>=3.0
- dill>=0.2.6
- scipy>=0.17.1
9 changes: 9 additions & 0 deletions pySDC/projects/SDC_showdown/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: pySDC
channels:
- conda-forge
- defaults
dependencies:
- petsc4py<3.20
- matplotlib>=3.0
- dill>=0.2.6
- scipy>=0.17.1
Loading