def _gather_vars(self, root, local_vars):

        if trace:
            debug("gathering vars for recording in %s" % root.pathname)
        all_vars = root.comm.gather(local_vars, root=0)
        if trace:
            debug("DONE gathering rec vars for %s" % root.pathname)

        if root.comm.rank == 0:
            dct = all_vars[-1]
            for d in all_vars[:-1]:
                dct.update(d)
            return dct
Gathers and returns only variables listed in
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/recorders/recording_manager.py/RecordingManager._gather_vars