Commit b8344c60 authored by Philipp Arras's avatar Philipp Arras
Browse files

Simplify

parent 5c5e2719
Pipeline #105818 passed with stages
in 20 minutes and 51 seconds
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
import collections import collections
from functools import reduce from functools import reduce
from itertools import product from itertools import product
import pickle
import numpy as np import numpy as np
...@@ -451,12 +452,7 @@ def check_MPI_equality(obj, comm): ...@@ -451,12 +452,7 @@ def check_MPI_equality(obj, comm):
def _MPI_unique(obj, comm): def _MPI_unique(obj, comm):
from collections.abc import Hashable return len(set(comm.allgather(pickle.dumps(obj)))) == 1
import pickle
objects = comm.allgather(obj)
if not isinstance(objects[0], Hashable) or isinstance(objects[0], np.random.SeedSequence):
objects = [pickle.dumps(oo) for oo in objects]
return len(set(objects)) == 1
def check_MPI_synced_random_state(comm): def check_MPI_synced_random_state(comm):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment