Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
---

# WORKFLOW DISABLED
# This workflow has been disabled to prevent skipped check runs from appearing in pull requests.
# The file has been renamed from gitlab_ci.yml to gitlab_ci.yml.disabled
#
# To re-enable this workflow:
# 1. Rename this file back to gitlab_ci.yml
# 2. Uncomment the desired triggers below (push, pull_request_target, schedule)
#
# Note: Even with only workflow_dispatch enabled, GitHub creates skipped check runs
# for the jobs when they have conditional 'if' statements that evaluate to false.

name: Mirror to Gitlab to trigger CI

# Disabled: GitLab mirror is temporarily disabled due to known issues
# To re-enable, uncomment the triggers below
on:
push:
pull_request_target:
types: [opened, synchronize, reopened, labeled]
schedule:
- cron: '2 5 * * 1'
workflow_dispatch: # Manual trigger only
# push:
# pull_request_target:
# types: [opened, synchronize, reopened, labeled]
# schedule:
# - cron: '2 5 * * 1'

jobs:
check_permission:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/postprocess.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Create Website for pySDC

on:
workflow_run:
workflows: ["Mirror to Gitlab to trigger CI"]
workflows: ["CI pipeline for pySDC"]
types: ["completed"]

jobs:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ implemented.
[PETSc](http://www.mcs.anl.gov/petsc/) (through
[petsc4py](https://bitbucket.org/petsc/petsc4py))
- Continuous integration via [GitHub
Actions](https://github.com/Parallel-in-Time/pySDC/actions) and
[Gitlab CI](https://gitlab.hzdr.de/r.speck/pysdc/-/pipelines) (through the [GitHub2Gitlab Action](https://github.com/jakob-fritz/github2lab_action))
Actions](https://github.com/Parallel-in-Time/pySDC/actions)
- Fully compatible with Python 3.10 - 3.13, runs at least on Ubuntu

## Getting started
Expand Down
2 changes: 2 additions & 0 deletions docs/contrib/02_continuous_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ pytest -v pySDC/tests

## Running CI on HPC from pull requests

> :warning: **Note:** The GitLab mirror integration is currently disabled due to technical issues. This section describes functionality that is temporarily unavailable.

By syncing the GitHub repository to a certain Gitlab instance, CI-Jobs can be run on HPC machines. This can be helpful for benchmarks or when running on accelerators that are not available as GitHub runners.

For security and accounting reasons, a few extra steps are needed in order to run the contents of a pull request on HPC:
Expand Down
1 change: 1 addition & 0 deletions pySDC/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Module containing utility classe(s) from which inherit some of the pySDC base
classes.
"""

from pySDC.core.errors import ReadOnlyError


Expand Down
1 change: 0 additions & 1 deletion pySDC/core/hooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
from collections import namedtuple


# metadata with defaults
meta_data = {
'process': None,
Expand Down
1 change: 0 additions & 1 deletion pySDC/core/sweeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from pySDC.core.collocation import CollBase
from pySDC.helpers.pysdc_helper import FrozenClass


# Organize QDeltaGenerator class in dict[type(QDeltaGenerator),set(str)] to retrieve aliases
QDELTA_GENERATORS_ALIASES = {v: set() for v in set(QDELTA_GENERATORS.values())}
for k, v in QDELTA_GENERATORS.items():
Expand Down
1 change: 1 addition & 0 deletions pySDC/helpers/fieldsIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
To use MPI collective writing, you need to call first the class methods :class:`Rectilinear.setupMPI` (cf their docstring).
Also, `Rectilinear.setHeader` **must be given the global grids coordinates**, whether the code is run in parallel or not.
"""

import os
import numpy as np
from typing import Type, TypeVar
Expand Down
1 change: 1 addition & 0 deletions pySDC/helpers/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

Helpers module for testing utilities
"""

import os
import json
import warnings
Expand Down
1 change: 1 addition & 0 deletions pySDC/helpers/vtkIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
Helper functions for VTK files IO (to be used with Paraview or PyVista)
"""

import os
import vtk
from vtkmodules.util import numpy_support
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ def estimate_embedded_error_serial(self, L):
else:
return comm.bcast(abs(L.uold[comm.rank + 1] - L.u[comm.rank + 1]), root=comm.size - 1)
else:
raise NotImplementedError(
f"Don't know how to estimate embedded error for sweeper type \
\"{self.params.sweeper_type}\""
)
raise NotImplementedError(f"Don't know how to estimate embedded error for sweeper type \
\"{self.params.sweeper_type}\"")

def setup_status_variables(self, controller, **kwargs):
"""
Expand Down Expand Up @@ -209,10 +207,8 @@ def post_iteration_processing(self, controller, S, **kwargs):
None
"""
if len(S.levels) > 1 and len(controller.MS) > 1:
raise NotImplementedError(
"Embedded error estimate only works for serial multi-level or parallel single \
level"
)
raise NotImplementedError("Embedded error estimate only works for serial multi-level or parallel single \
level")

if S.status.iter > 0 or self.params.sweeper_type == "RK":
if self.params.averaged:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ def store_values(self, S, **kwargs):
elif type(f) == mesh:
self.prev.f[oldest_val] = f
else:
raise DataError(
f"Unable to store f from datatype {type(f)}, extrapolation based error estimate only\
works with types imex_mesh and mesh"
)
raise DataError(f"Unable to store f from datatype {type(f)}, extrapolation based error estimate only\
works with types imex_mesh and mesh")

# store the rest of the values
self.prev.u[oldest_val] = S.levels[0].u[-1]
Expand Down Expand Up @@ -481,10 +479,8 @@ def post_iteration_processing(self, controller, S, **kwargs):
elif type(lvl.f[0]) == mesh:
f = [lvl.f[i] if self.coeff.f[i] else 0.0 for i in range(len(lvl.f) - 1)]
else:
raise DataError(
f"Unable to store f from datatype {type(lvl.f[0])}, extrapolation based error estimate only\
works with types imex_mesh and mesh"
)
raise DataError(f"Unable to store f from datatype {type(lvl.f[0])}, extrapolation based error estimate only\
works with types imex_mesh and mesh")

# compute the error with the weighted sum
if self.comm:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ def check_parameters(self, controller, params, description, **kwargs):
str: Error message
"""
if self.params.HotRod_tol == np.inf:
controller.logger.warning(
"Hot Rod needs a detection threshold, which is now set to infinity, such that a \
restart is never triggered!"
)
controller.logger.warning("Hot Rod needs a detection threshold, which is now set to infinity, such that a \
restart is never triggered!")

if description["step_params"].get("restol", -1.0) >= 0:
return (
Expand Down
1 change: 0 additions & 1 deletion pySDC/implementations/problem_classes/AllenCahn_2D_FD.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from pySDC.helpers import problem_helper
from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh, comp2_mesh


# http://www.personal.psu.edu/qud2/Res/Pre/dz09sisc.pdf


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def formFunction(self, snes, X, F):
x = self.da.getVecArray(self.localX)
f = self.da.getVecArray(F)
mx = self.da.getSizes()[0]
(xs, xe) = self.da.getRanges()[0]
xs, xe = self.da.getRanges()[0]
for i in range(xs, xe):
if i == 0 or i == mx - 1:
f[i] = x[i]
Expand Down Expand Up @@ -211,7 +211,7 @@ def formJacobian(self, snes, X, J, P):
P.zeroEntries()
row = PETSc.Mat.Stencil()
mx = self.da.getSizes()[0]
(xs, xe) = self.da.getRanges()[0]
xs, xe = self.da.getRanges()[0]
for i in range(xs, xe):
row.i = i
row.field = 0
Expand Down Expand Up @@ -341,7 +341,7 @@ def __init__(

# compute dx and get local ranges
self.dx = (self.interval[1] - self.interval[0]) / (self.nvars - 1)
(self.xs, self.xe) = self.init.getRanges()[0]
self.xs, self.xe = self.init.getRanges()[0]

# compute discretization matrix A and identity
self.A = self.__get_A()
Expand Down Expand Up @@ -401,7 +401,7 @@ def __get_A(self):
row = PETSc.Mat.Stencil()
col = PETSc.Mat.Stencil()
mx = self.init.getSizes()[0]
(xs, xe) = self.init.getRanges()[0]
xs, xe = self.init.getRanges()[0]
for i in range(xs, xe):
row.i = i
row.field = 0
Expand Down Expand Up @@ -447,7 +447,7 @@ def get_sys_mat(self, factor):
row = PETSc.Mat.Stencil()
col = PETSc.Mat.Stencil()
mx = self.init.getSizes()[0]
(xs, xe) = self.init.getRanges()[0]
xs, xe = self.init.getRanges()[0]
for i in range(xs, xe):
row.i = i
row.field = 0
Expand Down
6 changes: 2 additions & 4 deletions pySDC/implementations/problem_classes/Piline.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,8 @@ def u_exact(self, t, u_init=None, t_init=None):
if t > 0.0:
if u_init is not None:
if t_init is None:
raise ValueError(
'Please supply `t_init` when you want to get the exact solution from a point that \
is not 0!'
)
raise ValueError('Please supply `t_init` when you want to get the exact solution from a point that \
is not 0!')
me = u_init
else:
t_init = 0.0
Expand Down
1 change: 1 addition & 0 deletions pySDC/implementations/problem_classes/generic_ND_FD.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
Created on Sat Feb 11 22:39:30 2023
"""

import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import gmres, spsolve, cg
Expand Down
1 change: 1 addition & 0 deletions pySDC/implementations/problem_classes/odeScalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
on parallel computers. SIAM journal on scientific and statistical computing,
12(5), 1000-1028.
"""

import numpy as np

from pySDC.core.errors import ProblemError
Expand Down
1 change: 1 addition & 0 deletions pySDC/implementations/problem_classes/odeSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
on parallel computers. SIAM journal on scientific and statistical computing,
12(5), 1000-1028.
"""

import numpy as np

from pySDC.core.errors import ProblemError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_main_parallel():
cmd = f"export PYTHONPATH=$PYTHONPATH:$(pwd); export HWLOC_HIDE_ERRORS=2; mpirun -np {nprocs} python pySDC/projects/AllenCahn_Bayreuth/run_simple_forcing_benchmark.py -n {nprocs}"
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, shell=True)
p.wait()
(output, err) = p.communicate()
output, err = p.communicate()
print(output)
if err:
warnings.warn(err)
Expand All @@ -49,7 +49,7 @@ def test_main_parallel():
cmd = f"export PYTHONPATH=$PYTHONPATH:$(pwd); export HWLOC_HIDE_ERRORS=2; mpirun -np {nprocs} python pySDC/projects/AllenCahn_Bayreuth/run_simple_forcing_benchmark.py -n {nprocs}"
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, shell=True)
p.wait()
(output, err) = p.communicate()
output, err = p.communicate()
print(output)
if err:
warnings.warn(err)
1 change: 0 additions & 1 deletion pySDC/projects/Monodomain/problem_classes/TestODE.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from pySDC.implementations.datatype_classes.mesh import mesh
from pySDC.projects.Monodomain.datatype_classes.my_mesh import imexexp_mesh


"""
Here we define the problems classes for the multirate Dahlquist test equation y'=lambda_I*y + lambda_E*y + lambda_e*y
Things are done so that it is compatible witht the sweepers.
Expand Down
1 change: 0 additions & 1 deletion pySDC/projects/Resilience/collocation_adaptivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from pySDC.implementations.hooks.log_errors import LogLocalErrorPostIter
from pySDC.implementations.hooks.log_embedded_error_estimate import LogEmbeddedErrorEstimatePostIter


# define global parameters for running problems and plotting
CMAP = list(TABLEAU_COLORS.values())

Expand Down
12 changes: 4 additions & 8 deletions pySDC/projects/Resilience/fault_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,8 @@ def add_fault(self, args, rnd_args):
elif type(self.random_generator) == np.random.RandomState:
self.add_random_fault(args, rnd_args)
else:
raise NotImplementedError(
f'Don\'t know how to add fault with generator of type \
{type(self.random_generator)}'
)
raise NotImplementedError(f'Don\'t know how to add fault with generator of type \
{type(self.random_generator)}')

def add_stored_faults(self):
'''
Expand Down Expand Up @@ -335,10 +333,8 @@ def pre_run(self, step, level_number):
super().pre_run(step, level_number)

if not type(step.levels[level_number].u[0]) == mesh:
raise NotImplementedError(
f'Fault insertion is only implemented for type mesh, not \
{type(step.levels[level_number].u[0])}'
)
raise NotImplementedError(f'Fault insertion is only implemented for type mesh, not \
{type(step.levels[level_number].u[0])}')

dtype = step.levels[level_number].prob.u_exact(t=0).dtype
if dtype in [float, np.float64]:
Expand Down
24 changes: 8 additions & 16 deletions pySDC/projects/Resilience/fault_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,10 +1009,8 @@ def analyse_adaptivity(self, mask): # pragma: no cover
print('-------+-----+------+------+----------+----------+----------+----------')
for i in index:
e_em, e_glob = self.analyse_adaptivity_single(int(i))
print(
f' {i:5d} | {dat["bit"][i]:3.0f} | {dat["node"][i]:4.0f} | {dat["iteration"][i]:4.0f} | {e_em[1]:.2e}\
| {e_em[0]:.2e} | {e_glob[1]:.2e} | {e_glob[0]:.2e}'
)
print(f' {i:5d} | {dat["bit"][i]:3.0f} | {dat["node"][i]:4.0f} | {dat["iteration"][i]:4.0f} | {e_em[1]:.2e}\
| {e_em[0]:.2e} | {e_glob[1]:.2e} | {e_glob[0]:.2e}')

e_tol = AdaptivityStrategy().get_custom_description(self.prob, self.num_procs)['convergence_controllers'][
Adaptivity
Expand Down Expand Up @@ -1070,21 +1068,15 @@ def analyse_HotRod(self, mask): # pragma: no cover
dat = self.load()

# make a header
print(
' run | bit | node | iter | e_ex^* | e_ex | e_em^* | e_em | diff* | diff | e_glob^* \
| e_glob '
)
print(
'-------+-----+------+------+----------+----------+----------+----------+----------+----------+----------\
+----------'
)
print(' run | bit | node | iter | e_ex^* | e_ex | e_em^* | e_em | diff* | diff | e_glob^* \
| e_glob ')
print('-------+-----+------+------+----------+----------+----------+----------+----------+----------+----------\
+----------')
for i in index:
e_em, e_ex, e_glob = self.analyse_HotRod_single(int(i))
print(
f' {i:5d} | {dat["bit"][i]:3.0f} | {dat["node"][i]:4.0f} | {dat["iteration"][i]:4.0f} | {e_ex[1]:.2e}\
print(f' {i:5d} | {dat["bit"][i]:3.0f} | {dat["node"][i]:4.0f} | {dat["iteration"][i]:4.0f} | {e_ex[1]:.2e}\
| {e_ex[0]:.2e} | {e_em[1]:.2e} | {e_em[0]:.2e} | {abs(e_em[1]-e_ex[1]):.2e} | {abs(e_em[0]-e_ex[0]):.2e} | \
{e_glob[1]:.2e} | {e_glob[0]:.2e}'
)
{e_glob[1]:.2e} | {e_glob[0]:.2e}')

tol = HotRodStrategy().get_custom_description(self.prob, self.num_procs)['convergence_controllers'][HotRod][
'HotRod_tol'
Expand Down
1 change: 0 additions & 1 deletion pySDC/projects/Resilience/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from pySDC.implementations.hooks.log_extrapolated_error_estimate import LogExtrapolationErrorEstimate
from pySDC.implementations.hooks.log_step_size import LogStepSize


hook_collection = [LogSolution, LogEmbeddedErrorEstimate, LogExtrapolationErrorEstimate, LogStepSize]


Expand Down
1 change: 0 additions & 1 deletion pySDC/projects/Resilience/paper_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from pySDC.helpers.plot_helper import setup_mpl, figsize_by_journal
from pySDC.helpers.stats_helper import get_sorted


cm = 1 / 2.5
TEXTWIDTH = 11.9446244611 * cm
JOURNAL = 'Springer_Numerical_Algorithms'
Expand Down
Loading