sseyler / HERMESHD

HERMESHD is a discontinuous Galerkin 3D fluctuating hydrodynamics code for nanoscale fluid simulation
Other
10 stars 11 forks source link

PERSEUSHD currently uses fixed-shape arrays (determined at compile-time) #4

Open sseyler opened 7 years ago

sseyler commented 7 years ago

As PERSEUSHD currently stands, arrays storing the field variables (on the grid) have their shapes set at compile time through global variables specified by the user. If PERSEUSHD is to be called as a library, especially when being used as part of a hybrid code, then the array shapes should be determined dynamically (at runtime). Otherwise, PERSEUSHD must be re-compiled each time the spatial decomposition is changed. I believe this necessitates the use of allocatable arrays. These can be allocated once in an appropriate module at the start of a run and then re-used as much as possible (rather than constantly allocated/deallocated within a subroutine).

Note: subroutines intended to be exposed to, say, Python will not work with allocatable arrays as arguments.

In the end, we want to be able to:

sseyler commented 7 years ago

See Issue #6.

Experiential note: using allocatable arrays would have made benchmarking far easier, because the code wouldn't have had to be re-compiled each time the problem size changed—the grid resolution and basis function order could have been fed into already-compiled code. This is especially true when looking at weak scaling (where the problem size scales proportionally to the number of processing elements).