Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement an iterative Poisson solver #69

Draft
wants to merge 130 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
7a342be
Add a Poisson solver selection mechanism.
semi-h Feb 15, 2024
bcd1056
Implement a dedicated class for the FFT based Poisson solver.
semi-h Feb 15, 2024
e6c488b
Store compact scheme coefficients in tdsops class.
semi-h Feb 15, 2024
d4c6831
Store domain length and dx in dirps_t.
semi-h Feb 19, 2024
d0d11d9
Change the way we initialise poisson_fft class.
semi-h Feb 19, 2024
9cbdf95
Construct the waves array for all periodic BCs.
semi-h Feb 19, 2024
9d36b6b
Create cufft plans.
semi-h Feb 19, 2024
bcbaf18
Add postprocessing in spectral space.
semi-h Feb 19, 2024
2b648d2
Merge branch 'poisson' into 44-poisson-solver-iterative-solver
pbartholomew08 Feb 20, 2024
11a6960
Ignore emacs project configuration file
pbartholomew08 Feb 20, 2024
fad59f1
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Feb 20, 2024
257b4ee
Add a Poisson solver selection mechanism.
semi-h Feb 15, 2024
87f0763
Implement a dedicated class for the FFT based Poisson solver.
semi-h Feb 15, 2024
dc3fe5c
Store compact scheme coefficients in tdsops class.
semi-h Feb 15, 2024
7d67a0e
Store domain length and dx in dirps_t.
semi-h Feb 19, 2024
bbe17d6
Change the way we initialise poisson_fft class.
semi-h Feb 19, 2024
266c3a9
Construct the waves array for all periodic BCs.
semi-h Feb 19, 2024
b1a3589
Create cufft plans.
semi-h Feb 19, 2024
b138b40
Add postprocessing in spectral space.
semi-h Feb 19, 2024
4953d87
Store plans at poisson_fft class level.
semi-h Feb 20, 2024
4cde72d
Add forward FFT transforms.
semi-h Feb 21, 2024
178c920
Add backward FFT transforms.
semi-h Feb 21, 2024
7893007
Fix allocation size of the waves array on GPU.
semi-h Feb 21, 2024
de51f15
Change shape of the c_x/y/z arrays.
semi-h Feb 21, 2024
994e83e
Add postprocessing kernel call.
semi-h Feb 21, 2024
f609516
Add complex reordering functions.
semi-h Feb 22, 2024
1f5564a
Call complex reordering functions in forward and backward FFTs.
semi-h Feb 22, 2024
add29cc
No need to initialise backends with dirps any more.
semi-h Feb 22, 2024
b982e52
Cleanups.
semi-h Feb 22, 2024
8e1f39b
Cleanup and style fix.
semi-h Mar 1, 2024
03a8a34
Add reshape subrotines for transposing pencil groups.
semi-h Mar 1, 2024
6399546
Use reshapes to carry out local transposes.
semi-h Mar 1, 2024
872b2d7
Change the Poisson solver selection mechanism.
semi-h Mar 1, 2024
c424f12
Add initial conditions for TGV.
semi-h Mar 1, 2024
4dcfc0f
Merge branch 'poisson' into 44-poisson-solver-iterative-solver
pbartholomew08 Mar 4, 2024
6e422d4
Add configure option to select FFT or Iterative Poisson solver
pbartholomew08 Mar 4, 2024
9a2756e
Find and link PETSc
pbartholomew08 Mar 4, 2024
4b1dc1d
Outline the skeleton of the iterative solver class
pbartholomew08 Mar 5, 2024
f7cf502
Make the possmult subroutine iterative-solver independent
pbartholomew08 Mar 5, 2024
bc55cab
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Mar 7, 2024
3d064fb
Remove dirps from backend initialisation (correcting merge)
pbartholomew08 Mar 8, 2024
16ca40d
Remove redefinition of simulation parameters
pbartholomew08 Mar 8, 2024
2b723cc
Move the PETSc definitions to a PETSc-specific submodule
pbartholomew08 Mar 9, 2024
61f6240
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Mar 18, 2024
83019fa
Ensure POISSON_SOLVER is set in CMakeLists before testing value
pbartholomew08 Mar 18, 2024
e556fdb
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Mar 22, 2024
f8e80be
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Apr 2, 2024
332cf8e
Indent consistently with fprettify
pbartholomew08 Apr 2, 2024
161f8d3
Add PETSc->x3d2->PETSc operations
pbartholomew08 Apr 3, 2024
966782d
Remove out of date comment
pbartholomew08 Apr 3, 2024
f91b436
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Apr 30, 2024
5a6a384
Implement test for Laplacian operator
pbartholomew08 May 3, 2024
cdcfb82
Make the CG/Laplacian test serial for now
pbartholomew08 May 13, 2024
d895b99
Add test for Laplacian with variable field
pbartholomew08 Jun 21, 2024
e0b8afe
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Jun 21, 2024
53c54d7
Bump the Fortran standard to F2018 for GNU compilers
pbartholomew08 Jun 21, 2024
c051136
Merge branch 'update-to-F2018' into 44-poisson-solver-iterative-solver
pbartholomew08 Jun 21, 2024
33cc367
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Jun 21, 2024
72b5400
Update PETSc/CG solver to use mesh object
pbartholomew08 Jun 24, 2024
40c7f15
Cleanup PETSc/Poisson solver
pbartholomew08 Jun 24, 2024
1a5e1dd
Correct typo in CG test
pbartholomew08 Jun 24, 2024
b03e7da
Implement OMP scalar product
pbartholomew08 Jun 24, 2024
c1ea615
Implement vecAdd
pbartholomew08 Jun 25, 2024
73b4372
Add error messages to mesh dims getters
pbartholomew08 Jun 25, 2024
5ab5c11
Implement OMP sum_yintox
pbartholomew08 Jun 25, 2024
154f63d
Implement OMP sum_zintox
pbartholomew08 Jun 26, 2024
cf02979
Implement vecadd and scalar product in vectorised form
pbartholomew08 Jun 26, 2024
c007d31
Make sure inner loop indices are private
pbartholomew08 Jun 26, 2024
8076ed7
Run fprettify
pbartholomew08 Jun 26, 2024
cd8658e
Merge branch '93-implement-omp-backend-for-basic-math-operators' into…
pbartholomew08 Jun 27, 2024
842fecb
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Jul 3, 2024
72e43f8
Rewrite Poisson/CG test to support refinement
pbartholomew08 Jul 3, 2024
ccb78f7
Poisson CG test passes for varying field
pbartholomew08 Jul 8, 2024
b1bd12f
Improve CG/Poisson test
pbartholomew08 Jul 8, 2024
7c79fe0
Ensure test status is always set in Poisson/CG Laplacian test
pbartholomew08 Jul 8, 2024
389541d
Simplify the Poisson_CG interface
pbartholomew08 Jul 9, 2024
a928c1f
Update the Poisson object
pbartholomew08 Jul 21, 2024
fea6d3e
Fix error in backend
pbartholomew08 Jul 21, 2024
022015a
Pass backend (target) through Poisson CG
pbartholomew08 Jul 21, 2024
49fd0fa
Allocate backend in CG test
pbartholomew08 Jul 21, 2024
96cbf32
Give up passing matrix context and use a module global
pbartholomew08 Jul 21, 2024
5b9300e
Remove debug prints
pbartholomew08 Jul 21, 2024
bbc4176
Refine matrix through test
pbartholomew08 Jul 21, 2024
80185d6
Rewrite Poisson CG to run in DIR_Z orientation
pbartholomew08 Jul 21, 2024
fd1b6e9
Add a 7-point star preconditioner (WIP)
pbartholomew08 Jul 21, 2024
b2220fe
Analytical solution and RHS were back to front
pbartholomew08 Jul 21, 2024
2bef93b
Correct order of setting mat options
pbartholomew08 Jul 22, 2024
8dcbfad
Check if PETSc is initialised (for convergence testing, etc)
pbartholomew08 Jul 22, 2024
f3824e8
Finalise PETSc in test
pbartholomew08 Jul 22, 2024
fb84bc9
Initialise PETSc properly
pbartholomew08 Jul 22, 2024
60b2726
Set Null space on Poisson matrices
pbartholomew08 Jul 22, 2024
9852c2d
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Jul 25, 2024
24fe79d
Update iterative Poisson solver to latest x3d2 and begin parallelisation
pbartholomew08 Jul 30, 2024
2c4340c
Correct solver setup - use O6 operator, O2 preconditioner
pbartholomew08 Jul 30, 2024
fa6fc6a
Revert to serial preconditioner for time being
pbartholomew08 Jul 30, 2024
141c12e
Clean up test
pbartholomew08 Jul 30, 2024
da72568
Integrate CG Poisson with solver -- serial only
pbartholomew08 Jul 30, 2024
d10704c
Nonzero initial guess goes faster
pbartholomew08 Jul 30, 2024
706058c
Implement halo->global map for PETSc/Poisson preconditioner
pbartholomew08 Aug 26, 2024
6da38b5
Correct local counter for index map
pbartholomew08 Sep 2, 2024
918d693
Correcting how the local map is built
pbartholomew08 Sep 2, 2024
0a84154
Correct seeting entries in the matrix
pbartholomew08 Sep 2, 2024
66fab59
Fix deadlock issue in preconditioner definition
pbartholomew08 Sep 2, 2024
b671eef
Resolve parallel indexing issues for PETSc
pbartholomew08 Oct 21, 2024
10f8833
Test the Poisson solver in parallel
pbartholomew08 Oct 28, 2024
824c631
Generalise the Poisson evaluation test to work with generic linear op…
pbartholomew08 Oct 28, 2024
48580f7
Correct preconditioner indices
pbartholomew08 Nov 12, 2024
a724a5d
Integrate preconditioner class and CG class
pbartholomew08 Dec 2, 2024
c54191e
Documenting the Poisson/CG code
pbartholomew08 Dec 2, 2024
079d9a6
Enable building the project without PETSc
pbartholomew08 Feb 10, 2025
4fadb10
Silence unused compiler warnings
pbartholomew08 Feb 10, 2025
c0649b9
Enable running the high-order Poisson operator tests without PETSc
pbartholomew08 Feb 10, 2025
816bc70
Merge branch 'main' into 44-poisson-solver-iterative-solver
pbartholomew08 Feb 10, 2025
47ac899
Correct Laplacian implementation by setting BCs...
pbartholomew08 Feb 10, 2025
b3116c9
Apply fprettify
pbartholomew08 Feb 10, 2025
12f0b2a
Re-apply fprettify
pbartholomew08 Feb 10, 2025
e24619e
Remove submodules (CG/dummy) build
pbartholomew08 Feb 10, 2025
4295cdc
Remove submodules (CG/petsc) build
pbartholomew08 Feb 11, 2025
ccd92a9
Test change of field location due to set_field_data
pbartholomew08 Feb 13, 2025
25cdd3b
Correct set_field_data implementation to prevent changing the field's…
pbartholomew08 Feb 13, 2025
639e97c
Correcting test
pbartholomew08 Feb 13, 2025
577edeb
Remove unused variables from test
pbartholomew08 Feb 13, 2025
846c6b6
Correct extracting array shape in field set tests
pbartholomew08 Feb 17, 2025
bc990da
Merge branch '156-calling-set_field_data-drops-fields-data-location-w…
pbartholomew08 Feb 17, 2025
d9ee2a5
Implementing div(grad) in vector calculus for Poisson solver
pbartholomew08 Feb 18, 2025
5b057bd
WIP: Implement 27-point Poisson preconditioner
pbartholomew08 Feb 18, 2025
f135b17
Implement 27-point preconditioner based on PETSc DMDA
pbartholomew08 Feb 23, 2025
a850241
27-point stencil application working in serial
pbartholomew08 Feb 27, 2025
4178b2e
Fix DMDA vector interactions
pbartholomew08 Feb 27, 2025
df157cf
Correct pointer use in PETSc solver
pbartholomew08 Mar 3, 2025
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
Prev Previous commit
Next Next commit
Make sure inner loop indices are private
pbartholomew08 committed Jun 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit c007d3115378eddb39d7afc7784598d81eb45d45
8 changes: 4 additions & 4 deletions src/omp/backend.f90
Original file line number Diff line number Diff line change
@@ -384,13 +384,13 @@ subroutine sum_intox_omp(self, u, u_, dir_to)

integer :: dir_from
integer, dimension(3) :: dims
integer :: i, j, k ! Working indices
integer :: i, j, k ! Working indices
integer :: ii, jj, kk ! Transpose indices

dir_from = DIR_X

dims = self%mesh%get_padded_dims(u)
!$omp parallel do private(ii, jj, kk) collapse(2)
!$omp parallel do private(i, ii, jj, kk) collapse(2)
do k = 1, dims(3)
do j = 1, dims(2)
do i = 1, dims(1)
@@ -425,7 +425,7 @@ subroutine vecadd_omp(self, a, x, b, y)
nvec = dims(1) / SZ
remstart = nvec * SZ + 1

!$omp parallel do collapse(2)
!$omp parallel do private(i, ii) collapse(2)
do k = 1, dims(3)
do j = 1, dims(2)
! Execute inner vectorised loops
@@ -473,7 +473,7 @@ real(dp) function scalar_product_omp(self, x, y) result(s)
remstart = nvec * SZ + 1

s = 0.0_dp
!$omp parallel do reduction(+:s) collapse(2)
!$omp parallel do reduction(+:s) private(i, ii) collapse(2)
do k = 1, dims(3)
do j = 1, dims(2)
! Execute inner vectorised loops