Skip to content

Commit 1020ff1

Browse files
committed
doc: change indep methods to refer to collective methods
1 parent b583a9c commit 1020ff1

File tree

1 file changed

+61
-60
lines changed

1 file changed

+61
-60
lines changed

src/pnetcdf/_Variable.pyx

+61-60
Original file line numberDiff line numberDiff line change
@@ -992,8 +992,8 @@ cdef class Variable:
992992
993993
This method call is the same as method :meth:`Variable.put_varn_all`,
994994
except it is an independent call and can only be called in the
995-
independent I/O mode. Please refer to :meth:`Variable.put_varn` for its
996-
argument usage.
995+
independent I/O mode. Please refer to :meth:`Variable.put_varn_all` for
996+
its argument usage.
997997
"""
998998
self._put_varn(data, num, starts, counts, bufcount = bufcount,
999999
buftype = buftype, collective = False)
@@ -1005,22 +1005,22 @@ cdef class Variable:
10051005
This method call is the nonblocking counterpart of
10061006
:meth:`Variable.put_varn`. The syntax is the same as
10071007
:meth:`Variable.put_varn`. For the argument usage, please refer to
1008-
method :meth:`Variable.put_varn`. This method returns a request ID
1009-
that can be used in :meth:`File.wait` or :meth:`File.wait_all`. The
1010-
posted write request may not be committed until :meth:`File.wait` or
1011-
:meth:`File.wait_all` is called.
1008+
method :meth:`Variable.put_varn_all`. This method returns a request ID
1009+
that can be used in :meth:`File.wait_all` or :meth:`File.wait`. The
1010+
posted write request may not be committed until :meth:`File.wait_all` or
1011+
:meth:`File.wait` is called.
10121012
10131013
.. note::
10141014
Unlike :meth:`Variable.put_varn`, the posted nonblocking write
10151015
requests may not be committed to the file until the time of calling
1016-
:meth:`File.wait` or :meth:`File.wait_all`. Users should not
1016+
:meth:`File.wait_all` or :meth:`File.wait`. Users should not
10171017
alter the contents of the write buffer once the request is posted
1018-
until the :meth:`File.wait` or :meth:`File.wait_all` is
1018+
until the :meth:`File.wait_all` or :meth:`File.wait` is
10191019
returned. Any change to the buffer contents in between will result
10201020
in unexpected error.
10211021
10221022
:return: The request ID, which can be used in a successive call to
1023-
:meth:`File.wait` or :meth:`File.wait_all` for the completion
1023+
:meth:`File.wait_all` or :meth:`File.wait` for the completion
10241024
of the nonblocking operation.
10251025
:rtype: int
10261026
"""
@@ -1033,22 +1033,22 @@ cdef class Variable:
10331033
10341034
This method call is the nonblocking, buffered counterpart of
10351035
:meth:`Variable.put_varn`. For the argument usage, please refer to
1036-
method :meth:`Variable.put_varn`. This method returns a request ID
1037-
that can be used in :meth:`File.wait` or :meth:`File.wait_all`. The
1038-
posted write request may not be committed until :meth:`File.wait` or
1039-
:meth:`File.wait_all` is called.
1036+
method :meth:`Variable.put_varn_all`. This method returns a request ID
1037+
that can be used in :meth:`File.wait_all` or :meth:`File.wait`. The
1038+
posted write request may not be committed until :meth:`File.wait_all`
1039+
or :meth:`File.wait` is called.
10401040
10411041
.. note::
10421042
Unlike :meth:`Variable.iput_varn`, the write data is buffered
10431043
(cached) internally by PnetCDF and will be flushed to the file at
1044-
the time of calling :meth:`File.wait` or :meth:`File.wait_all`.
1044+
the time of calling :meth:`File.wait_all` or :meth:`File.wait`.
10451045
Once the call to this method returns, the caller is free to change
10461046
the contents of write buffer. Prior to calling this method, make
10471047
sure :meth:`File.attach_buff` is called to allocate an internal
10481048
buffer for accommodating the write requests.
10491049
10501050
:return: The request ID, which can be used in a successive call to
1051-
:meth:`File.wait` or :meth:`File.wait_all` for the completion
1051+
:meth:`File.wait_all` or :meth:`File.wait` for the completion
10521052
of the nonblocking operation.
10531053
:rtype: int
10541054
"""
@@ -1331,7 +1331,7 @@ cdef class Variable:
13311331
13321332
Method to write in parallel to the netCDF variable in the independent
13331333
I/O mode. For the argument usage, please refer to method
1334-
:meth:`Variable.put_var`. The only difference is this method is a
1334+
:meth:`Variable.put_var_all`. The only difference is this method is a
13351335
independent operation.
13361336
13371337
:Operational mode: This method must be called while the file is in
@@ -1852,7 +1852,7 @@ cdef class Variable:
18521852
18531853
Method to read in parallel from the netCDF variable in the independent
18541854
I/O mode. For the argument usage, please refer to method
1855-
:meth:`Variable.get_var`. The only difference is this method is a
1855+
:meth:`Variable.get_var_all`. The only difference is this method is a
18561856
independent operation.
18571857
18581858
:Operational mode: This method must be called while the file is in
@@ -1871,13 +1871,13 @@ cdef class Variable:
18711871
else:
18721872
raise ValueError("Invalid input arguments for get_var")
18731873

1874-
def get_varn(self, data, num, starts, counts=None, bufcount=None, buftype=None):
1874+
def get_varn_all(self, data, num, starts, counts=None, bufcount=None, buftype=None):
18751875
"""
1876-
get_varn(self, data, num, starts, counts=None, bufcount=None, buftype=None)
1876+
get_varn_all(self, data, num, starts, counts=None, bufcount=None, buftype=None)
18771877
18781878
Method to read multiple subarrays of a netCDF variables from the file.
1879-
This an independent I/O call and can only be called when the file is in
1880-
the independent I/O mode. This method is equivalent to making multiple
1879+
This a collective I/O call and can only be called when the file is in
1880+
the collective I/O mode. This method is equivalent to making multiple
18811881
calls to :meth:`Variable.get_var`. Note, combining multiple `get_var`
18821882
calls into one can achieve a better performance.
18831883
@@ -1974,19 +1974,19 @@ cdef class Variable:
19741974
19751975
"""
19761976
return self._get_varn(data, num, starts, counts, bufcount = bufcount,
1977-
buftype = buftype, collective = False)
1977+
buftype = buftype, collective = True)
19781978

1979-
def get_varn_all(self, data, num, starts, counts=None, bufcount=None, buftype=None):
1979+
def get_varn(self, data, num, starts, counts=None, bufcount=None, buftype=None):
19801980
"""
1981-
get_varn_all(self, data, num, starts, counts=None, bufcount=None, buftype=None)
1981+
get_varn(self, data, num, starts, counts=None, bufcount=None, buftype=None)
19821982
1983-
This method call is the same as method :meth:`Variable.get_varn`,
1984-
except it is collective and can only be called while the file in the
1985-
collective I/O mode. Please refer to :meth:`Variable.get_varn` for
1986-
its argument usage.
1983+
This method call is the same as method :meth:`Variable.get_varn_all`,
1984+
except it is an independent call and can only be called while the file
1985+
in the independent I/O mode. Please refer to
1986+
:meth:`Variable.get_varn_all` for its argument usage.
19871987
"""
19881988
return self._get_varn(data, num, starts, counts, bufcount = bufcount,
1989-
buftype = buftype, collective = True)
1989+
buftype = buftype, collective = False)
19901990

19911991
def _get(self,start,count,stride):
19921992
"""Private method to retrieve data from a netCDF variable"""
@@ -2344,24 +2344,25 @@ cdef class Variable:
23442344
23452345
Method to post a nonblocking, buffered write request to write to the
23462346
netCDF variable. The syntax is the same as :meth:`Variable.put_var`.
2347-
For the argument usage, please refer to :meth:`Variable.put_var`. This
2348-
method returns a request ID that can be used in :meth:`File.wait` or
2349-
:meth:`File.wait_all`. The posted write request may not be committed
2350-
until :meth:`File.wait` or :meth:`File.wait_all` is called.
2347+
For the argument usage, please refer to :meth:`Variable.put_var_all`.
2348+
This method returns a request ID that can be used in
2349+
:meth:`File.wait_all` or :meth:`File.wait`. The posted write request
2350+
may not be committed until :meth:`File.wait_all` or :meth:`File.wait`
2351+
is called.
23512352
23522353
.. note:: Note that this method requires a numpy array (`data`) as a
23532354
write buffer from caller prepared for writing returned array values
2354-
when :meth:`File.wait` or :meth:`File.wait_all` is called.
2355+
when :meth:`File.wait_all` or :meth:`File.wait` is called.
23552356
Unlike :meth:`Variable.iput_var`, the write data is buffered
23562357
(cached) internally by PnetCDF and will be flushed to the file at
2357-
the time of calling :meth:`File.wait` or :meth:`File.wait_all`.
2358+
the time of calling :meth:`File.wait_all` or :meth:`File.wait`.
23582359
Once the call to this method returns, the caller is free to change
23592360
the contents of write buffer. Prior to calling this method, make
23602361
sure :meth:`File.attach_buff` is called to allocate an internal
23612362
buffer for accommodating the write requests.
23622363
23632364
:return: The request ID, which can be used in a successive call to
2364-
:meth:`File.wait` or :meth:`File.wait_all` for the completion
2365+
:meth:`File.wait_all` or :meth:`File.wait` for the completion
23652366
of the nonblocking operation.
23662367
:rtype: int
23672368
@@ -2388,22 +2389,22 @@ cdef class Variable:
23882389
23892390
Method to post a nonblocking request to write to the netCDF variable.
23902391
The syntax is the same as :meth:`Variable.put_var`. For the argument
2391-
usage, please refer to :meth:`Variable.put_var`. This method returns a
2392-
request ID that can This method returns a request ID that can be used
2393-
in :meth:`File.wait` or :meth:`File.wait_all`. The posted write request
2394-
may not be committed until :meth:`File.wait` or :meth:`File.wait_all`
2395-
is called.
2392+
usage, please refer to :meth:`Variable.put_var_all`. This method
2393+
returns a request ID that can This method returns a request ID that can
2394+
be used in :meth:`File.wait_all` or :meth:`File.wait`. The posted write
2395+
request may not be committed until :meth:`File.wait_all` or
2396+
:meth:`File.wait` is called.
23962397
23972398
.. note:: Note that this method requires a numpy array (`data`) as a
23982399
write buffer from caller prepared for writing returned array values
2399-
when :meth:`File.wait` or :meth:`File.wait_all` is called.
2400-
Users should not alter the contents of the write buffer once the
2401-
request is posted until the :meth:`File.wait` or
2402-
:meth:`File.wait_all` is returned. Any change to the buffer
2403-
contents in between will result in unexpected error.
2400+
when :meth:`File.wait_all` or :meth:`File.wait` is called. Users
2401+
should not alter the contents of the write buffer once the request
2402+
is posted until the :meth:`File.wait_all` or :meth:`File.wait` is
2403+
returned. Any change to the buffer contents in between will result
2404+
in unexpected error.
24042405
24052406
:return: The request ID, which can be used in a successive call to
2406-
:meth:`File.wait` or :meth:`File.wait_all` for the completion
2407+
:meth:`File.wait_all` or :meth:`File.wait` for the completion
24072408
of the nonblocking operation.
24082409
:rtype: int
24092410
@@ -2538,22 +2539,22 @@ cdef class Variable:
25382539
This method call is the nonblocking counterpart of
25392540
:meth:`Variable.get_varn`. The syntax is the same as
25402541
:meth:`Variable.get_varn`. For the argument usage, please refer to
2541-
method :meth:`Variable.get_varn`. This method returns a request ID
2542-
that can be used in :meth:`File.wait` or :meth:`File.wait_all`. The
2543-
posted write request may not be committed until :meth:`File.wait` or
2544-
:meth:`File.wait_all` is called.
2542+
method :meth:`Variable.get_varn_all`. This method returns a request ID
2543+
that can be used in :meth:`File.wait_all` or :meth:`File.wait`. The
2544+
posted write request may not be committed until :meth:`File.wait_all`
2545+
or :meth:`File.wait` is called.
25452546
25462547
.. note::
25472548
Unlike :meth:`Variable.get_varn`, the posted nonblocking read
25482549
requests may not be committed until the time of calling
2549-
:meth:`File.wait` or :meth:`File.wait_all`. Users should not
2550+
:meth:`File.wait_all` or :meth:`File.wait`. Users should not
25502551
alter the contents of the read buffer once the request is posted
2551-
until the :meth:`File.wait` or :meth:`File.wait_all` is
2552+
until the :meth:`File.wait_all` or :meth:`File.wait` is
25522553
returned. Any change to the buffer contents in between will result
25532554
in unexpected error.
25542555
25552556
:return: The request ID, which can be used in a successive call to
2556-
:meth:`File.wait` or :meth:`File.wait_all` for the completion
2557+
:meth:`File.wait_all` or :meth:`File.wait` for the completion
25572558
of the nonblocking operation.
25582559
:rtype: int
25592560
"""
@@ -2646,20 +2647,20 @@ cdef class Variable:
26462647
26472648
Method to post a nonblocking request to read from the netCDF variable.
26482649
The syntax is the same as :meth:`Variable.get_var`. For the argument
2649-
usage, please refer to :meth:`Variable.get_var`. This method returns a
2650-
request ID that can be used in :meth:`File.wait` or
2651-
:meth:`File.wait_all`. The posted read request may not be committed
2652-
until :meth:`File.wait` or :meth:`File.wait_all` is called.
2650+
usage, please refer to :meth:`Variable.get_var_all`. This method
2651+
returns a request ID that can be used in :meth:`File.wait_all` or
2652+
:meth:`File.wait`. The posted read request may not be committed until
2653+
:meth:`File.wait_all` or :meth:`File.wait` is called.
26532654
26542655
.. note:: Note that this method requires a empty array (`data`) as a
26552656
read buffer from caller prepared for storing returned array values
2656-
when :meth:`File.wait` or :meth:`File.wait_all` is called. User
2657+
when :meth:`File.wait_all` or :meth:`File.wait` is called. User
26572658
is expected to retain this buffer array handler (the numpy
26582659
variable) until the read buffer is committed and the transaction is
26592660
completed.
26602661
26612662
:return: The request ID, which can be used in a successive call to
2662-
:meth:`File.wait` or :meth:`File.wait_all` for the completion
2663+
:meth:`File.wait_all` or :meth:`File.wait` for the completion
26632664
of the nonblocking operation.
26642665
:rtype: int
26652666

0 commit comments

Comments
 (0)