Skip to content

Resolve "Fix overlapping spheres issue on GPU"

Martin Lueders requested to merge 564-fix-overlapping-spheres-issue-on-gpu into main

Description

Currently, systems with self-overlapping projectors (small periodic systems) will not run on GPUs and will not use OMP parallilization in the application of the projectors. This MR will address this issue.

the reason for the problem is that the maps of a submesh, in case of periodic boundary conditions, are in general not injective, i.e. they can map several points of the submesh onto the same global mesh point. This prevents parallelization (including GPU use) of loops which write to the mesh via the map.

The idea is to split the map arrays of the submesh_t into sub-maps or regions, which by themselves are injective, i.e. providing a one-to-one map. Loops over each region can then be parallelized, and in case of the GPU a kernel call for a given region is safe. If the various regions of a map have to be executed sequentially, no further reduction is required.

Subtasks for this MR:

  • Edit submesh_init to split the map into injective regions
  • Modify the projector GPU kernels to handle regions instead of the entire loop over the submesh

News snippet

Allow systems with self-overlapping projectors to run on GPUs

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.

Closes #564 (closed)

Edited by Martin Lueders

Merge request reports