I am using fortran direct access files to write data from multiple CPUs into a single file. I have recently found that with the PGI compilers, that I need have the root cpu open the file as ‘new’ and all other cpus open the file as ‘old’. This I can work with. My problem is that I have also found that I can’t have multiple files open like this at one time. On no other compiler that I’ve used have I found this to be the case.
So basically, I am forced to open a file, write to it, close the file, and then do the same for the second file (open, write, close).
If I do things such that I open two files, write to them both at separate times, and then close the files, then only the first file is correct. The second file contains garbage.
Is there some reason why I can’t have two direct access files open at once?