cp2k / dbcsr

DBCSR: Distributed Block Compressed Sparse Row matrix library
https://cp2k.github.io/dbcsr/
GNU General Public License v2.0
135 stars 47 forks source link

Add support for the new mpi_f08 module #678

Closed fstein93 closed 1 year ago

fstein93 commented 1 year ago

The MPI 3.0 standard introduces the mpi_f08 module. This solves most issues arising with the old Fortran module (strong typing, non-blocking communication, allocation of memory, etc.). This PR enables this feature within DBCSR.

Because of experiences with its implementation in CP2K, its use must be explicitly requested by the user by adding the flag -DUSE_MPI_F08=<ON|OFF> while calling CMake. It is known that this feature requires more recent compilers (GCC version>10 or Intel compiler) and suitable MPI implementations (OpenMPI and IntelMPI seem to work well, MPICH has issues with Gfortran 11/12). Some of the admins should add or adjust a suitable test for this feature, as this is apparently not possible for me.

jenkins-cscs commented 1 year ago

Can one of the admins verify this patch?

hfp commented 1 year ago

@dev-zero @alazzaro Not sure if I can add an additional test for -DUSE_MPI_F08=ON. As noted above, the test may apply to OpenMPI and/or IntelMPI (not plain/stock MPICH). I guess, GCC/GFortran wise test requirements are fulfilled.

dev-zero commented 1 year ago

wrt tests: I have no issue to hard enable it and stop testing the old wrapper. What is the issue with MPICH and gfortran 11/12?

fstein93 commented 1 year ago

wrt tests: I have no issue to hard enable it and stop testing the old wrapper. What is the issue with MPICH and gfortran 11/12?

It is related to this bug report. I first attempted to test it with MPICH/GFortran, too, when I implemented it into CP2K cp2k/cp2k#2486. The code compiles but then failes as soon as any kind of communication is initiated. I have never tested it again with later versions of GFortran.