def __init__(self, system, vname, use_vec_offset=True):
    '\n        Initialize the iterator.\n        '
    self._dist_size = 0
    abs2meta = system._var_allprocs_abs2meta['output']
    if (vname in abs2meta):
        sizes = system._var_sizes['output']
        slices = system._outputs.get_slice_dict()
    else:
        abs2meta = system._var_allprocs_abs2meta['input']
        sizes = system._var_sizes['input']
        slices = system._inputs.get_slice_dict()
    if abs2meta[vname]['distributed']:
        var_idx = system._var_allprocs_abs2idx[vname]
        rank = system.comm.rank
        self._offset = (np.sum(sizes[rank, :var_idx]) if use_vec_offset else 0)
        self._iter = self._dist_iter
        self._start = np.sum(sizes[:rank, var_idx])
        self._end = (self._start + sizes[(rank, var_idx)])
        self._dist_size = np.sum(sizes[:, var_idx])
    else:
        self._iter = self._serial_iter
        if use_vec_offset:
            self._inds = range(slices[vname].start, slices[vname].stop)
        else:
            self._inds = range((slices[vname].stop - slices[vname].start))
Initialize the iterator.
def __init__(self, system, vname, use_vec_offset=True):
    '\n        \n        '
    self._dist_size = 0
    abs2meta = system._var_allprocs_abs2meta['output']
    if (vname in abs2meta):
        sizes = system._var_sizes['output']
        slices = system._outputs.get_slice_dict()
    else:
        abs2meta = system._var_allprocs_abs2meta['input']
        sizes = system._var_sizes['input']
        slices = system._inputs.get_slice_dict()
    if abs2meta[vname]['distributed']:
        var_idx = system._var_allprocs_abs2idx[vname]
        rank = system.comm.rank
        self._offset = (np.sum(sizes[rank, :var_idx]) if use_vec_offset else 0)
        self._iter = self._dist_iter
        self._start = np.sum(sizes[:rank, var_idx])
        self._end = (self._start + sizes[(rank, var_idx)])
        self._dist_size = np.sum(sizes[:, var_idx])
    else:
        self._iter = self._serial_iter
        if use_vec_offset:
            self._inds = range(slices[vname].start, slices[vname].stop)
        else:
            self._inds = range((slices[vname].stop - slices[vname].start))