Example #1
0
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
Example #2
0
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
Example #3
0
def root_decide(decision):
    """Returns the root decision."""
    return COMM.bcast(decision)
Example #4
0
def root_decide(decision):
    """Returns the root decision."""
    return COMM.bcast(decision)