hi everyone,
   I want  each process on different servers to write to different files, so
i written following code:
      open-test.c

 ----------------------------------------------------------------------------
      ... ...
      MPI_Comm_rank(MPI_COMM_WORLD, &mynod);
       ... ...
      sprinft(fname, "pvfs2:/mnt/pvfs2/test-%d", mynode)
      ret = MPI_File_open(MPI_COMM_SELF,
                                    fname,
                                    MPI_MODE_RDWR|MPI_MODE_CREATE,
                                    MPI_INFO_NULL,
                                    &fh);
       ret = MPI_File_write(
                                    fh,
                                    f_buf,
                                    F_BUF_SIZE,
                                    MPI_BYTE,
                                    MPI_STATUS_IGNORE);
        ... ...

 ----------------------------------------------------------------------------
      compile: mpicc open-test.c -o open-test
      run with:  mpirun -n 10 ./open-test

     when the program is running , i find all ten processes open the same
file(for example, pvfs2:/mnt/pvfs2/test-1),
     and write all data to  pvfs2:/mnt/pvfs2/test-1.

     Then i check the mpi doc of mpi_file_open, it says that:
      .....all processes must provide the same value for *amode,* and all
processes must provide
filenames that reference the same file and which are textually identical.

*     So i think even though i pass different names to MPI_File_open in
different processes, it will open the same file, *
*     and then the following MPI_File_write will write the all data to the
same file.*
*
*
      Can someone tell me whether  what i think is right or not?
      If i am right, how can I open different files in different process?

Thanks in advance!

Din Dong
_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users

Reply via email to