Re: [netcdfgroup] NetCDF 4.0.1 with --enable-netcdf-4 conflicts with Open MPI by redefining MPI_Comm, etc

  • To: Rob Latham <robl@xxxxxxxxxxx>
  • Subject: Re: [netcdfgroup] NetCDF 4.0.1 with --enable-netcdf-4 conflicts with Open MPI by redefining MPI_Comm, etc
  • From: Ed Hartnett <ed@xxxxxxxxxxxxxxxx>
  • Date: Wed, 07 Oct 2009 01:47:26 -0600
Rob Latham <robl@xxxxxxxxxxx> writes:

> On Tue, Oct 06, 2009 at 10:25:01AM -0600, Dennis Heimbigner wrote:
>> If you write a program that includes
>> mpi.h then indeed you will get conflicts;
>> so the question is: why are you including
>> mpi.h in your netcf programs? Does it work
>> ok if you remove the '#include <mpi.h>' ?
>
> Here's what we do in pnetcdf.  Any place that pnetcdf needs MPI data
> structures, we include <mpi.h>  we do not, however, include mpi.h in
> the pnetcdf.h header file.    
>
> Because the pnetcdf API uses things like communicators and MPI info
> values, we force the caller to include mpi.h before including
> pnetcdf.h
>
> Our job is easier because we are always parallel, whereas netcdf-4
> might not have parallel I/O support if the underlying HDF5 library
> does not have it. 
>

As I understand it, the reason this problem comes up is because some
users have parallel programs which use sequential netCDF. So the user
program contains the include for mpi.h, but sequential netCDF has
redefined MPI_Comm and MPI_Info.

I think the smart thing to do might be to have a separate header
netcdf_par.h, which is included by people who want to use parallel
I/O. This way, the sequential header (netcdf.h) does not need to contain
anything related to mpi.

Right now, I also build nc_create_par/nc_open_par functions whether the
build is for parallel or not. I think I will have to change that too.

I will try and get this change in before the 4.1 release, but I am on
travel right now...

Thanks,

Ed

-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx



  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: