eschnett / MPItrampoline

A forwarding MPI implementation that can use any other MPI implementation via an MPI ABI
MIT License
44 stars 4 forks source link

MPIX_Query_cuda_support #41

Closed simonbyrne closed 10 months ago

simonbyrne commented 10 months ago

MPIX_Query_cuda_support appears to return 0, even when the underlying library returns 1

julia> using MPI

julia> ccall((:MPIX_Query_cuda_support, MPI.API.libmpi), Cint, ())
0

julia> ccall((:MPIX_Query_cuda_support, "/central/software/OpenMPI/4.1.5_cuda-12.2//lib/libmpi.so.40"), Cint, ())
1
eschnett commented 10 months ago

MPItrampoline always provides this function, even when the underlying MPI implementation does not. In this case, MPItrampoline returns 0 as a fall-back option.

Given this, it might be that MPIwrapper mis-detected whether this feature is supported when wrapping OpenMPI. Can you check? Do you still have the respective CMakeCache.txt file from building MPIwrapper? I have these lines in my CMakeCache.txt for OpenMPI:

//Test MPI_HAS_QUERY_CUDA_SUPPORT
MPI_HAS_QUERY_CUDA_SUPPORT:INTERNAL=1
eschnett commented 10 months ago

... or there is a bug in MPIwrapper's CMakeLists.txt file, not passing the value of MPI_HAS_QUERY_CUDA_SUPPORT to the compiler. I think the respective lines in mpiwrapper_version.h.in are missing.

simonbyrne commented 10 months ago

I do have

//Test MPI_HAS_QUERY_CUDA_SUPPORT
MPI_HAS_QUERY_CUDA_SUPPORT:INTERNAL=1
eschnett commented 10 months ago

This should now be correct in release 2.10.5 (see https://github.com/eschnett/MPIwrapper/pull/21).

eschnett commented 10 months ago

... to explicit: This was an error in MPIwrapper, not MPItrampoline. You will need to use the newest release of MPIwrapper to wrap you MPI library again. You do not need to update MPItrampoline.