LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Tim Prince (TimothyPrince_at_[hidden])
Date: 2009-02-21 21:33:39


Jun-Wei Huang wrote:
> Hi,
> I am new to LAM/MPI. Could anyone help me to understand why
> multi-process reading/writing the same file takes more time than one
> process? Is that due to hard driver IO cannot be operated
> simultaneously? Thank you.
>
> I am using Red Hat Linux release 9 (Shrike), Lam-7.0 and simple file IO
> commands (e.g., fopen, fread, fwrite).
>

This appears to be a general parallel programming question, not even
specific to MPI, which ought to be covered in textbooks far better than I
am able to do.
While a process has a file open with write access, normally, other
processes will be locked out. If multiple processes have the file open
for read only, it's still potentially a shared resource, with only 1 block
available, so the processes would be waiting for their turn.
Thus, a basic MPI strategy will be to segregate files into global files,
and distributed files, where each process owns its own version of the file.