[chapel-lang/chapel] Improvements to array swap optimization and additi

Branch: refs/heads/master
Revision: e710cd8
Author: mcdobe100
Log Message:

Merge pull request #16246 from mcdobe100/array-swap

Improvements to array swap optimization and additional testing

Add additional checking for both Block and Default Rectangular arrays before using the optimized pointer swap. Also, add additional tests checking array swaps on arrays with different dmaps and on different locales (that fail with the old implementation, but were not being tested on the main branch previously).

This makes the optimized array swap much safer and also cleans up the code in ChapelArray to make it more generalizable for future improvements and additions to the doiOptimizedSwap() method (previously called doiSwap(), now doiOptimizedSwap()` to make the name more indicative of what it is doing).

  • [x] paratest gasnet

[ reviewed by @e-kayrakli ] (twice) - thanks Engin

Modified Files:
A test/optimizations/arraySwap/dmapSwap.chpl
A test/optimizations/arraySwap/dmapSwap.good
A test/optimizations/arraySwap/remoteSwap.chpl
A test/optimizations/arraySwap/remoteSwap.good
M modules/dists/BlockDist.chpl
M modules/internal/ChapelArray.chpl
M modules/internal/DefaultRectangular.chpl

Compare: https://github.com/chapel-lang/chapel/compare/1ba4ba6aee4a...e710cd80223c