/* test program that writes integers to files each process write NUM_ELEMENTS integers NUM_BLOCKS times The output file must contain integers from 0 -> NUM_BLOCKS*NUM_ELEMENTS*num_processes - 1 */ #include #include #include #include #include #include #define NUM_BLOCKS 4 /* how many blocks each process will write */ #define NUM_ELEMENTS 4 /* number of elements each process will write in a block */ int main(int argc, char** argv) { MPI_File fh; int size, rank, i, j, k, h; MPI_Datatype ftype,newtype; int buf_write[NUM_BLOCKS*NUM_ELEMENTS]; int buf_read[NUM_BLOCKS*NUM_ELEMENTS]; MPI_Aint disp[NUM_BLOCKS+1], d[3]; int blocklength[NUM_BLOCKS+1], b[3]; MPI_Datatype types[NUM_BLOCKS+1], t[3]; int datsize; int SIZE = NUM_BLOCKS * NUM_ELEMENTS; MPI_Status status; MPI_Init (&argc, &argv); MPI_Comm_size (MPI_COMM_WORLD, &size); MPI_Comm_rank (MPI_COMM_WORLD, &rank); k=0; for (i=0; i