diff --git a/examples/fill_mode.py b/examples/fill_mode.py index b724663..475822d 100644 --- a/examples/fill_mode.py +++ b/examples/fill_mode.py @@ -81,14 +81,18 @@ def pnetcdf_io(filename): else: print("The old fill mode is NC_NOFILL\n") - # set the fill mode to back to NC_NOFILL for the entire file + # set the fill mode back to NC_NOFILL for the entire file f.set_fill(pnetcdf.NC_NOFILL) - # set the variable's fill mode to NC_FILL with default fill value + # set the variable's fill mode to NC_FILL with PnetCDF default fill value fix_var.def_fill(no_fill = 0) - # set a customized fill value -1 + # enable the variable's fill mode and use a customized value, -1 fill_value = np.int32(-1) + rec_var.def_fill(no_fill = 0, fill_value = fill_value) + + # Equivalently this can be done by setting the PnetCDF pre-defined + # attribute "_FillValue" rec_var._FillValue = fill_value # exit define mode diff --git a/examples/nonblocking/nonblocking_write.py b/examples/nonblocking/nonblocking_write.py index a5020c0..b44506c 100644 --- a/examples/nonblocking/nonblocking_write.py +++ b/examples/nonblocking/nonblocking_write.py @@ -112,7 +112,7 @@ def pnetcdf_io(filename, length): if pnetcdf.strerrno(req_errs[i]) != "NC_NOERR": print(f"Error on request {i}:", pnetcdf.strerror(req_errs[i])) - # detach the temporary buffer + # detach the buffer f.detach_buff() # Close the file diff --git a/examples/put_var.py b/examples/put_var.py index c620f5b..f820b95 100644 --- a/examples/put_var.py +++ b/examples/put_var.py @@ -92,7 +92,7 @@ def pnetcdf_io(filename, file_format): # Define dimensions dim_y = f.def_dim("Y", global_ny) - dim_x = f.def_dim("X",global_nx) + dim_x = f.def_dim("X", global_nx) # Define a 2D variable of integer type var = f.def_var("var", pnetcdf.NC_INT, (dim_y, dim_x)) diff --git a/src/pnetcdf/_Dimension.pyx b/src/pnetcdf/_Dimension.pyx index dd02c0d..b7a2b9f 100644 --- a/src/pnetcdf/_Dimension.pyx +++ b/src/pnetcdf/_Dimension.pyx @@ -37,6 +37,15 @@ cdef class Dimension: .. note:: ``Dimension`` instances should be created using the :meth:`File.def_dim` method of a ``File`` instance, not using :meth:`Dimension.__init__` directly. + + :Example: A example is available in ``examples/put_var.py`` + + :: + # Define dimensions + dim_t = f.def_dim('time', size = -1) + dim_y = f.def_dim("Y", size = 100) + dim_x = f.def_dim("X", size = 200) + """ cdef int ierr cdef char *dimname diff --git a/src/pnetcdf/_File.pyx b/src/pnetcdf/_File.pyx index 95ad381..ec65ec2 100644 --- a/src/pnetcdf/_File.pyx +++ b/src/pnetcdf/_File.pyx @@ -69,6 +69,16 @@ cdef class File: :return: The created file instance. :rtype: :class:`pnetcdf.File` + + :Example: A example is available in ``examples/create_open.py`` + + :: + # create a new file using file clobber mode, i.e. flag "-w" + f = pnetcdf.File(filename = "foo.nc", mode = 'w', comm = MPI.COMM_WORLD, info = None) + + # open an existing file for read only + f = pnetcdf.File(filename = "foo.nc", mode = 'r', comm = MPI.COMM_WORLD, info = None) + """ cdef int ncid encoding = sys.getfilesystemencoding() @@ -129,6 +139,14 @@ cdef class File: close(self) Close the opened netCDF file + + :Example: A example is available in ``examples/create_open.py`` + + :: + # create a new file using file clobber mode, i.e. flag "-w" + f = pnetcdf.File(filename = "foo.nc", mode = 'w', comm = MPI.COMM_WORLD, info = None) + f.close() + """ self._close(True) @@ -303,6 +321,16 @@ cdef class File: :param str dimname: Name of the new dimension. :param int size: [Optional] Size of the new dimension. + :Example: A example is available in ``examples/put_var.py`` + + :: + dim_t = f.def_dim('time', size = -1) + dim_y = f.def_dim("Y", size = 100) + dim_x = f.def_dim("X", size = 200) + + # Define a 2D variable of integer type + var = f.def_var("foo", pnetcdf.NC_INT, (dim_y, dim_x)) + """ self.dimensions[dimname] = Dimension(self, dimname, size=size) return self.dimensions[dimname] @@ -446,6 +474,16 @@ cdef class File: :return: The created variable :rtype: :class:`pnetcdf.Variable` + + :Example: A example is available in ``examples/put_var.py`` + + :: + dim_y = f.def_dim("Y", global_ny) + dim_x = f.def_dim("X", global_nx) + + # Define a 2D variable of integer type + var = f.def_var("foo", pnetcdf.NC_INT, (dim_y, dim_x)) + """ # the following should be added to explanation of variable class. @@ -521,6 +559,16 @@ cdef class File: :Operational mode: This method must be called while the file is in define mode. + + :Example: A example is available in ``examples/put_var.py`` + + :: + str_att = "example attribute of type text." + var.foo_attr = str_att + + # Equivalently, below uses function call + var.put_att("foo_attr", str_att) + """ cdef nc_type xtype xtype=-99 @@ -545,6 +593,16 @@ cdef class File: :Operational mode: This method can be called while the file is in either define or data mode (collective or independent). + + :Example: A example is available in ``examples/get_var.py`` + + :: + # Get global attribute named "foo_attr" + str_att = f.get_att("foo_attr") + + # Get the variable's attribute named "foo_attr" + str_att = v.foo_attr + """ return _get_att(self, NC_GLOBAL, name, encoding=encoding) @@ -681,13 +739,14 @@ cdef class File: _check_err(ierr) return None - def wait(self, num=None, requests=None, status=None): + def wait_all(self, num=None, requests=None, status=None): """ - wait(self, num=None, requests=None, status=None) + wait_all(self, num=None, requests=None, status=None) This method is a blocking call that wait for the completion of - nonblocking I/O requests made by :meth:`Variable.iput_var`, - :meth:`Variable.iget_var` and :meth:`Variable.bput_var` + nonblocking I/O requests made by one of more method calls to + :meth:`Variable.iput_var`, :meth:`Variable.iget_var` and + :meth:`Variable.bput_var` :param int num: [Optional] number of requests. It is also the array size of the next two @@ -709,21 +768,35 @@ cdef class File: the error messages. :type status: list - :Operational mode: it is an independent subroutine and must be called - while the file is in independent data mode. + :Operational mode: it is an collective subroutine and must be called + while the file is in collective data mode. + + :Example: A example is available in ``examples/nonblocking/nonblocking_write.py`` + + :: + # Write one variable at a time, using iput APIs + reqs = [] + for i in range(NUM_VARS): + req_id = vars[i].iput_var(buf[i], start = start, count = count) + reqs.append(req_id) + + # commit posted nonblocking requests + req_errs = [None] * NUM_VARS + f.wait_all(NUM_VARS, reqs, req_errs) + """ - return self._wait(num, requests, status, collective=False) + return self._wait(num, requests, status, collective=True) - def wait_all(self, num=None, requests=None, status=None): + def wait(self, num=None, requests=None, status=None): """ - wait_all(self, num=None, requests=None, status=None) + wait(self, num=None, requests=None, status=None) - Same as :meth:`File.wait` but in collective data mode + Same as :meth:`File.wait_all` but called in independent data mode - :Operational mode: it is an collective subroutine and must be called - while the file is in collective data mode. + :Operational mode: it is an independent subroutine and must be called + while the file is in independent data mode. """ - return self._wait(num, requests, status, collective=True) + return self._wait(num, requests, status, collective=False) def cancel(self, num=None, requests=None, status=None): """ @@ -814,6 +887,13 @@ cdef class File: ``numpy.ndarray.nbytes`` :type bufsize: int + :Example: A example is available in ``examples/nonblocking/nonblocking_write.py`` + + :: + # Before calling bput APIs, calculate allocate space needed + bufsize = length * NUM_VARS * np.dtype(np.int32).itemsize + f.attach_buff(bbufsize) + """ cdef MPI_Offset buffsize cdef int _file_id @@ -829,6 +909,17 @@ cdef class File: Detach the write buffer previously attached for buffered non-blocking write + + :Example: A example is available in ``examples/nonblocking/nonblocking_write.py`` + + :: + # Before calling bput APIs, calculate allocate space needed + bufsize = length * NUM_VARS * np.dtype(np.int32).itemsize + f.attach_buff(bbufsize) + + # detach the buffer + f.detach_buff() + """ cdef int _file_id = self._ncid with nogil: @@ -912,6 +1003,21 @@ cdef class File: :Operational mode: This method is a collective subroutine and must be called in define mode + + :Example: A example is available in ``examples/fill_mode.py`` + + :: + # set the fill mode to NC_FILL for the entire file + old_fillmode = f.set_fill(pnetcdf.NC_FILL) + if verbose: + if old_fillmode == pnetcdf.NC_FILL: + print("The old fill mode is NC_FILL\n") + else: + print("The old fill mode is NC_NOFILL\n") + + # set the fill mode to back to NC_NOFILL for the entire file + f.set_fill(pnetcdf.NC_NOFILL) + """ cdef int _file_id, _fillmode, _old_fillmode _file_id = self._ncid diff --git a/src/pnetcdf/_Variable.pyx b/src/pnetcdf/_Variable.pyx index cf9d3ef..e6fe845 100644 --- a/src/pnetcdf/_Variable.pyx +++ b/src/pnetcdf/_Variable.pyx @@ -86,6 +86,19 @@ cdef class Variable: :return: The created variable :rtype: :class:`pnetcdf.Variable` + :Example: A example is available in ``examples/put_var.py`` + + :: + # Define dimensions + dim_y = f.def_dim("Y", global_ny) + dim_x = f.def_dim("X", global_nx) + + # Define a 2D variable of integer type, using :meth:`File.def_var`. + var = f.def_var("var", pnetcdf.NC_INT, (dim_y, dim_x)) + + # Or equivalently, using :meth:`File.createVariable`. + var = f.createVariable("var", pnetcdf.NC_INT, (dim_y, dim_x)) + """ cdef int ierr, ndims, icontiguous, icomplevel, numdims, _file_id, nsd, @@ -312,6 +325,16 @@ cdef class Variable: :Operational mode: This method must be called while the associated netCDF file is in define mode. + + :Example: A example is available in ``examples/put_var.py`` + + :: + str_att = "example attribute of type text." + var.put_att("foo_attr", str_att) + + # Equivalently, uses python dictionary way + var.foo_attr = str_att + """ cdef nc_type xtype xtype=-99 @@ -335,6 +358,16 @@ cdef class Variable: :Operational mode: This method can be called while the file is in either define or data mode (collective or independent). + + :Example: A example is available in ``examples/get_var.py`` + + :: + # Get attribute named "foo_attr" + str_att = v.get_att("foo_attr") + + # Equivalently, uses python dictionary way + str_att = v.foo_attr + """ return _get_att(self._file, self._varid, name, encoding=encoding) @@ -447,6 +480,19 @@ cdef class Variable: ignored and the default fill value is used. :type fill_value: any + :Example: A example is available in ``examples/fill_mode.py`` + + :: + # set the variable's fill mode to NC_FILL with PnetCDF default fill value + var.def_fill(no_fill = 0) + + # enable the variable's fill mode and use a customized value + fill_value = np.int32(-1) + var.def_fill(no_fill = 0, fill_value = fill_value) + + # Equivalently this can be done by setting the PnetCDF pre-defined attribute "_FillValue" + var._FillValue = fill_value + """ cdef ndarray data cdef int ierr, _no_fill @@ -831,13 +877,13 @@ cdef class Variable: bufftype) _check_err(ierr) - def put_varn(self, data, num, starts, counts=None, bufcount=None, buftype=None): + def put_varn_all(self, data, num, starts, counts=None, bufcount=None, buftype=None): """ - put_varn(self, data, num, starts, counts=None, bufcount=None, buftype=None) + put_varn_all(self, data, num, starts, counts=None, bufcount=None, buftype=None) Method write multiple subarrays of a netCDF variable to the file. This - an independent I/O call and can only be called when the file is in the - independent I/O mode. This method is equivalent to making multiple + an collective I/O call and can only be called when the file is in the + collective I/O mode. This method is equivalent to making multiple calls to :meth:`Variable.put_var`. Note, combining multiple `put_var` calls into one can achieve a better performance. @@ -917,21 +963,35 @@ cdef class Variable: An MPI derived data type that describes the memory layout of the write buffer. :type buftype: mpi4py.MPI.Datatype + + :Example: A example is available in ``examples/put_varn_int.py`` + + :: + num_reqs = 4 + starts = np.zeros((num_reqs, NDIMS), dtype=np.int64) + counts = np.zeros((num_reqs, NDIMS), dtype=np.int64) + starts[0][0] = 0; starts[0][1] = 5; counts[0][0] = 1; counts[0][1] = 2 + starts[1][0] = 1; starts[1][1] = 0; counts[1][0] = 1; counts[1][1] = 1 + starts[2][0] = 2; starts[2][1] = 6; counts[2][0] = 1; counts[2][1] = 2 + starts[3][0] = 3; starts[3][1] = 0; counts[3][0] = 1; counts[3][1] = 3 + + v.put_varn_all(w_buf, num = num_reqs, starts = starts, counts = counts) + """ self._put_varn(data, num, starts, counts, bufcount = bufcount, - buftype = buftype, collective = False) + buftype = buftype, collective = True) - def put_varn_all(self, data, num, starts, counts=None, bufcount=None, buftype=None): + def put_varn(self, data, num, starts, counts=None, bufcount=None, buftype=None): """ - put_varn_all(self, data, num, starts, counts=None, bufcount=None, buftype=None) + put_varn(self, data, num, starts, counts=None, bufcount=None, buftype=None) - This method call is the same as method :meth:`Variable.put_varn`, - except it is collective and can only be called in the collective I/O - mode. Please refer to :meth:`Variable.put_varn` for its argument - usage. + This method call is the same as method :meth:`Variable.put_varn_all`, + except it is an independent call and can only be called in the + independent I/O mode. Please refer to :meth:`Variable.put_varn` for its + argument usage. """ self._put_varn(data, num, starts, counts, bufcount = bufcount, - buftype = buftype, collective = True) + buftype = buftype, collective = False) def iput_varn(self, data, num, starts, counts=None, bufcount=None, buftype=None): """ @@ -1085,12 +1145,12 @@ cdef class Variable: - def put_var(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None): + def put_var_all(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None): """ - put_var(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None) + put_var_all(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None) - Method to write in parallel to the netCDF variable in independent I/O - mode. The behavior of the method varies depends on the pattern of + Method to write in parallel to the netCDF variable in the collective + I/O mode. The behavior of the method varies depends on the pattern of provided optional arguments - `start`, `count`, `stride`, `bufcount` and `buftype`. @@ -1233,32 +1293,17 @@ cdef class Variable: :type buftype: mpi4py.MPI.Datatype :Operational mode: This method must be called while the file is in - independent data mode.""" + collective data mode. - if data is not None and all(arg is None for arg in [start, count, stride, imap]): - self._put_var(data, collective = False, bufcount = bufcount, buftype = buftype) - elif all(arg is not None for arg in [data, start]) and all(arg is None for arg in [count, stride, imap]): - self._put_var1(data, start, collective = False, bufcount = bufcount, buftype = buftype) - elif all(arg is not None for arg in [data, start, count]) and all(arg is None for arg in [stride, imap]): - self._put_vara(start, count, data, collective = False, bufcount = bufcount, buftype = buftype) - elif all(arg is not None for arg in [data, start, count, stride]) and all(arg is None for arg in [imap]): - self._put_vars(start, count, stride, data, collective = False, bufcount = bufcount, buftype = buftype) - elif all(arg is not None for arg in [data, start, count, stride, imap]): - self._put_varm(data, start, count, stride, imap, collective = False, bufcount = bufcount, buftype = buftype) - else: - raise ValueError("Invalid input arguments for put_var") + :Example: A example is available in ``examples/put_var.py`` - def put_var_all(self, data, start=None, count=None, stride=None, num=None, imap=None, bufcount=None, buftype=None): - """ - put_var_all(self, data, start=None, count=None, stride=None, num=None, imap=None, bufcount=None, buftype=None) + :: + var.put_var_all(buf, start = start, count = count) - Method to write in parallel to the netCDF variable in the collective - I/O mode. For the argument usage, please refer to method - :meth:`Variable.put_var`. The only difference is this method is a - collective operation. + # Equivalently, below uses python index style + end = [start[i] + count[i] for i in range(2)] + var[start[0]:end[0], start[1]:end[1]] = buf - :Operational mode: This method must be called while the file is in - collective data mode. """ if data is not None and all(arg is None for arg in [start, count, stride, num, imap]): self._put_var(data, collective = True, bufcount = bufcount, buftype = buftype) @@ -1275,6 +1320,32 @@ cdef class Variable: else: raise ValueError("Invalid input arguments for put_var_all") + + def put_var(self, data, start=None, count=None, stride=None, num=None, imap=None, bufcount=None, buftype=None): + """ + put_var(self, data, start=None, count=None, stride=None, num=None, imap=None, bufcount=None, buftype=None) + + Method to write in parallel to the netCDF variable in the independent + I/O mode. For the argument usage, please refer to method + :meth:`Variable.put_var`. The only difference is this method is a + independent operation. + + :Operational mode: This method must be called while the file is in + independent data mode. + """ + if data is not None and all(arg is None for arg in [start, count, stride, imap]): + self._put_var(data, collective = False, bufcount = bufcount, buftype = buftype) + elif all(arg is not None for arg in [data, start]) and all(arg is None for arg in [count, stride, imap]): + self._put_var1(data, start, collective = False, bufcount = bufcount, buftype = buftype) + elif all(arg is not None for arg in [data, start, count]) and all(arg is None for arg in [stride, imap]): + self._put_vara(start, count, data, collective = False, bufcount = bufcount, buftype = buftype) + elif all(arg is not None for arg in [data, start, count, stride]) and all(arg is None for arg in [imap]): + self._put_vars(start, count, stride, data, collective = False, bufcount = bufcount, buftype = buftype) + elif all(arg is not None for arg in [data, start, count, stride, imap]): + self._put_varm(data, start, count, stride, imap, collective = False, bufcount = bufcount, buftype = buftype) + else: + raise ValueError("Invalid input arguments for put_var") + def _put(self, ndarray data, start, count, stride): """Private method to put data into a netCDF variable""" cdef int ierr, ndims @@ -1591,11 +1662,11 @@ cdef class Variable: imapp, PyArray_DATA(buff), buffcount, bufftype) _check_err(ierr) - def get_var(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None): + def get_var_all(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None): """ - get_var(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None) + get_var_all(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None) - Method to read in parallel from the netCDF variable in the independent + Method to read in parallel from the netCDF variable in the collective I/O mode. The behavior of the method varies depends on the pattern of provided optional arguments - `start`, `count`, `stride`, and `imap`. The method requires a empty array (`data`) as a read buffer from caller @@ -1734,7 +1805,21 @@ cdef class Variable: :type buftype: mpi4py.MPI.Datatype :Operational mode: This method must be called while the file is in - independent data mode. + collective data mode. + + :Example: A example is available in ``examples/get_var.py`` + + :: + # allocate read buffer + r_buf = np.empty(tuple(count), v.dtype) + + # Read a subarray in collective mode + v.get_var_all(r_buf, start = start, count = count) + + # Equivalently, below uses python index style + end = [start[i] + count[i] for i in range(2)] + r_bufs = v[start[0]:end[0], start[1]:end[1]] + """ # Note that get_var requires a empty array as a buffer arg from caller # to store returned array values. We understand this is against python @@ -1744,42 +1829,42 @@ cdef class Variable: # 2. Other i/o methods (iget/put/iput) all require buffer array as mandatory argument if all(arg is None for arg in [start, count, stride, imap]): - self._get_var(data, collective = False, bufcount = bufcount, buftype = buftype) + self._get_var(data, collective = True, bufcount = bufcount, buftype = buftype) elif all(arg is not None for arg in [start]) and all(arg is None for arg in [count, stride, imap]): - self._get_var1(data, start, collective = False, bufcount = bufcount, buftype = buftype) + self._get_var1(data, start, collective = True, bufcount = bufcount, buftype = buftype) elif all(arg is not None for arg in [start, count]) and all(arg is None for arg in [stride, imap]): - self._get_vara(data, start, count, collective = False, bufcount = bufcount, buftype = buftype) + self._get_vara(data, start, count, collective = True, bufcount = bufcount, buftype = buftype) elif all(arg is not None for arg in [start, count, stride]) and all(arg is None for arg in [imap]): - self._get_vars(data, start, count, stride, collective = False, bufcount = bufcount, buftype = buftype) + self._get_vars(data, start, count, stride, collective = True, bufcount = bufcount, buftype = buftype) elif all(arg is not None for arg in [start, count, imap]): - self._get_varm(data, start, count, stride, imap, collective = False, bufcount = bufcount, buftype = buftype) + self._get_varm(data, start, count, stride, imap, collective = True, bufcount = bufcount, buftype = buftype) else: - raise ValueError("Invalid input arguments for get_var") + raise ValueError("Invalid input arguments for get_var_all") - def get_var_all(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None): + def get_var(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None): """ - get_var_all(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None) + get_var(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None) - Method to read in parallel from the netCDF variable in the collective + Method to read in parallel from the netCDF variable in the independent I/O mode. For the argument usage, please refer to method :meth:`Variable.get_var`. The only difference is this method is a - collective operation. + independent operation. :Operational mode: This method must be called while the file is in - collective data mode. + independent data mode. """ if all(arg is None for arg in [start, count, stride, imap]): - self._get_var(data, collective = True, bufcount = bufcount, buftype = buftype) + self._get_var(data, collective = False, bufcount = bufcount, buftype = buftype) elif all(arg is not None for arg in [start]) and all(arg is None for arg in [count, stride, imap]): - self._get_var1(data, start, collective = True, bufcount = bufcount, buftype = buftype) + self._get_var1(data, start, collective = False, bufcount = bufcount, buftype = buftype) elif all(arg is not None for arg in [start, count]) and all(arg is None for arg in [stride, imap]): - self._get_vara(data, start, count, collective = True, bufcount = bufcount, buftype = buftype) + self._get_vara(data, start, count, collective = False, bufcount = bufcount, buftype = buftype) elif all(arg is not None for arg in [start, count, stride]) and all(arg is None for arg in [imap]): - self._get_vars(data, start, count, stride, collective = True, bufcount = bufcount, buftype = buftype) + self._get_vars(data, start, count, stride, collective = False, bufcount = bufcount, buftype = buftype) elif all(arg is not None for arg in [start, count, imap]): - self._get_varm(data, start, count, stride, imap, collective = True, bufcount = bufcount, buftype = buftype) + self._get_varm(data, start, count, stride, imap, collective = False, bufcount = bufcount, buftype = buftype) else: - raise ValueError("Invalid input arguments for get_var_all") + raise ValueError("Invalid input arguments for get_var") def get_varn(self, data, num, starts, counts=None, bufcount=None, buftype=None): """ @@ -1867,6 +1952,20 @@ cdef class Variable: An MPI derived data type that describes the memory layout of the write buffer. :type buftype: mpi4py.MPI.Datatype + + :Example: + + :: + num_reqs = 4 + starts = np.zeros((num_reqs, NDIMS), dtype=np.int64) + counts = np.zeros((num_reqs, NDIMS), dtype=np.int64) + starts[0][0] = 0; starts[0][1] = 5; counts[0][0] = 1; counts[0][1] = 2 + starts[1][0] = 1; starts[1][1] = 0; counts[1][0] = 1; counts[1][1] = 1 + starts[2][0] = 2; starts[2][1] = 6; counts[2][0] = 1; counts[2][1] = 2 + starts[3][0] = 3; starts[3][1] = 0; counts[3][0] = 1; counts[3][1] = 3 + + v.get_varn_all(r_buf, num = num_reqs, starts = starts, counts = counts) + """ return self._get_varn(data, num, starts, counts, bufcount = bufcount, buftype = buftype, collective = False)