Search code examples
c++parallel-processingmpidistributedmpi-io

Parallel export of ASCII file on distributed file system


I need to export ASCII file on distributed file system. Currently I open file streams to the same file in append mode on each node. Then I export all data sequentially node by node. Will this solution work correctly on distributed file systems or is it necessary to use MPI-I/O? It seems that I don't quite understand the concept of parallel file systems.

P.S. The file is obliged to be ASCII.


Solution

  • With MPI-I/O, you cannot append data at the end of files in parallel. You can write data to specific locations of a file in parallel (to distinct locations by each MPI process), so you need to know the offsets for each process. Which might not be feasible for ASCII files.

    Another option is to write a separate file by each MPI process (in parallel) and then merge these files into a single one out of scope of a parallel program.