On May 15, 2005, at 2:44 PM, Oren Shapira wrote:
> I am working on parallelization of algorithm that writes calculated
> coefficients to pre-opened file. Since the number of coefficients is
> huge and the speed is very important, in serial algorithm I opened the
> output file for writing of binary data: fout=fopen(fopen_name, "wb").
>
> In the parallel implementation I opened output file as MPI_File and
> the writing process is very slow. It was opened by following command:
> MPI_File(MPI_COMM_SELF, filename, MPI_MODE_CREATE|MPI_MODE_WRONLY,
> MPI_INFO_NULL, &myfile);
>
> I assume that the reason for very slow writing is that the output file
> was opened in MPI_MODE_WRONLY. I didn't find MPI mode that is parallel
> to 'wb' mode in C. Can you help me in it? Which mode should I use? Or
> may be there is another solution for the problem?
I don't think that the mode flags are the cause of your problems - I
think MPI_MODE_CREATE|MPI_MODE_WRONLY is what you want. The 'b' in the
fopen argument is for binary mode for non-POSIX operating systems - on
most systems, it has absolutely no effect.
There are a number of things that could be happening to cause your
slowdown - are you writing to the same filesystem in both tests? Is
the filesystem local in one case and remote (NFS) in the other? NFS
can cause huge performance drops in some cases. Other questions
include how you are writing out your data to disk - are you calling
lots of little write statements or one big write statement? I would
imagine (but am not positive) that fwrite will do much more buffering
than the MPI_File_write functions will.
Other than those suggestions, I can't offer much advice. LAM uses
ROMIO from Argonne National Lab for our I/O support. I know there are
a couple of ROMIO experts on the LAM list - if you post some more
details about your setup and your usage of ROMIO, they may be able to
offer some reasonable advice.
Brian
--
Brian Barrett
LAM/MPI developer and all around nice guy
Have a LAM/MPI day: http://www.lam-mpi.org/
|