Bug: calculate_with method of GridSampler when parallel
When one samples snapshots with GridSampler
, in the end, all snapshots are gathered to the master rank to save memory and avoid storing large duplicate data. When one subsequently uses calculate_with
from the same GridSampler
, it distributes the grid points over ranks and sorts out the corresponding snapshots for each grid point/rank, however, since all snapshots are stored on the master rank only the snapshots for the corresponding grid points are considered, and all others are discarded.
The solution is to distribute also the snapshots before calculation. However, the better way would be to just distribute the snapshots and not care about grid points. Then, this method also does not directly belong to GridSampler
, but rather SnapshotContainer
or similar. Therefore, consider moving this whole method.