New Issue: [Bug]: cannot use an array of sublocales in place of 'here.gpus'

25640, "jabraham17", "[Bug]: cannot use an array of sublocales in place of 'here.gpus'", "2024-07-25T19:13:55Z"

I would expect the following 2 coforalls to print the same thing.

coforall i in 0..<here.gpus.size do on here.gpus[i] do writeln(here);

const locales = here.gpus;
coforall i in 0..<here.gpus.size do on locales[i] do writeln(here);

On a system with 2 GPUs, this prints the following

LOCALE0-GPU0
LOCALE0-GPU1
LOCALE0-GPU0
LOCALE0-GPU0

For whatever reason, there is something wrong with using the locales array.

Furthermore, just writing those two arrays out causes problems

writeln(here.gpus);
writeln(locales);

This prints as follows

LOCALE0-GPU0 LOCALE0-GPU1
nil nil

All of the above issues where on a system with 2 nvidia gpus and COMM=none. Out of curiosity, I tried it with COMM=gasnet. The first coforall printed fine, but the second caused a fault in the runtime

*** GASNET WARNING(Node 0): sendPacket returning an error code: AM_ERR_RESOURCE (Problem with requested resource)
  from function sendPacket
  at /chapel/home/abrahaja/chapel/third-party/gasnet/gasnet-src/other/amudp/amudp_reqrep.cpp:112
  reason: Invalid argument

*** GASNET WARNING(Node 0): AMUDP_RequestGeneric returning an error code: AM_ERR_RESOURCE (Problem with requested resource)
  at /chapel/home/abrahaja/chapel/third-party/gasnet/gasnet-src/other/amudp/amudp_reqrep.cpp:1070
*** ERROR (proc 0): GASNet gasnetc_AMRequestMedium encountered an AM Error: AM_ERR_RESOURCE(3)
  at /chapel/home/abrahaja/chapel/third-party/gasnet/gasnet-src/udp-conduit/gasnet_core.c:739
*** WARNING (proc 0): GASNet gasnetc_AMRequestMedium returning an error code: GASNET_ERR_RESOURCE (Problem with requested resource)
  at /chapel/home/abrahaja/chapel/third-party/gasnet/gasnet-src/udp-conduit/gasnet_core.c:741
ERROR calling: gasnet_AMRequestMedium0(node, op, f, small_msg_size)
 at: comm-gasnet-ex.c:1580
 error: GASNET_ERR_RESOURCE (Problem with requested resource)