[petsc-dev] Question about Binary-IO in READ mode with POSIX APIs

Jed Brown jed at jedbrown.org
Mon Mar 16 08:35:11 CDT 2020


Lisandro Dalcin <dalcinl at 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.  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.

> Such change may impact third-party code using low-level IO. However,
> note that after MR 2594
> https://gitlab.com/petsc/petsc/-/merge_requests/2594 gets merged,
> third party code should hardly need to access the file
> descriptors/MPI_File to perform IO (this would require some minor and
> relatively easy improvements to subviewers that I'm planning).
>
> In short, I would like to change binary viewers in READ mode using POSIX
> file descriptors to open files ONLY in rank 0 rather than ALL ranks as it
> is now. Any objections?
>
> PS: After all the enhancements to binary viewers, we should consider
> whether we should turn MPI-IO on by default.
>
> -- 
> Lisandro Dalcin
> ============
> Research Scientist
> Extreme Computing Research Center (ECRC)
> King Abdullah University of Science and Technology (KAUST)
> http://ecrc.kaust.edu.sa/


More information about the petsc-dev mailing list