Package Scientific :: Package BSP :: Module IO :: Class _ParNetCDFFile
[hide private]
[frames] | no frames]

Class _ParNetCDFFile



object --+    
         |    
   ParBase --+
             |
            _ParNetCDFFile

Distributed netCDF file

A ParNetCDFFile object acts as much as possible like a NetCDFFile object. Variables become ParNetCDFVariable objects, which behave like distributed sequences. Variables that use the dimension named by |split_dimension| are automatically distributed among the processors such that each treats only one slice of the whole file.

Instance Methods [hide private]
  __parinit__(self, pid, nprocs, filename, split_dimension, mode='r', local_access=False)
  __repr__(self)
repr(x)
  _divideData(self, length)
  close(self)
  createDimension(self, name, length)
  createVariable(self, name, typecode, dimensions)
  flush(self)
  sync(self)

Inherited from ParBase: broadcast, exchangeMessages, get, put

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__


Class Variables [hide private]

Inherited from ParBase: is_parclass


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__parinit__(self, pid, nprocs, filename, split_dimension, mode='r', local_access=False)

 
Parameters:
  • filename (str) - the name of the netCDF file
  • split_dimension (str) - the name of the dimension along which the data is distributed over the processors
  • mode (str) - read ('r'), write ('w'), or append ('a')
  • local_access (bool or str) - if False, processor 0 is the only one to access the file, all others communicate with processor 0. If True (only for reading), each processor accesses the file directly. In the latter case, the file must be accessible on all processors under the same name. A third mode is 'auto', which uses some heuristics to decide if the file is accessible everywhere: it checks for existence of the file, then compares the size on all processors, and finally verifies that the same variables exist everywhere, with identical names, types, and sizes.

__repr__(self)
(Representation operator)

 

repr(x)
Overrides: object.__repr__
(inherited documentation)

_divideData(self, length)

 

close(self)

 

createDimension(self, name, length)

 

createVariable(self, name, typecode, dimensions)

 

flush(self)

 

sync(self)