Topic: Disenable MPI feature

Hi all,

I have been given a code, that includes the option of having it compiled for parellel computing (MPI), which is  unfortunately selected by standard. The compilation of this standard option doesnt work as the compiler is looking for an mpif.h file that it cant find. For me, it would be totally sufficient to run it sequentially and unselect the MPI option.

I am told that this is possible by specifying in the Makefile "MODE=SEQ". But how can I specify a custom makefile? I have unticked the option "Always Renegerate Makefile" under  "Project Options/Make Options" and just added "Mode=SEQ" in the Makefile created by SF in the preceding compilation attempt. But this doesnt do the trick.

Alternatively, is there a way to tell the compiler to use the "MODE=SEQ" option without fiddling with the makefile?

Thanks for any help!

Re: Disenable MPI feature


My guess, without seeing the code, is that you can disable MPI by defining a preprocessor macro, MODE to be SEQ.  After you re-enable "Always regenerate makefile," try the following:

1. In Project Options under "Fortran," check the box "Enable C Preprocessor."

2. In Project Options under "Compiler Flags," add the following to the "Fortran" box:


3. Select Ok, select "Clean" from the Build menu, and try building again.

It may work, but there is also the possibility that you might have to look at the code in more detail.  If you do a text search for:

      INCLUDE 'mpif.h'

across the entire project, you can see everywhere the file is included.  Then you might be able to determine how the code decides to include the MPI interface.  You can also look at the original makefile that quite possibly excludes certain files from the build if that flag is set.  My suggestion is only a guess without seeing any of the code.

Jeff Armstrong
Approximatrix, LLC