示例#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)