def check_synced(self): synced = True if MPIUtil.is_root_proc(): vars = np.concatenate([self.mean, self.mean_sq]) MPIUtil.bcast(vars) else: vars_local = np.concatenate([self.mean, self.mean_sq]) vars_root = np.empty_like(vars_local) MPIUtil.bcast(vars_root) synced = (vars_local == vars_root).all() return synced
def check_synced(self): synced = True if self._is_root(): vars = self._get_flat_vars() MPIUtil.bcast(vars) else: vars_local = self._get_flat_vars() vars_root = np.empty_like(vars_local) MPIUtil.bcast(vars_root) synced = (vars_local == vars_root).all() return synced
def sync(self): vars = self._get_flat_vars() MPIUtil.bcast(vars) self._set_flat_vars(vars) return