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

Reorder arrays #15

Open
aosprey opened this issue Sep 29, 2021 · 0 comments
Open

Reorder arrays #15

aosprey opened this issue Sep 29, 2021 · 0 comments

Comments

@aosprey
Copy link
Owner

aosprey commented Sep 29, 2021

Arrays are dimensioned as array(npts,nz) which means that the npts dimension varies fastest. So it is more efficient to access elements 1 level at a time, eg:

do k = 1,  nz
  do n = 1,  npts 
    array(n,k) 
  end do 
end do 

However in KPP, we actually access data the other way around, as the physics code operates on one grid point at a time. So it would be much more efficient if the levels were contiguous in memory, and the arrays dimensioned as array(nz,npts).

This would also make the MPI parallelisation easier, as we would be parallelising over the outer dimension.

For 3d arrays the position of the extra dimension depends on the access patterns - so I need to check this.

@aosprey aosprey added the priority Deal with this first label Sep 29, 2021
@aosprey aosprey removed the priority Deal with this first label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant