Skip to content

Fix various warnings with Intel icx compiler

John Helly requested to merge icx_warnings into master

I've been trying to get SWIFT to build on Cosma with the new Intel icx compiler. I'm currently configuring it with:

module purge
module load intel_comp/2022.3.0 compiler mpi
module load parallel_hdf5/1.14.0 parmetis/4.0.3
module load gsl/2.5 fftw/3.3.10

cd .. && ./autogen.sh && cd -
../configure \
    --enable-debug \
    --with-hdf5 \
    --with-fftw \
    --with-parmetis

This produces several warnings which I've tried to fix:

  • Various instances of hsize_ts being written out with %lli or %llu format strings
  • Unused variables in space_extra.c when SWIFT_DEBUG_CHECKS is not enabled
  • Unused count variable in task.c
  • A couple of functions with no parameters defined with () instead of (void)

And one more which I haven't fixed: if openmp is enabled then it complains that it can't vectorize the loop at the end of gravity_cache.h:

#if !defined(SWIFT_DEBUG_CHECKS) && _OPENMP >= 201307
#pragma omp simd
#endif
  for (int i = 0; i < gcount; ++i) {
    if (active[i]) {
      gparts[i].a_grav[0] += a_x[i];
      gparts[i].a_grav[1] += a_y[i];
      gparts[i].a_grav[2] += a_z[i];
      gravity_add_comoving_potential(&gparts[i], pot[i]);
    }
  }

Merge request reports