sdsc / p3dfft

P3DFFT stands for Parallel Three-Dimensional Fast Fourier Transforms. It is a library for large-scale computer simulations on parallel platforms. It implements 3D FFT and related algorithms such as Chebyshev transform (an important class of algorithm for simulations in a wide range of fields). P3DFFT uses 2D, or pencil, decomposition. For more information:
http://www.p3dfft.net
Other
54 stars 16 forks source link

Type mismatch with gcc10 #15

Open ufdup89 opened 3 years ago

ufdup89 commented 3 years ago

I have tried to compile the 2.7.9 release using gcc10 and got a few errors related to type mismatch. The errors look like the following one and are mostly related to MPI calls:

call mpi_alltoallv (buf1,SndCnts, SndStrt, mpi_byte, buf2,RcvCnts,RcvStrt,mpi_byte,mpi_comm_row,ierr)
|                           1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/REAL(8)).

Some googling indicates that this is due to a feature introduced in gcc10, which made it more strict regarding type compatibility (some other softwares experienced the same some time ago, see e.g. this link. I found two solutions. The quick and dirty way is to simply add the compilation flag -fallow-argument-mismatch, which will turn the error messages into warnings. The second, among other minor fixes, involves replacing include 'mpif.h' in module.f90 by use mpi.

Is there still interest in maintaining this version of p3dfft? If yes, I would be glad to discuss the problem and ways of fixing it.

dmitrypek commented 3 years ago

Thanks. This is now fixed. If there are other issues let us know. The intention is to continue supporting the package as long as possible.

ufdup89 commented 2 years ago

I have now looked at the most recent commit and it still won't compile on gcc10. It complains at

ftran.F90:526:33:

  526 |          call init_f_r2c(XgYZ,nx,buf2,nxhp,nx,jisize*kjsize)
      |                                 1
......
  810 |     call init_f_r2c (rXgYZ, nx, cXgYZ, nxhp, nx, jisize*kjsize)
      |                                2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/REAL(8)).

For a successful build, I had to copy the routine init_f_r2c from fft_init.F90 into ftran.F90. I think that otherwise the compiler can't check that the types are correct (sorry for not mentioning that in my previous post). Compilation of driver_sine_many.F90 also fails, but we can look into that afterwards (it's also related to type mismatch).

In any case, the code compiles with -fallow-argument-mismatch as mentioned before.

dmitrypek commented 2 years ago

Thanks for your report. It looks like using -fallow-argument-mismatch flag helps to compile the code. I will think about what else we can do, but as a minimum we can use this flag.