[Q-e-developers] 'mpif.h' vs. 'include mpi' and regression tests

Filippo SPIGA filippo.spiga at quantum-espresso.org
Tue Nov 22 20:47:15 CET 2016


On Nov 22, 2016, at 2:05 PM, Paolo Giannozzi <paolo.giannozzi at uniud.it> wrote:
> Maybe we should revert to the good habit of confining MPI definitions to a very small number of files. Once upon a time there was just one in "parallel_include.f90", maybe a couple more here and there. Now:
> $ grep mpif.h espresso/*/*.f90 espresso/*/*/*f90 | wc -l
> 62

This would be a good habit but it has some issues:
- if mpi.mod is not comoiled with the same compiler version, it may fail at linker stage (e.g. you upgrade GCC from 4.8 to 4.9 but you do not recompile Open MPI: in case of "mpi.h" is most likely continue to work, in case of "use mpi" will most likely not)
- some old MPI library may miss "mpi.mod" because it has not been compiled or simply too old

So if we want to make the switch we need to ensure backward compatibility to old/legacy environments. Ideally the configure needs be able to detect if "mpi.mod" is present and use it, keeping "mpi.h" as fallback.

--
Filippo SPIGA ~ Quantum ESPRESSO Foundation ~ http://www.quantum-espresso.org





More information about the developers mailing list