def _get_global_idxs(self, uname, pname, u_var_idxs,
                         u_sizes, p_var_idxs, p_sizes, mode):
        rev = mode == 'rev'
        fwd = not rev
        uacc = self.unknowns._dat[uname]
        pacc = self.params._dat[pname]
        umeta = uacc.meta
        pmeta = pacc.meta

        iproc = 0 if self.comm is None else self.comm.rank
        udist = 'src_indices' in umeta
        pdist = 'src_indices' in pmeta

        # FIXME: if we switch to push scatters, this check will flip
        if ((fwd and pacc.remote) or
            (rev and not pdist and uacc.remote) or
                (rev and udist and not pdist and iproc != self._owning_ranks[pname])):
            # just return empty index arrays for remote vars
            return self.params.make_idx_array(0, 0), self.params.make_idx_array(0, 0)

        if pdist:
            arg_idxs = self.params.to_idx_array(pmeta['src_indices'])
        else:
            arg_idxs = self.params.make_idx_array(0, pmeta['size'])

        ivar = u_var_idxs[uname]
        if udist or pdist:
            new_indices = np.empty(arg_idxs.shape, dtype=arg_idxs.dtype)

            for irank in range(self.comm.size):
                start = np.sum(u_sizes[:irank, ivar])
                end = start + u_sizes[irank, ivar]
                on_irank = np.logical_and(start <= arg_idxs, arg_idxs < end)

                # Compute conversion to new ordering

                # arg_idxs are provided wrt the full distributed variable,
                # so we subtract off the start of the var in the current rank
                # in order to make the overall offset relative to the
                # beginning of the full distributed variable.
                offset = -start

                offset += np.sum(u_sizes[:irank, :])
                offset += np.sum(u_sizes[irank, :ivar])

                # Apply conversion only to relevant parts of input
                new_indices[on_irank] = arg_idxs[on_irank] + offset

            src_idxs = new_indices
            p_rank = self._owning_ranks[pname] if (rev and pacc.remote) else iproc

        else:
            u_rank = self._owning_ranks[uname] if fwd else iproc
            p_rank = self._owning_ranks[pname] if rev else iproc

            offset = np.sum(u_sizes[:u_rank]) + np.sum(u_sizes[u_rank, :ivar])
            src_idxs = arg_idxs + offset

        tgt_start = (np.sum(p_sizes[:p_rank]) +
                     np.sum(p_sizes[p_rank, :p_var_idxs[pname]]))
        tgt_idxs = tgt_start + self.params.make_idx_array(0, len(arg_idxs))

        return src_idxs, tgt_idxs
Return a list of all files and directories in the given path, recursively.
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/core/group.py/Group._get_global_idxs--crossover with--dataset/ETHPy150Open jlisee/xpkg/python/xpkg/util.py/list_files