SWIFTSIM / SWIFT

Modern astrophysics and cosmology particle-based code. Mirror of gitlab developments at https://gitlab.cosma.dur.ac.uk/swift/swiftsim
http://www.swiftsim.com
GNU Lesser General Public License v3.0
88 stars 58 forks source link

Compilation error due to MPI_Waitall #32

Closed adimanuwal closed 1 year ago

adimanuwal commented 1 year ago

Firstly, thanks for producing this code. I encountered the following errors while compiling. How can this be fixed?

engine_strays.c: In function ‘engine_exchange_strays’: engine_strays.c:275:7: error: ‘MPI_Waitall’ accessing 20 bytes in a region of size 0 [-Werror=stringop-overflow=] 275 | if (MPI_Waitall(e->nr_proxies, reqs_out, MPI_STATUSES_IGNORE) != MPI_SUCCESS) | ^~~~~~~~~~~~~ engine_strays.c:275:7: note: referencing argument 3 of type ‘MPI_Status ’ In file included from /usr/include/x86_64-linux-gnu/mpich/mpi.h:977, from engine_strays.c:27: /usr/include/x86_64-linux-gnu/mpich/mpi_proto.h:592:5: note: in a call to function ‘MPI_Waitall’ 592 | int MPI_Waitall(int count, MPI_Request array_of_requests[], MPI_Status array_of_statuses[]) | ^~~ engine_strays.c:538:9: error: ‘MPI_Waitall’ accessing 20 bytes in a region of size 0 [-Werror=stringop-overflow=] 538 | if (MPI_Waitall(5 e->nr_proxies, reqs_out, MPI_STATUSES_IGNORE) != | ^~~~~~~~~~~~~ engine_strays.c:538:9: note: referencing argument 3 of type ‘MPI_Status *’ In file included from /usr/include/x86_64-linux-gnu/mpich/mpi.h:977, from engine_strays.c:27: /usr/include/x86_64-linux-gnu/mpich/mpi_proto.h:592:5: note: in a call to function ‘MPI_Waitall’ 592 | int MPI_Waitall(int count, MPI_Request array_of_requests[], MPI_Status array_of_statuses[])

MatthieuSchaller commented 1 year ago

Hi,

Yes, this is a known bug of mpich. See: https://github.com/pmodels/mpich/wiki/ABI-Change-Wishlist

You can bypass the issue by configuring SWIFT with --enable-compiler-warnings.

adimanuwal commented 1 year ago

That was helpful. Thanks!