-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fortran/mpi_f08: interfaces are missing for device buffer (NVHPC extension) #7250
Comments
I think MPICH would only use IGNORE_TKR in |
Please try without |
Yes, removing |
I verified that the issue is |
The compiler team says we support ignore_tkr (d) to ignore the device attribute. @raffenet how feasible is it to add this to the binding generator for |
We don't use
I think we need add a separate interface with
Is the |
I guess we should configure test it. |
DEVICE is an NVHPC-specific extension for CUDA Fortran. |
Whipped up #7296. Need find a machine to test it. |
I used JLSE |
Hello everyone! I believe that adding interfaces with
https://docs.nvidia.com/hpc-sdk/compilers/cuda-fortran-prog-guide/#variable-qualifiers My idea is that MPI should just ignore all of these attributes |
That isn't necessary. for a in device managed unified pinned ; do /opt/mpich/nvhpc/bin/mpifort -cuda -DATTRIBUTE=$a nvhpc.F90 >& /dev/null || echo ${a} causes the problem ; done ; cat nvhpc.F90
device causes the problem
program main
#if defined(USE_MPI)
use mpi
#define TYPE_MPI_REQUEST integer
#else
use mpi_f08
#define TYPE_MPI_REQUEST type(MPI_Request)
#endif
implicit none
TYPE_MPI_REQUEST :: request
real, ATTRIBUTE, allocatable :: buf(:)
!real, allocatable :: buf(:)
integer :: mpi_ierr
call MPI_Isend(buf( 1 ), 1, MPI_REAL, 1, 0, MPI_COMM_WORLD, request, mpi_ierr)
end program main |
The configure check for this test:
It is not recognizing the following:
So the question is what is the compiler looking for to match -
As it is complaining Our current interfaces are -
We can add more interfaces, but what is |
Let me try adding the EDIT: That compiles. |
Yeah, you can't use |
Looks like the
, where the line in question is
|
I may have found another argument to making compiler ignore device attribute instead of adding separate interface subroutine. program main
real, device, allocatable :: buf(:)
end program main compiled with
cuda12.4
|
@ShatrovOA How that makes compiler ignore the device attribute? |
Anyway, adding interfaces seems working. However, it is CRAZY! For functions with single choice buffer (e.g. MPI_Send), it doubles the interfaces. And for functions with two choice buffers (e.g. MPI_Reduce), it quadruples the interfaces (host/host, host/device, device/host, device/device). And consider we already doubled the interfaces with This is what happens when language committee are a bunch of people that doesn't really use the language actively but just pursuing utopia. They are proud to claim modern Fortran is more advanced than C++, but not seeing that they are way above the cloud. // end rant |
Using The interaction of CUDA Fortran with MPI_F08 isn't standardized by anybody, and the issues here are a bug/feature of the NVHPC Fortran compiler. There's a good reason for the compiler to check the interfaces and enforce |
Yeah, but |
Read https://www.open-mpi.org/papers/euro-pvmmpi-2005-fortran/euro-pvm-mpi-2005-fortran.pdf to see why the MPI_F08 interface design is necessary and good. The previous MPI design was not standard Fortran and relied on |
The other solution is to give up datatypes and make Fortran base types part of the function name the way OpenSHMEM did. |
Yeah, I would vote for this. Fortran binding should adapt to Fortran rather than standardize the interface with C MPI. |
I'll try this solution. |
Ok, |
mpich 4.2.3 compiled with NVIDIA HPC SDK compilers (nvc, nvc++, nvfortran) with cuda support
Unable to use mpi_f08 module with device pointers.
Sample
mpifort mpich.F90 -cuda
NVFORTRAN-S-0155-Could not resolve generic procedure mpi_isend (mpich.F90: 14)
0 inform, 0 warnings, 1 severes, 0 fatal for main
mpifort mpich.F90 -cuda -DUSE_MPI
SUCCESS
The text was updated successfully, but these errors were encountered: