NOAA-GFDL / GFDL_atmos_cubed_sphere

The GFDL atmos_cubed_sphere dynamical core code
Other
57 stars 118 forks source link

Proliferation of preprocessor directives due to bug in Intel compiler fixed in latest versions? #162

Closed climbfuji closed 1 month ago

climbfuji commented 3 years ago

There is a proliferation of preprocessor directives around Open MP pragmas in the code, for example:

https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere/blob/d6bfc1573d34cb2df20fe658568d9cca5232565d/model/fv_dynamics.F90#L418

The problem is that the Intel compiler incorrectly required listing pointers in OpenMP shared or private clauses when the default is none. The GNU compiler on the other does not allow listing pointers as shared or private. A discussion with Intel and GNU developers led to the conclusion that GNU was right and Intel was wrong. According to Intel, this was fixed in compiler version 2021.2.

We need to test if this is indeed the case and if decide whether/when we want to to stop supporting older versions of the compiler (at least with OpenMP enabled).

bensonr commented 1 year ago

@climbfuji - should we get this fixed and/or are we onto compiler version support in the UFS that allows this preprocessor macro to be eliminated?

climbfuji commented 1 year ago

I don't think all of the systems are at 2021.2 yet. From https://spack-stack.readthedocs.io/en/latest/PreConfiguredSites.html#pre-configured-sites-tier-1, I see that Cheyenne is still on intel/19.1.1.217, but this system will be decommissioned end of the year.

It would be good to confirm with EMC/NCO (@alexanderrichert-noaa and @hang-lei-noaa) that the compiler used on WCOSS2 is at least 2021.2.0 (acorn is 2022.0.2, but it also has a config entry for intel 19).

If we eliminate the macro, we basically remove support for Intel compilers older than 2021.2.0 (maybe we can still compile w/p openmp for older versions, not sure).

bensonr commented 2 months ago

@climbfuji - have newer Intel compilers fixed this issue and can the macros now be removed?

climbfuji commented 2 months ago

On all R&D HPCs we have intel 2021.3.0 or newer. The only question is WCOSS2. @DusanJovic-NOAA Do you know which Intel compiler version is used on WCOSS2?

DusanJovic-NOAA commented 2 months ago

We currently use:

$ ifort -v
ifort version 19.1.3.304

but there are these modules available:

-------------------- WCOSS2 Core Applications and Compilers --------------------
   PrgEnv-intel/8.0.0        intel-classic/2022.2.0.262
   PrgEnv-intel/8.1.0 (L)    intel-oneapi/2022.2.0.262
   PrgEnv-intel/8.2.0        intel/19.1.3.304           (L)
   PrgEnv-intel/8.3.3 (D)
climbfuji commented 2 months ago

Thanks Dusan. Looks like we need to keep those preprocessor directives around for a little longer

bensonr commented 1 month ago

@DusanJovic-NOAA - just to confirm this was not fixed as part of PR #353 - correct?

DusanJovic-NOAA commented 1 month ago

@DusanJovic-NOAA - just to confirm this was not fixed as part of PR #353 - correct?

I do not see __GFORTRAN__ cpp macros anymore, at least in dev/emc branch. It looks to me it is fixed.

climbfuji commented 1 month ago

Wohoo, thanks Dusan. Took us only three years to clean this up :-)

bensonr commented 1 month ago

Thanks @DusanJovic-NOAA and @climbfuji - I will close this issue now.