2
votes

I'm running a fortran code in multi processes using Open MPI. Each process needs to open and write many files. During the run time, it's possible that two different processes will open and write different files with the same unit number concurrently.

processA: open(unit=10, file1)
processB: open(unit=10, file2)

Will this cause a problem?

1
Note that MPI is no the same as OpenMPI. The latter is just one of many implementations of the former. - Vladimir F
Thanks for the clarification! - Kevin Powell

1 Answers

4
votes

Yes, it is possible, and no it should not cause problems. The MPI processes all live on their own and are not aware of the memory (and therefore unit numbers) of other processes. Though you should be careful to not create too many files, if you use thousands of processes you may run into limitations of the filesystem.