First, thanks for looking into the standard. I think the information is too much spread through the standard. I keep searching for restrictions, find them at 5 places and miss another 5. With OpenMP 5.2, it became even worse.
On 01.03.22 09:16, Jakub Jelinek wrote:
As there is no explicit allowing of array sections, array sections aren't allowed in detach, and it must be scalar integer. The question is if a non-coindexed coarray is a scalar integer variable or not.
I think the Fortran sense, yes. That only coindexed vars are disallowed also implies this in the OpenMP spec. In terms of the implementation, a local part of a coarray is really not much different from any other variable, except that all coarrays have to be either in static memory or allocatables/pointers (which are collectively allocated). For a non-descriptor variable like: program main integer, save :: a[*] call foo(a) contains subroutine foo(x) integer :: x[*] end end That's also the case for the internal representation: static void * restrict caf_token.2; static integer(kind=4) * restrict a; void foo (integer(kind=4) * restrict x, void * restrict caf_token.0, integer(kind=8) caf_offset.1) 'x' is a pretty normal variable (admittedly, internally now a pointer) which can be used like a noncoarray. (The pointer is there to permit to put the var into some special, remote accessible memory.) Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955