chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.8k stars 421 forks source link

spike: visibility issue in RA/diten #11314

Closed vasslitvinov closed 5 years ago

vasslitvinov commented 6 years ago

The code at the bottom is a simplification of the current code in test/studies/hpcc/RA/diten/, with a range shape 0..#numLocs replaced by a domain shape LocaleSpace. (Any domain can be used instead.) This replacement simulates what would happen in that RA test if we switched shape preservation for ranges from using the shape-less initCopy (#10942) to the shape-ful one (added for domains in #9994).

In that code I am currently getting:

In function 'chpl__staticFastFollowCheck':
error: unresolved call 'physicalMemory3([domain(1,int(64),false)] locale)'

This appears to be due to incorrect visibility of a compiler-generate function upon a loop expression.

Test :

// arrays/shapes/visibility-error.chpl

module m1 {
  use m2;

  proc main() {
    const totalMem = + reduce physicalMemory3(Locales);    // the error is reported here
    var myBuckets = new unmanaged Buckets();
  }

  proc physicalMemory3(arg:locale) return 0;
}

module m2 {
  class Buckets {
    var BucketArray = [idx in LocaleSpace] 777;
  }
}
bradcray commented 6 years ago

@vasslitvinov / @benharsh: What are the challenges involved in deprecating uses of initCopy() on domains in favor of initializers?

benharsh commented 6 years ago

Isn't this about the initCopy for _iteratorRecord? If so, I think it falls into the same bucket as the sync/single/array-slice unwrapping problem.

vasslitvinov commented 6 years ago

I have not looked into that question. BenH/Lydia probably have a better understanding.