/********************************************************************** C-DAC Tech Workshop : hyPACK-2013 October 15-18, 2013 Example 1.4 : mpi-io-write-single-file.c Objective : MPI Parallel I/O to Single I/O Based on the number of processes spawned the program Each process use MPI 2.0 I/O library calls. and writes to s single file Input : None Output : Output files with random data written Created : August-2013 E-mail : hpcfte@cdac.in ****************************************************************************/ #include #include #include #define BUFSIZE 100 int main (int argc, char *argv[]) { int i, myrank, numprocs, buf[BUFSIZE]; MPI_File thefile; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &myrank); MPI_Comm_size (MPI_COMM_WORLD, &numprocs); for (i=0; i