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

[netCDF #GUA-922187]: Problems about using parallel io to manage NF90_UNLIMITED dimensions variables in different groups



Hello,

Which versions of netCDF are you using, specifically what version of 
netCDF-Fortran and the underlying netCDF-C libraries?  We recently had a 
parallel I/O bug fix integrated which may correct the behavior you're seeing; 
the version of netCDF-C with this fix was released yesterday, and is version 
4.4.1, available here:  https://github.com/Unidata/netcdf-c/releases

You might try the latest version of the C and Fortran libraries, and let us 
know if the issue persists.  Thanks!

-Ward

> Hi,
> 
> I'm fresh using parallel IO of netCDF, and I've got a problem that really
> confuse me. I was developing a program to manage a netcdf file in a
> parallel way. The main idea is that the file has some groups named after
> the specific probe, for example x1y1 and x2y2 blablabla. And all the groups
> have the same structure, containing its own recording variables like
> 'Temperature' and 'Velocity(U2)' with UNLIMITED dimension.
> Since not all processors contain probes, so I tried to use some specific
> processors to manage the corresponding probes. For example, Processor 0
> governs the area that contains probe x1y1, then the group 'x1y1' is only
> managed by processor 0. On the other hand, some processors are not
> responsible to write.
> However, when I running the program, it pauses at 'call check(
> nf90_put_var(idgrp(i), idt2(i), tprobe) , "io_probe put:T2")', seems like
> it is waiting for MPI communication.
> 
> So here is my questions:
> 1. Does parallel IO of netCDF support the case that some process inquire
> and overwrite variables in the corresponding groups, and the other
> processors just do nothing?
> 2. Is it matter if I use unlimited dimension? Since I have to set
> nf90_var_par_access(idgrp(i), idt2(i), access = NF90_COLLECTIVE) when using
> unlimited dimension in parallel case I supposed.
> 
> BTW, parallel IO works well when I use all processors writing data to a
> single variable.
> Any help or advice would be greatly appreciated!
> 
> Ding
> 
> example of the file structure:
> ncdump -h PROBE.h5
> 
> netcdf PROBE {
> 
> group: x01y01z01 {
> dimensions:
> NTS = UNLIMITED ; // (0 currently)
> variables:
> double time(NTS) ;
> double X ;
> double Y ;
> double Z ;
> double U2(NTS) ;
> double V2(NTS) ;
> double W2(NTS) ;
> double T2(NTS) ;
> } // group x01y01z01
> 
> group: x01y01z02 {
> dimensions:
> NTS = UNLIMITED ; // (0 currently)
> variables:
> double time(NTS) ;
> double X ;
> double Y ;
> double Z ;
> double U2(NTS) ;
> double V2(NTS) ;
> double W2(NTS) ;
> double T2(NTS) ;
> } // group x01y01z02
> 
> 
> example of the code:
> !########### IO PROBE
> ###########################################################
> !---- NF_OPEN
> !---- open existing netCDF dataset - read-write
> call echo_name('   write: ',fprobe)
> call check( nf90_open(fprobe, ior(nf90_Write,nf90_mpiposix), ncid, &
> comm = mpi_comm_world, info = mpi_info_null) , fprobe )
> !---- WRITE TO FILE
> if (n_probe.ne.0) then !------------- to identify which of the processors
> are responsible to write
> do i=1,n_probe   !------------- loop, if this processor is responsible to
> write, inquiring group and variable ID.
> !------------- NOTICE:
> different processors only manager its own part of the groups, and 'grpname'
> is different for different processors.
> call check( nf90_inq_ncid(ncid, grpname(i), idgrp(i)), "io_probe inq:group")
> call check( nf90_inq_varid(idgrp(i), 'time', idtimep(i)),"io_probe
> inq:time")
> call check( nf90_inq_varid(idgrp(i), 'T2',   idt2(i)), "io_probe inq:u2")
> call check( nf90_var_par_access(idgrp(i), idt2(i), access =
> NF90_COLLECTIVE))
> enddo
> !---------- T probe
> do i = 1,n_probe !------------- loop, writing probe data one by one
> print *, 'ready to write'
> call check( nf90_put_var(idgrp(i), idt2(i), tprobe) , "io_probe put:T2")
> enddo
> endif
> !---- NF_CLOSE
> call check( nf90_close(ncid))
> ---------------------------------------
> Guang-Yu Ding
> Department of Physics
> The Chinese University of Hong Kong
> Tel: (+852) 6380 4211
> 
> 


Ticket Details
===================
Ticket ID: GUA-922187
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.