예제 #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
예제 #2
0
파일: mpi.py 프로젝트: yutiansut/decaf
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
예제 #3
0
def root_decide(decision):
    """Returns the root decision."""
    return COMM.bcast(decision)
예제 #4
0
파일: mpi.py 프로젝트: yutiansut/decaf
def root_decide(decision):
    """Returns the root decision."""
    return COMM.bcast(decision)