def main():
    print(argv)
    COMM = MPI.COMM_WORLD
    NUM_PROC = COMM.Get_size()
    M_RANK = COMM.Get_rank()
    N = 100
    m_N = int((N / NUM_PROC))
    if (M_RANK == MASTER_RANK):
        A = np.arange(N, dtype=np.float64)
        start_time = MPI.Wtime()
    else:
        A = np.empty(N, dtype=np.float64)
    m_A = np.empty(m_N, dtype=np.float64)
    COMM.Scatter([A, MPI.DOUBLE], [m_A, MPI.DOUBLE])
    for i in range(m_N):
        m_A[i] = M_RANK
    COMM.Barrier()
    COMM.Allgather([m_A, MPI.DOUBLE], [A, MPI.DOUBLE])
    COMM.Barrier()
    if (M_RANK == MASTER_RANK):
        print(A)
def main():
    print(argv)
    COMM = MPI.COMM_WORLD
    NUM_PROC = COMM.Get_size()
    M_RANK = COMM.Get_rank()
    N = 100
    m_N = int((N / NUM_PROC))
    if (M_RANK == MASTER_RANK):
        A = np.arange(N, dtype=np.float64)
        start_time = MPI.Wtime()
    else:
        A = np.empty(N, dtype=np.float64)
    m_A = np.empty(m_N, dtype=np.float64)
    COMM.Scatter([A, MPI.DOUBLE], [m_A, MPI.DOUBLE])
    for i in range(m_N):
        m_A[i] = M_RANK
    COMM.Barrier()
    COMM.Allgather([m_A, MPI.DOUBLE], [A, MPI.DOUBLE])
    COMM.Barrier()
    if (M_RANK == MASTER_RANK):
        print(A)