<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> Ernesto,<div class=""><br class=""></div><div class=""> If you ran (or can run) with -log_view you could see the time "ratio" in the output that tells how much time the "fastest" rank spent on the dot product versus the "slowest". Based on the different counts per rank you report that ratio might be around 3. But based on the times you report is around 200! </div><div class=""><br class=""></div><div class=""> My guess is that for the <span style="font-family: Calibri, sans-serif; font-size: 11pt;" class="">VecDotRhs() </span>some ranks are arriving at the vec dot long before other ranks and have to wait there an extremely long amount of time making it appear that the dot product is very slow. While, in reality, the large time credited to the vecdot is due to a misbalance in time for the operation before the VecDot.</div><div class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 20, 2022, at 1:23 PM, Ernesto Prudencio via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">I am using LSQR to minimize || L x – b ||_2, where L is a sparse rectangular matrix with 145,253,395 rows, 209,423,775 columns, and around 54 billion non zeros.<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">The numbers reported below are for a run with 27 compute nodes, each compute node with 4 MPI ranks, so a total of 108 ranks.<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Throughout the run, I assess the runtime taken by all dot products during the LSQR iterations, and I differentiate between dot products involving vectors of the size of the solution vector “x”, and dot products involving vectors of the size of the rhs “b”. Here are the numbers I get (we have an implementation of LSQR that performs some extra vector dot products for our needs):<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">236 VecDotSol take 1.523 seconds<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">226 VecDotRhs take 326.008 seconds<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Regarding the partition of rows and columns among the 108 MPI ranks:<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Rows: min = 838,529 ; avg = 1.34494e+06 ; max = 2,437,206<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Columns: min = 1,903,500 ; avg = 1.93911e+06 ; max = 1,946,270<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Regarding the partition of rows and columns among the 27 compute nodes:<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Rows: min = 3,575,584 ; avg = 5.37976e+06 ; max = 8,788,062<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Columns: min = 7,637,500 ; avg = 7.75644e+06 ; max = 7,785,080<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Questions:<o:p class=""></o:p></div><ol start="1" type="1" style="margin-bottom: 0in; margin-top: 0in;" class=""><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Why the average run times are so different between VecDotSol and VecDotRhs?<o:p class=""></o:p></li><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Could the much bigger unbalancing among the number of rows per rank (compared to the very well balanced distribution of columns per rank) be the cause?<o:p class=""></o:p></li><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Have you ever observed such situation?<o:p class=""></o:p></li><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">Could it be because of a bad MPI configuration / parametrization with respect to the underlying network?<o:p class=""></o:p></li><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">But, if yes, why the VecDotSol dot products are so much faster than VecDotRhs?<o:p class=""></o:p></li></ol><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thank you in advance,<o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Ernesto.<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><br class=""><div style="margin: 0px;" class=""><span style="font-size: 10pt; font-family: Calibri;" class="">Schlumberger-Private</span></div></div></div></blockquote></div><br class=""></div></body></html>