#include #include #include "mpi.h" /** * This example demonstrates the usage of MPI collective operations, * which should be called in the same orders for all MPI processes. * This example has an error when there are more than five MPI processes. */ #include int main(int argc, char *argv[]) { int rank, size, i, n; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); int sendbuf[size]; int recvbuf; if(rank == 0){ for (int i=0; i