Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

From: Adrian Knoth (adi_at_[hidden])
Date: 2007-01-08 17:49:32


we're facing a NFS race condition if File_Open is called for
a nonexisting file:

#include <mpi.h>
int main(int argc, char *argv[])
    MPI::Init(argc, argv);
    MPI::File _outputFile;
    double dummy = 42;

    _outputFile = MPI::File::Open(MPI::COMM_WORLD,
    _outputFile.Write(&dummy, 1, MPI::DOUBLE);

If run on two or more nodes with shared NFS, it usually fails:

ADIOI_NFS_OPEN (line 55): **filenoexist fooADIOI_NFS_OPEN (line 55): **filenoexist fooMPI_FILE_CLOSE (line 51): **iobadfh
ADIO_OPEN (line 273): **oremote_fail
ADIOI_NFS_OPEN (line 55): **filenoexist fooADIOI_NFS_OPEN (line 55): **filenoexist fooADIOI_NFS_OPEN (line 55): **filenoexist fooADIOI_NFS_OPEN (line 55): **filenoexist foo[amun2:12137] *** An error occurred in MPI_File_write
[amun2:12137] *** on a NULL file
MPI_FILE_CLOSE (line 51): **iobadfh
MPI_FILE_CLOSE (line 51): **iobadfh
MPI_FILE_CLOSE (line 51): **iobadfh
[amun2:12137] *** MPI_ERR_FILE: invalid file
[amun2:12137] *** MPI_ERRORS_ARE_FATAL (goodbye)
[inge:19493] *** An error occurred in MPI_File_write
[inge:19493] *** on a NULL file
[amun4:10186] *** An error occurred in MPI_File_write
[amun4:10186] *** on a NULL file
[amun3:11146] *** An error occurred in MPI_File_write
[amun3:11146] *** on a NULL file

(There are chances that this code will succeed if it is run on only two
 nodes and rank=0 is the NFS client and rank=1 is the NFS server)

The file is created on rank 0, closed and later reopened by all N
processes as described in ad_open.c around line 163. Unfortunately,
NFS isn't fast enough to inform all clients about the new file.
Also sync-mounting the share doesn't solve this issue.

A well-placed system("ls") in the code remedies the problem.
To avoid this noisy call, I've reimplemented this ls with
open(".") and stat("."), but stat() isn't necessary.

The attached patch fixes this problem, but perhaps there is
a better way to do it. What about upstream? (MPICH)?

(I guess NFS is widely used, so there should be more people
 facing this issue).

Cluster and Metacomputing Working Group
Friedrich-Schiller-Universität Jena, Germany