ufs-community / UFS_UTILS

Utilities for the NCEP models.
Other
21 stars 104 forks source link

release/public-v1: setting CPU specific flags is not portable #55

Closed DusanJovic-NOAA closed 4 years ago

DusanJovic-NOAA commented 4 years ago

In sorc/chgres_cube.fd/CMakeLists.txt AVX2 specific flag is set.

https://github.com/NOAA-EMC/UFS_UTILS/blob/512fdd483742e75b6da1430484278e9e0b8ba2d0/sorc/chgres_cube.fd/CMakeLists.txt#L8

This is not portable. For example on Hera I see a lot of warnings like:

../preproc/sorc/chgres_cube.fd/model_grid.F90(141): remark #15009: model_grid_mp_define_input_grid_gaussian_ has been targeted for automatic cpu dispatch
../preproc/sorc/chgres_cube.fd/model_grid.F90(582): remark #15009: model_grid_mp_define_input_grid_gfs_grib2_ has been targeted for automatic cpu dispatch
../preproc/sorc/chgres_cube.fd/model_grid.F90(370): remark #15009: model_grid_mp_define_input_grid_mosaic_ has been targeted for automatic cpu dispatch

We should not use cpu specific flags unless we are cross-compiling, for example on WCOSS Cray or Jet, and in such specific cases those flags should be added conditionally based on user specified option.

climbfuji commented 4 years ago

Can we just remove all these aggressive optimizations / SIMD instructions for the release? Some of those you don't even know what will happen, -xHOST for example might do all sorts of things on newer chips that we haven't tested.

DusanJovic-NOAA commented 4 years ago

Fixed in https://github.com/NOAA-EMC/UFS_UTILS/commit/ac8bfd7a2492894b06b2222a33728bdc451f08f9