[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #VFX-630532]: Writing multiple variables at once using NetCDF4 parallel



Hi Charles,

> I just set out to port our software to use NetCDF4 parallel (Netcdf 4.3.3.1 
> HDF5 1.8.13)
> 
> I’m trying to have multiple core wrote to different variables? Is that 
> possible, or can you only write to ONE variable at a time.
> 
> When running the attached code when ONE core, it works happily, when running 
> with multiple core (mpirun –n 2 or more) only the variables written by the 
> highest rank are actually in the file.
> 
> Is it possible to achieve what I’m trying to do? If so what am I doing wrong?

Yes, I think it is.  One thing you're doing wrong is including netcdf_par.h 
after netcdf.h.
According to a note in some release notes that doesn't seem to have made it into
the actual documentation:

  Users of parallel I/O with netCDF-4 please note: starting with the 4.1.2 
release the parallel I/O functions are prototyped in netcdf_par.h, not 
netcdf.h. You must include netcdf_par.h BEFORE netcdf.h to use parallel I/O 
with netCDF-4.
  http://www.unidata.ucar.edu/netcdf/release-notes-4.1.2.html

That also seems to be in the 2012 netCDF workshop section on using parallel I/O:

  For parallel builds you must include "netcdf_par.h" before (or instead of) 
netcdf.h.
  
http://www.unidata.ucar.edu/netcdf/workshops/2012/pnetcdf/BuildingParallel.html

I don't know if that's the problem, but it's the first problem I spotted, so 
you might want
to try just deleting the "#include <netcdf.h>" statement from your 
test_append.c.

--Russ
> Also I tried to stay in def mode only first (I.e. Two loop, one declaring all 
> variables, then move in redef mode and write variables in 2nd loop) but it 
> didn’t make a difference.
> 
> Thanks for any pointer,
> 
> C.
> 
> 
> 
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: VFX-630532
Department: Support netCDF
Priority: Normal
Status: Closed