* example of parallel MPI write into a single file */ #include "mpi.h" #include #define BUFSIZE 100 int main(int argc, char *argv[]) { /* int j = 0; char hostname[256]; gethostname(hostname, sizeof(hostname)); printf("PID %d on %s ready for attach\n", getpid(), hostname); fflush(stdout); while (0 == j) sleep(5); */ int ret, resultlen; int i, myrank, buf[BUFSIZE]; char msg[MPI_MAX_ERROR_STRING]; MPI_File thefile; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &myrank); for (i=0; i