From: thakur@abacus.mcs.anl.gov (Rajeev Thakur)
Newsgroups: comp.parallel.mpi
Subject: Re: MPI_File_open problem
Date: Thu, 25 Mar 1999 3:59:19 GMT
Organization: MCS, Argonne National Laboratory
Message-Id: <92233435914786@abacus.mcs.anl.gov>
References: <7dbdlv$n0c$1@prometheus.acsu.buffalo.edu>
Xref: ukc comp.parallel.mpi:4833


In article <7dbdlv$n0c$1@prometheus.acsu.buffalo.edu>,
Chain-Wu Lee  <lee-d@cs.buffalo.edu> wrote:
>Hi,
>  There is a small i/o program (simpleio.c) comes with MPICH distribution, in 
>the program, it opens files with the call 
>
>    MPI_File_open(MPI_COMM_SELF, ....)
>
>  I wonder why it is not opened with MPI_COMM_WORLD? Is that because each 
>process opens its own file? If so, then is it right that when we want to
>use shared file pointer, we have to open it with MPI_COMM_WORLD?

Yes, it's because each process opens a separate file.
And yes, if you want all processes in the MPI job to share the shared
file pointer,  you must open a *common* file (same filename on each
process) and use MPI_COMM_WORLD. 

Rajeev

