Bears-R-Us / arkouda-njit

Home of Arachne and other Arkouda functionality provided by researchers at NJIT
MIT License
21 stars 13 forks source link

Arachne build breaks on Chapel 1.33 with `CHPL_COMM` set to `none` #122

Closed alvaradoo closed 6 months ago

alvaradoo commented 6 months ago

Using the following commands to set the Chapel environment on version 1.33:

source $CHPL_HOME/util/setchplenv.bash
export CHPL_RE2=bundled
export CHPL_LLVM=bundled
export CHPL_GMP=bundled
export CHPL_COMM=none

We get the following error when building Arachne:

/scratch/users/oaa9/arkouda-njit/arachne/server/Utils.chpl:17: In function 'fastLocalSubdomain':
/scratch/users/oaa9/arkouda-njit/arachne/server/Utils.chpl:19: error: unresolved call 'unmanaged domain(1,int(64),one).locDoms[int(64)]'
$CHPL_HOME/modules/dists/BlockDist.chpl:546: note: this candidate did not match: BlockDom.locDoms
/scratch/users/oaa9/arkouda-njit/arachne/server/Utils.chpl:19: note: because call includes 1 argument
$CHPL_HOME/modules/dists/BlockDist.chpl:546: note: but function can only accept 0 arguments
/scratch/users/oaa9/arkouda-njit/arachne/server/Utils.chpl:19: note: other candidates are:
$CHPL_HOME/modules/dists/SparseBlockDist.chpl:89: note:   SparseBlockDom.locDoms
  /scratch/users/oaa9/arkouda-njit/arachne/server/Utils.chpl:65: called as fastLocalSubdomain(blockArray: [domain(1,int(64),one)] int(64)) from function 'generateRanges'
  /scratch/users/oaa9/arkouda-njit/arachne/server/BuildGraphMsg.chpl:98: called as generateRanges(graph: shared SegGraph, key: string, key2insert: string, array: [domain(1,int(64),one)] int(64))
note: generic instantiations are underlined in the above callstack
make: *** [Makefile:359: arkouda_server] Error 1
make: Leaving directory '/scratch/users/oaa9/arkouda'

This is caused due to BlockDom.locDoms in Chapel expecting 1 argument when CHPL_COMM is set and 0 arguments when CHPL_COMM is none.

alvaradoo commented 6 months ago

Temporary fix replaces the existing fastLocalSubdomain procedure with below code:

    /* A fast variant of localSubdomain() assumes 'blockArray' is a block-distributed array
        if it breaks, replace it with:
            inline proc fastLocalSubdomain(arr) do return arr.localSubdomain();*/
    // proc fastLocalSubdomain(const ref blockArray) const ref {
    //     assert(blockArray.targetLocales()[here.id] == here);
    //     return blockArray._value.dom.locDoms[here.id].myBlock;
    // }
    // NOTE: Temporary fix, waiting to hear back from Chapel developers on how to pick between 
    //       functions at compile-time.
    inline proc fastLocalSubdomain(arr) do return arr.localSubdomain();