def test_label_state(self): """ Test we can label the local random generator with the rank. """ # This test is mainly intended for coverage, as the client-side # test of the behavior does not label the routine as covered. s0, orig_array, s2, s3, s4 = np.random.get_state() local_random.label_state(self.comm) s0, rank_array, s2, s3, s4 = np.random.get_state() # State should have changed from labeling. state_equal = np.all(orig_array == rank_array) self.assertFalse(state_equal)
def test_label_state(self): """ Test we can label the local random generator with the rank. """ # This test is mainly intended for coverage, as the client-side # test of the behavior does not label the routine as covered. s0, orig_array, s2, s3, s4 = np.random.get_state() local_random.label_state(self.comm) s0, rank_array, s2, s3, s4 = np.random.get_state() # State should have changed from labeling. state_equal = np.all(orig_array == rank_array) self.assertFalse(state_equal)
def _local_setup_random(seed, comm): from numpy import random from distarray.localapi.random import label_state random.seed(seed) label_state(comm)
def _local_setup_random(seed, comm): from numpy import random from distarray.localapi.random import label_state random.seed(seed) label_state(comm)