Reputation: 1
i have problem, how to read external file.txt on my mpi code on C. into file.txt containing 10000 word, and i will filter this word remove symbol and number, and i get output like this :
A
As
America
And
Are
Aztec
B
Bald
Bass
Best
up to Z
my question is, how to process it on parallel computing?
Upvotes: 0
Views: 110
Reputation: 5223
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.
Upvotes: 1