<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 16 Mar 2020 at 16:35, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com" target="_blank">dalcinl@gmail.com</a>> writes:<br>
<br>
> Currently, binary viewers using POSIX file descriptors with READ mode open<br>
> the file in ALL processes in the communicator. For WRITE mode, only process<br>
> zero opens the file.<br>
><br>
> The current PetscViewerBynaryXXX APIs make it really unnecessary to open<br>
> the file in all processes for READ. I would like to get rid of that and<br>
> always open on rank 0 for both READ or WROTE. <br>
<br>
I think we should use MPI-IO by default, and advise that people use it<br>
whenever they can.</blockquote><div><br></div><div>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)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> I'm not sure of this suggested change, in that a<br>
"bad for MPI-IO" workload (like each rank randomly seeking around a big<br>
file) might not be better with rank 0 acting as a service rank.<br></blockquote><div><br></div><div>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), but in the current implementation, only process zero ever reads the file (unless the user gets the file descriptor and start issuing low-level PetscBinaryRead() calls). So I do not see the point of opening the file on all processes (and then stress metadata servers on parallel filesystem), if we are not going to ever read from rank != 0. Let's just fix things to open the file at rank==0 only. If users ever need to read in rank != 0, then can very well create the viewer on COMM_SELF, or whatever.</div><div><br></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Lisandro Dalcin<br>============<br>Research Scientist<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br></div></div></div></div>