From fabd0369ec60aa46fa2d2e295e4fbc4e794d9f2e Mon Sep 17 00:00:00 2001 From: jakob-fritz <37077134+jakob-fritz@users.noreply.github.com> Date: Fri, 6 Sep 2024 17:01:47 +0200 Subject: [PATCH 1/4] Added path to download artifacts from Gitlab-CI to (#477) --- .github/workflows/gitlab_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gitlab_ci.yml b/.github/workflows/gitlab_ci.yml index bc98ee442f..5032bd92ff 100644 --- a/.github/workflows/gitlab_ci.yml +++ b/.github/workflows/gitlab_ci.yml @@ -125,6 +125,7 @@ jobs: uses: actions/download-artifact@v4 with: merge-multiple: true + path: ./github_ci_artifacts - name: Set env-var id: get_id uses: actions/github-script@v7 From c82a3a1a655b4c64a9c8242057c57dc25570e2fb Mon Sep 17 00:00:00 2001 From: jakob-fritz <37077134+jakob-fritz@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:32:00 +0200 Subject: [PATCH 2/4] Coverage-reports from Gitlab are now found and combined (#478) * Unzip artifacts from Gitlab-CI * Corrected wrong rm-command * Unzipped files are located somewhere else not in pwd * Another try for extraction and commented out other long-running jobs in CI (will be added at the end) * Search newly created directories * Accidentally commited some weird char * Moved file-listing and changed find-command * Struggling with find-command * Pass files separately to unzip * Corrected order of unzip * termination need to be properly escaped * Explicitly uploading the unzipped artifacts * Run all jobs again --- .github/workflows/gitlab_ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/gitlab_ci.yml b/.github/workflows/gitlab_ci.yml index 5032bd92ff..4b319c4bfb 100644 --- a/.github/workflows/gitlab_ci.yml +++ b/.github/workflows/gitlab_ci.yml @@ -115,6 +115,22 @@ jobs: GITLAB_PROJECT_ID: "6029" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MIRROR_BRANCH: ${{ env.MIRROR_BRANCH }} + - name: Unzip downloaded artifacts + run: | + pwd + ls -lah + cd artifacts + find . -name "*.zip" -type f -exec unzip -o {} \; + ls -lah + rm *.zip + cd .. + ls -lah + - name: Uploading artifacts + uses: actions/upload-artifact@v4 + with: + name: Gitlab-Action_artifacts + path: | + ./artifacts/* get_artifacts_from_other_workflow: runs-on: ubuntu-latest From c2701a0ee4b1811365051c53c5dc1d857c72d7cd Mon Sep 17 00:00:00 2001 From: Thomas Baumann <39156931+brownbaerchen@users.noreply.github.com> Date: Wed, 11 Sep 2024 08:36:30 +0200 Subject: [PATCH 3/4] More efficient globally stiffly accurate DIRK (#479) * Removed "collocation update" for globally stiffly accurate RK methods * Fixed new reference values --- .../sweeper_classes/Runge_Kutta.py | 25 ++++++++++++------- pySDC/projects/Resilience/strategies.py | 4 +-- .../test_sweepers/test_Runge_Kutta_sweeper.py | 2 +- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/pySDC/implementations/sweeper_classes/Runge_Kutta.py b/pySDC/implementations/sweeper_classes/Runge_Kutta.py index ac9f9d39a1..bc43e3dfbe 100644 --- a/pySDC/implementations/sweeper_classes/Runge_Kutta.py +++ b/pySDC/implementations/sweeper_classes/Runge_Kutta.py @@ -37,17 +37,24 @@ def __init__(self, weights, nodes, matrix): elif len(nodes) != matrix.shape[0]: raise ParameterError(f'Incompatible number of nodes! Need {matrix.shape[0]}, got {len(nodes)}') - # Set number of nodes, left and right interval boundaries - self.num_solution_stages = 1 - self.num_nodes = matrix.shape[0] + self.num_solution_stages + self.globally_stiffly_accurate = np.allclose(matrix[-1], weights) + self.tleft = 0.0 self.tright = 1.0 - - self.nodes = np.append(np.append([0], nodes), [1]) + self.num_solution_stages = 0 if self.globally_stiffly_accurate else 1 + self.num_nodes = matrix.shape[0] + self.num_solution_stages self.weights = weights - self.Qmat = np.zeros([self.num_nodes + 1, self.num_nodes + 1]) - self.Qmat[1:-1, 1:-1] = matrix - self.Qmat[-1, 1:-1] = weights # this is for computing the solution to the step from the previous stages + + if self.globally_stiffly_accurate: + # For globally stiffly accurate methods, the last row of the Butcher tableau is the same as the weights. + self.nodes = np.append([0], nodes) + self.Qmat = np.zeros([self.num_nodes + 1, self.num_nodes + 1]) + self.Qmat[1:, 1:] = matrix + else: + self.nodes = np.append(np.append([0], nodes), [1]) + self.Qmat = np.zeros([self.num_nodes + 1, self.num_nodes + 1]) + self.Qmat[1:-1, 1:-1] = matrix + self.Qmat[-1, 1:-1] = weights # this is for computing the solution to the step from the previous stages self.left_is_node = True self.right_is_node = self.nodes[-1] == self.tright @@ -277,7 +284,7 @@ def update_nodes(self): rhs += lvl.dt * self.QI[m + 1, j] * self.get_full_f(lvl.f[j]) # implicit solve with prefactor stemming from the diagonal of Qd, use previous stage as initial guess - if self.coll.implicit: + if self.QI[m + 1, m + 1] != 0: lvl.u[m + 1][:] = prob.solve_system( rhs, lvl.dt * self.QI[m + 1, m + 1], lvl.u[m], lvl.time + lvl.dt * self.coll.nodes[m + 1] ) diff --git a/pySDC/projects/Resilience/strategies.py b/pySDC/projects/Resilience/strategies.py index e080e90cc3..2d4edaa689 100644 --- a/pySDC/projects/Resilience/strategies.py +++ b/pySDC/projects/Resilience/strategies.py @@ -1242,7 +1242,7 @@ def get_reference_value(self, problem, key, op, num_procs=1): """ if problem.__name__ == "run_Lorenz": if key == 'work_newton' and op == sum: - return 1820 + return 1456 elif key == 'e_global_post_run' and op == max: return 0.00013730538358736055 @@ -1433,7 +1433,7 @@ def get_reference_value(self, problem, key, op, num_procs=1): """ if problem.__name__ == "run_Lorenz": if key == 'work_newton' and op == sum: - return 984 + return 820 elif key == 'e_global_post_run' and op == max: return 3.148061889390874e-06 diff --git a/pySDC/tests/test_sweepers/test_Runge_Kutta_sweeper.py b/pySDC/tests/test_sweepers/test_Runge_Kutta_sweeper.py index c1a3c65c26..35ed4f7150 100644 --- a/pySDC/tests/test_sweepers/test_Runge_Kutta_sweeper.py +++ b/pySDC/tests/test_sweepers/test_Runge_Kutta_sweeper.py @@ -357,5 +357,5 @@ def test_RK_sweepers_with_GPU(test_name, sweeper_name): if __name__ == '__main__': # test_rhs_evals('ARK54') - test_order('ARK548L2SAERK2') + test_order('CrankNicholson') # test_order('ARK54') From f46209f26ca77309531c3b43dcb2eb34fa82f078 Mon Sep 17 00:00:00 2001 From: Thomas Baumann <39156931+brownbaerchen@users.noreply.github.com> Date: Fri, 13 Sep 2024 12:48:37 +0200 Subject: [PATCH 4/4] Bugfix in computing absolute value with cupy datatype (#480) --- pySDC/implementations/datatype_classes/cupy_mesh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pySDC/implementations/datatype_classes/cupy_mesh.py b/pySDC/implementations/datatype_classes/cupy_mesh.py index 01b9dde1e8..0b27524f32 100644 --- a/pySDC/implementations/datatype_classes/cupy_mesh.py +++ b/pySDC/implementations/datatype_classes/cupy_mesh.py @@ -1,5 +1,4 @@ import cupy as cp -from pySDC.core.errors import DataError try: from mpi4py import MPI @@ -37,6 +36,7 @@ def __new__(cls, init, val=0.0, **kwargs): ): obj = cp.ndarray.__new__(cls, init[0], dtype=init[2], **kwargs) obj.fill(val) + cls.comm = init[1] else: raise NotImplementedError(type(init)) return obj