Learn R Programming

pbdNCDF4 (version 0.1-0)

nc_open_par: Open a parallel NetCDF File

Description

Opens an existing NetCDF file for reading (or, optionally, writing) in parallel.

Usage

nc_open_par(filename, write = FALSE, readunlim = TRUE,
     verbose = FALSE, comm = .SPMD.CT$comm, info = .SPMD.CT$info)

Arguments

filename
Name of the existing NetCDF file to be opened.
write
If FALSE (default), then the file is opened read-only. If TRUE, then writing to the file is allowed.
readunlim
When invoked, this function reads in the values of all dimensions from the associated variables. This can be slow for a large file with a long unlimited dimension. If set to FALSE, the values for th
verbose
If TRUE, then messages are printed out during execution of this function.
comm
a communicator number from pbdMPI.
info
a info number from pbdMPI.

Value

  • An object of class ncdf4 that has the fields described above.

Details

See nc_open details. The parallel version is able to coordinate with other nc_open_par instances for more efficient operation in parallel.

References

Programming with Big Data in R Website: http://r-pbd.org/

See Also

nc_create_par, nc_var_par_access, ncdim_def, ncvar_def.

Examples

Run this code
### Under command mode, run the demo with 2 processors by
### (Use Rscript.exe for windows system)
mpiexec -np 2 Rscript -e "demo(ncwrite,'pbdNCDF4',ask=F,echo=F)"
mpiexec -np 2 Rscript -e "demo(ncread,'pbdNCDF4',ask=F,echo=F)"

Run the code above in your browser using DataLab