Fortran-inquire routine to test for directories

  • Follow


Hi,

my processes write their output to different directories. These 
directories are created by the master in the beginning and the nodes are 
told to wait until the master has finished his job creating their 
directories.

On NFS (or similar) mounts the filesystem-changes need some time to 
propagate. So even the master announced the directories have been 
created, they might not exist for all nodes yet. I thought to sovle this 
by looping

    DO
       INQUIRE(FILE=trim(nodeDir),EXIST=fileSystemReady)
       IF (fileSystemReady) EXIT
    END DO

    OPEN(ounit,FILE=trim(nodeDir)//trim(outFile), ...

Unfortunately, this does not work as I use MPI - the inquire statement 
always returns FALSE.

I removed the testing and inserted a dummy-loop to spend some time to be 
sure the directories are available. The outFile can be accessed without 
problems, INQUIRE on the file returns TRUE, but still a INQUIRE on the 
directory gives FALSE. I tried the same scenario on a single machine (no 
MPI) and there it worked out perfectly - it looped as long as had not 
created the directory by hand.

Can someone please explain me this weird behavior, or does anyone know a 
more elegant workaround than "spending time to be sure"?

best regards,
Thomas
0
Reply Thomas 6/4/2005 10:05:01 AM

hi,

Thomas Lang wrote:
> more elegant workaround than "spending time to be sure"?
ok, I could test if the open statement succeded, or test on a file 
instead of testing on a directory (but there should be no difference).

br.
T.
0
Reply Thomas 6/4/2005 12:10:27 PM


1 Replies
229 Views

(page loaded in 0.076 seconds)

Similiar Articles:













7/29/2012 6:20:52 AM


Reply: