@aradi, do you call the MPI functions directly or do you (as most large projects I’m familiar with do) write wrappers around the MPI calls and call them instead. This allows you to isolate the MPI calls into one source file and then conditionally compile using the preprocessor based on setting some compiler macro (ie ifort -DUSE_MPI). I have also seen “dummy” MPI packages that provide subroutines and functions with just the MPI interfaces and usually don’t do anything and are only used to satisfy entry points during linking. Not the fpm solution you are looking for but this is a common way of getting around your problem at the source code level.
Edit.
See John Burkardt’s mpi_stubs code for an example of a dummy MPI package.
Note: it looks like Professor Burkardt has moved to South Carolina and some of his old Florida State links aren’t working. The following should work.
https://people.math.sc.edu/Burkardt/f_src/mpi_stubs/mpi_stubs.html