This question is very similar to the one asked here except I was wondering what flags people use when they are using the mpif90 compiler and are using MPI in their code.
Asked
Active
Viewed 475 times
1
-
4mpif90 is a wrapper for another compiler, making sure that the paths to such things as the paths to the mpi module and libraries are correct. So for debugging you use the same flags as you would use for the underlying compiler. – Ian Bush Mar 24 '21 at 17:13
-
1Some MPI implementations may provide special options to support debugging, profiling, etc., but if you need to know about those please make the question specific to a particular implementation. Otherwise it's too broad for a meaningful answer. Beyond that, the question you link to covers precisely the options the underlying gofrtran considers. (Again, it'd be too broad to cover all compilers.) – francescalus Mar 24 '21 at 17:23
1 Answers
2
MPI is just a library. The compiler does not do anything special related to MPI.
The mpif90
, mpifort
or a similar command just calls a normal compiler with some additional flags. You have to know which compiler it is. If it is gfortran, use flags for gfortran. If it is Intel, use flags for Intel.
Use mpif90 --show
to find out the underlying compiler. For my laptop in the current settings it shows
gfortran -I/usr/lib/hpc/gnu7/mpi/openmpi/4.0.5/include -pthread -I/usr/lib/hpc/gnu7/mpi/openmpi/4.0.5/lib64 -L/usr/lib/hpc/gnu7/mpi/openmpi/4.0.5/lib64 -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi
so my compiler is gfortran.
I use the exact same debugging flags with and without MPI.
There are dedicated debuggers for MPI, but those are external programs, not just compiler flags.

Vladimir F Героям слава
- 57,977
- 4
- 76
- 119
-
Thank you very much that makes sense. When I type the command you suggested it also shows I am using gfortran. – Peanutlex Mar 24 '21 at 17:39