OpenMP_VV icon indicating copy to clipboard operation
OpenMP_VV copied to clipboard

NERSC Some requests from them

Open josemonsalve2 opened this issue 6 years ago • 2 comments

In terms of future extensions to the SOLLVE test-suite. I think it would be useful to have a simple test to ensure that the compiler supports pointer attachment, e.g.

#define SZ 10
struct Array1D {
  double *data;
  int len;
};
#pragma omp target teams distribute parallel for map(tofrom:arr, arr.data[0:SZ])
for (int i=0; i<arr.len; ++i) arr.data[i] += 1.0;

Neither Cray nor GNU support this OpenMP-5.0 feature and it is a showstopper for many applications.

Also, I think it would be useful to have a test which maps a dynamically allocated 2D array to the device. I have only been successful using Clang and IBM compiler to do this. This is a frequent request by application teams, especially those new to GPUs.

josemonsalve2 avatar Nov 26 '19 19:11 josemonsalve2

Neither Cray nor GNU support this OpenMP-5.0 feature

GNU won't be OpenMP 5.0 feature-complete (at least on the front end) until at least GCC 10. Not that I'm disagreeing with your statement that lack of this feature would be a showstopper, instead I am just setting expectations.

dmcdougall avatar Dec 18 '19 19:12 dmcdougall

Regarding the example:

#pragma omp target teams distribute parallel for map(tofrom:arr, arr.data[0:SZ])
for (int i=0; i<arr.len; ++i)
  arr.data[i] += 1.0;

I don't know whether that's valid OpenMP 5 or not; however, GCC 7 to 10 all accept the following: map(tofrom:arr.len, arr.data[0:SZ]) – which should be valid OpenMP 4.5. The original version is rejected with error: ‘arr’ appears more than once in map clauses. (Namely, specifying the whole struct plus components is rejected while specifying multiple component references is accepted.)

Regarding GNU/GCC:

  • For GCC 9's OpenMP 5 support in C/C++, see the GCC 9 Release Notes and especially the linked OpenMP status email. The last larger OpenMP work for gfortran was done for GCC 7 (release notes).
  • GCC 10: For C/C++, some progress was made regarding OpenMP 5 features and bug fixes, still quite some of work remains to be done. The release notes currently do not list the OpenMP changes done for C/C++.
  • GCC 10: On the Fortran side, less progress has been made, except for parts shared with C/C++ and a few bug fixes/minor items (like use_device_addr; listed in the GCC 10 Release Notes). Hence, gfortran is still mostly OpenMP 4.5 with a few missing features on one side but some bits of OpenMP 5 on the other.
  • GCC 10 is currently in development Stage 3 (stage description + timeline); Stage 4 expected in the first half of January and the release probably around April/May. As it is open source, it can already be tested before and Linux distributions have started building GCC 10 as nondefault compiler. – Work on GCC 11 will start when GCC 10 is branched off, which should be around beginning of April.

tob2 avatar Dec 18 '19 21:12 tob2

We have enough coverage of pointer mapping and attachment in the V&V now.

spophale avatar Aug 22 '24 17:08 spophale