It's unclear if you are asking about the MPI_File routines for parallel i/o, or if you are asking how to processs a file in MPI. I'm going to assume you're asking about MPI_File routines.
For unformatted text files, it can be difficult to come up with a parallel decomposition strategy. your file has 10000 words including symbol and number so it's not actually a whole lot of data.
if you know how to use the POSIX system calls open
, read
, and close
, then you can in a first pass simply replace those calls with MPI_File_open
, MPI_File_read
, and MPI_File_close
.
you can ignore details like the MPI file view, in-memory datatypes, and collective I/O: your data is probably not large enough to warrant more sophisticated techniques.