Distinguish between local and global reduction handles
Local and global reduction handles both use small integers. This means that code may accidentally confuse one for the other.
To avoid this, we could add large, different offsets for local and global handles, so that they would be different. We already do this for other integer IDs in the flesh.
Keyword:
Comments (10)
-
-
- edited description
- changed status to open
-
-
Please review.
-
Of note: CarpetReduce is one of the codes that confuses them, so this is by no means unlikely to happen
. Fixed in rhaas/reductionhandles of CarpetReduce.
There’ may be more thorns doing the same (often using
CCTK_ReduceLocalScalar
) leading to failed tests. -
Also affected are: cactusnumerical, cactusutils, einsteinanalysis, pittnullcode
-
reporter This looks good. Please apply, once all users of this code have been corrected. You might also want to announce this via email to warn people about this.
-
Fixes to user thorns (cactusnumerical and pittnullcode are already in ET_2020_11):
- https://bitbucket.org/einsteintoolkit/einsteinanalysis/pull-requests/16/hydro_analysis-use-correct-reduction
- https://bitbucket.org/cactuscode/cactusutils/pull-requests/36/nanchecker-user-correct-reduction-handle
- https://bitbucket.org/eschnett/carpet/pull-requests/42/carpetreduce-distinguish-between-array-and
-
Applied as git hash 458bded "NaNChecker: user correct reduction handle with ReduceLocalScalar" of cactusutils
Applied as git hash 664a7f8d "Hydro_Analysis: use correct reduction handle with ReduceLocArrayToArray1D" of einsteinanalysis
Applied as git hash 6482a628 "CarpetReduce: distinguish between array and gf reduction ops in test" of carpet
Applied as git hash 32def5eb "Cactus: use different handle ranges for old-style array and grid reductions" of cactus
-
- changed status to resolved
- Log in to comment
Local and global here refer to the handles returned by
respectively.