Lisandro Dalcin <dalcinl@gmail.com> writes:
> Currently, binary viewers using POSIX file descriptors with READ mode open
> the file in ALL processes in the communicator. For WRITE mode, only process
> zero opens the file.
>
> The current PetscViewerBynaryXXX APIs make it really unnecessary to open
> the file in all processes for READ. I would like to get rid of that and
> always open on rank 0 for both READ or WROTE.
I think we should use MPI-IO by default, and advise that people use it
whenever they can.
OK, let me look again to the details, I think a few minor things should be done before using MPI-IO as a default (like a proper subviewer implementation)
I'm not sure of this suggested change, in that a
"bad for MPI-IO" workload (like each rank randomly seeking around a big
file) might not be better with rank 0 acting as a service rank.
Please note my main question is unrelated to MPI-IO. It is about the original POSIX-based implementation of binary viewers. For mode READ, all processes open the file (with the open() system call),