Closed
Description
As reported by Ray Muno on the user mailing list (https://www.mail-archive.com/[email protected]/msg34594.html), op/avx component cannot be linked when the nvhpc compilers are used
CCLD liblocal_ops_avx512.la
CCLD mca_op_avx.la
./.libs/liblocal_ops_avx512.a(liblocal_ops_avx512_la-op_avx_functions.o):(.data+0x0): multiple
definition of `ompi_op_avx_functions_avx2'
./.libs/liblocal_ops_avx2.a(liblocal_ops_avx2_la-op_avx_functions.o):(.data+0x0): first defined here
./.libs/liblocal_ops_avx512.a(liblocal_ops_avx512_la-op_avx_functions.o): In function
`ompi_op_avx_2buff_min_uint16_t_avx2':
/project/muno/OpenMPI/BUILD/SRC/openmpi-4.1.1/ompi/mca/op/avx/op_avx_functions.c:651: multiple
definition of `ompi_op_avx_3buff_functions_avx2'
./.libs/liblocal_ops_avx2.a(liblocal_ops_avx2_la-op_avx_functions.o):/project/muno/OpenMPI/BUILD/SRC/openmpi-4.1.1/ompi/mca/op/avx/op_avx_functions.c:651:
first defined here
make[2]: *** [mca_op_avx.la] Error 2
The root cause is Open MPI assumes the following macros are defined if the compiler supports the AVX512 features we expect
__AVX512BW__
__AVX512F__
__AVX512VL__
and at least one of these macros is not defined by nvhpc compilers
From ompi/mca/op/avx/op_avx_functions.c
#if defined(GENERATE_AVX512_CODE)
# if defined(__AVX512BW__) && defined(__AVX512F__) && defined(__AVX512VL__)
# define PREPEND _avx512
# else
# undef GENERATE_AVX512_CODE
# endif /* defined(__AVX512BW__) && defined(__AVX512F__) && defined(__AVX512VL__) */
#endif /* defined(GENERATE_AVX512_CODE) */
I am wondering whether we really need to re-test these macros. if GENERATE_AVX512_CODE
is defined, should we not be ready to go (and hence no more need to test the avx512 related macros)?