#include #include #include #include #include #include #include #define MAXLEN 9 int main(int argc, char **argv) { int i, rank, np, fd, buflen, num; int nelms[MAXLEN], buf[MAXLEN], indices[MAXLEN], blocklen[MAXLEN]; MPI_File fh; MPI_Status status; MPI_Datatype filetype; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &np); if (np != 2) { if (rank == 0) fprintf(stderr,"Must run on 2 MPI processes\n"); MPI_Finalize(); return 1; } /* set up the number of integers to write in each iteration */ for (i=0; i