Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 def _local_setup_random(seed, comm):
     from numpy import random
     from distarray.localapi.random import label_state
     random.seed(seed)
     label_state(comm)
Пример #4
0
 def _local_setup_random(seed, comm):
     from numpy import random
     from distarray.localapi.random import label_state
     random.seed(seed)
     label_state(comm)