Skip to content

Refactor grid generation: generate indices locally and optionally use a space-filling Hilbert curve

Sebastian Ohlmann requested to merge use_hilbert_indexing into develop

Description

Get rid of the lxyz and lxyz_inv arrays and make the indexing more versatile by using explicit index conversion routines, by default with cubic indices, optionally with a space-filling Hilbert curve to generate the indices. The generation of the indices is now done fully in parallel with the exception of the global hash maps that are generated on each rank.

Also remove the old multiresolution implementation because it was strongly tied to the way the lxyz and lxyz_inv arrays worked.

Moreover, the mesh ordering is now dominant in x, y, z directions (not the other way around as before) and the mesh2cube and cube2mesh functions take this ordering into account. This should make them much faster because the memory access is much more aligned and linear than before (when it was the worst possible order for memory access).

Some testing of the performance gave an improvement of 10-20%. The performance depends strongly on the values of MeshBlockSize because this determines how efficiently caches are used.

News snippet

Refactor grid generation: generate indices locally and optionally use a space-filling Hilbert curve

Checklist

  • I have checked that my code follows the Octopus coding standards
  • I have added tests for all the new features added in this request.
Edited by Sebastian Ohlmann

Merge request reports