[MITgcm-devel] netcdf test with mpi in genmake2

Jean-Michel Campin jmc at ocean.mit.edu
Fri Nov 16 12:04:46 EST 2012


Hi Martin,

I am not sure about this. 

Without looking into the details, mpif.h is included in EESUPPORT.h 
as soon as ALLOW_USE_MPI is defined. So, at some point, it's needed.

Can you identify, in the case you mentionned, how the netcdf test fails
while the include of mpif.h in EESUPPORT.h works fine ?

The one thing I am reluctant to put is a (bad) test for mpif.h (similar
to the one used to test netcdf) that could fail (and then stop genmake2)
whereas the include of mpif.h in EESUPPORT.h is still OK.

But otherwise, it's true that in the simple "genmake_tnc.F" test code,
we don't really need any mpif.h; so, it seems to me that it could be 
removed there (or am I missing something ?).

Cheers,
Jean-Michel

On Fri, Nov 16, 2012 at 04:17:34PM +0100, Martin Losch wrote:
> Hi there,
> 
> it's probably a stupid question, but the netcdf test in genmake2 is a little confusing to me (and others).
> 
> when genmake2 is called with -mpi, then the genmake_tnc.F is changed to include the mpif.h header file. Often, one forgets to actually include or adjust the paths to the mpi include directory, so that this netcdf test fails, because the mpif.h header file is not found, even when everything is OK with the netcdf paths. The error message is then that netcdf cannot be included, but the real reason is that MPI-paths are not properly set. This has left me confused many times. 
> 
> Do we need this #include "mpif.h" in the netcdf test?
> Wouldn't it make more sense to check if mpi-headers are available with a different test and leave the netcdf test alone?
> 
> Martin
> 
> 
> 
> 
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel



More information about the MITgcm-devel mailing list