Skip to content

[Bug]: Aggressive auto local access causing out-of-bounds errors #27089

Open
@ShreyasKhandekar

Description

@ShreyasKhandekar

Summary of Problem

When working with distributed arrays, we make some arrray accesses local too aggressively causing out of bound errors. This error goes away when compiling with --no-auto-local-access
Description:

Is this issue currently blocking your progress?
Yes, this came up when I was trying to optimize diff in Arkouda

Steps to Reproduce

Source Code:

use BlockDist;
config const size = 1000;
var x = blockDist.createArray({1..size}, real);
var y = blockDist.createArray({1..<size}, real);
forall i in y.domain {
  y[i] = x[i+1] - x[i];
}

Compile command:
chpl autoLocalAccessBug.chpl

Execution command:
./autoLocalAccessBug -nl6 or ./autoLocalAccessBug -nl16

Output

autoLocalAccessBug.chpl:6: error: halt reached - array index out of bounds
note: index was 688 but array bounds are 689..750
autoLocalAccessBug.chpl:6: error: halt reached - array index out of bounds
note: index was 938 but array bounds are 939..1000
autoLocalAccessBug.chpl:6: error: halt reached - array index out of bounds
note: index was 813 but array bounds are 814..875

Associated Future Test(s):
None yet

Configuration Information

- Output of `chpl --version`:
chpl version 2.5.0 pre-release (d8d8b259a48)
  built with LLVM version 15.0.4
  available LLVM targets: nvptx64, nvptx, x86-64, x86, amdgcn, r600
Copyright 2020-2025 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
- Output of `$CHPL_HOME/util/printchplenv --anonymize`:
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: llvm
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: none *
CHPL_LOCALE_MODEL: flat
CHPL_COMM: gasnet *
  CHPL_COMM_SUBSTRATE: udp
  CHPL_GASNET_SEGMENT: everything
CHPL_TASKS: qthreads
CHPL_LAUNCHER: amudprun
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_TARGET_MEM: jemalloc
CHPL_ATOMICS: cstdlib
  CHPL_NETWORK_ATOMICS: none
CHPL_GMP: bundled
CHPL_HWLOC: bundled
CHPL_RE2: bundled
CHPL_LLVM: system
CHPL_AUX_FILESYS: none
- Back-end compiler and version, e.g. `gcc --version` or `clang --version`:
gcc (SUSE Linux) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions