[MITgcm-devel] netcdf test with mpi in genmake2

Jean-Michel Campin jmc at ocean.mit.edu
Sat Nov 17 15:08:25 EST 2012


Hi Martin,

I commented out this mpif.h include in the NetCDF test program "genmake_tnc.F".
Will see how things go with this modif.

Cheers,
Jean-Michel

On Fri, Nov 16, 2012 at 06:26:41PM +0100, Martin Losch wrote:
> Hi Jean-Michel,
> 
> I think the mpif.h need/should not be included in the netcdf test, because it can break the netcdf test for the wrong reason (netcdf may work fine, but mpif.h is not found if INCLUDES does not contain the path to it.).
> 
> As far as I can see, genmake2 does not check whether mpif.h is in the include paths at all. We can leave it like this and then make depend will fail, if mpif.h is not in the INCLUDES or in general include-paths.
> 
> Martin
> 
> On Nov 16, 2012, at 6:04 PM, Jean-Michel Campin wrote:
> 
> > 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
> > 
> > _______________________________________________
> > MITgcm-devel mailing list
> > MITgcm-devel at mitgcm.org
> > http://mitgcm.org/mailman/listinfo/mitgcm-devel
> 
> 
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel



More information about the MITgcm-devel mailing list