def elect(): '''elect() randomly chooses a node from all the nodes as the president. Input: None Output: the rank of the president ''' president = COMM.bcast(np.random.randint(SIZE)) return president
def root_decide(decision): """Returns the root decision.""" return COMM.bcast(decision)