ecmwf / fckit

A Fortran toolkit for interoperating Fortran with C/C++
https://confluence.ecmwf.int/display/fckit
Apache License 2.0
29 stars 15 forks source link

problems with fckit_mpi.fypp #7

Closed mmiesch closed 4 years ago

mmiesch commented 5 years ago

With the introduction of the Fypp preprocessor, some functionality that was working before is no longer working. The problem has to with the MPI send command in fckit_mpi.fypp. We're getting compilation errors (with gfortran 7.3) when we try to send single integers or 1D integer arrays. They are of the type:

Error: Found no matching specific binding for the call to the GENERIC ‘send’ at (1)

Such send operations were working with the develop version from approximately Jan 17, 2019.

wdeconinck commented 5 years ago

Hi @mmiesch , I have added unit-tests for the case you specify, sending 1D integer arrays and it seems to compile and run fine on various platforms and compilers, including gfortran 7.4 ( can be seen in e.g. https://travis-ci.org/ecmwf/fckit/jobs/489558949 )

mmiesch commented 5 years ago

Thanks @wdeconinck for checking - I will look more carefully into why it is not working in JEDI.

mmiesch commented 5 years ago

@wdeconinck - I'm still having troubles integrating the latest develop branch into JEDI and I have two questions. First, the intel compilers still fail at the same point but give a different error message that is perhaps more revealing. It seems that the MPI send buffers now need to be intent(inout) instead of intent(in). Why is this? Under what circumstances are the send buffers modified? Second, the alltoallv interface is defined as alltoall. Was this intentional? It's breaking our alltoallv call - I can change our call if necessary but I'm thinking it may be a typo in the interface because the actual call is to alltoallv.

mmiesch commented 5 years ago

I verified that everything runs correctly for both gnu and intel compilers if I change all of our send buffers to intent(inout) and change our alltoallv call to alltoall. So - the problem is effectively solved, assuming that this is how you intended it to be.

wdeconinck commented 5 years ago

Sorry @mmiesch for breaking your code. I had used overloading to detect they could use the same name. Indeed, send buffers should not have intent(inout)... This should be fixed.

mmiesch commented 5 years ago

Thanks @wdeconinck - I'll plan to have a look at fixing this intent(in) issue in our JCSDA fork of fckit next week and then do a PR - I have some other priorities to deal with first. Let me know if you have time fix it before then.

wdeconinck commented 4 years ago

@mmiesch Is there any progress on this?

mmiesch commented 4 years ago

Thanks @wdeconinck for checking back. You can close this - it is no longer a problem for us. I believe the send buffers are now declared correctly both in our fork and in the upstream.