<div dir="ltr">Thank you Barry for your useful comments and the paper and Hong for some very very useful information. I will get back to you if I need any further assistance.<div><br></div><div>By the way, in my experience, PETSc has got one of the best user support system I have ever experienced for any software/library. Information is timely and relevant, Three cheers for all PETSc experts in this group :)</div><div><br></div><div>Have a great day,</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 30, 2018 at 8:01 AM, Zhang, Hong <span dir="ltr"><<a href="mailto:hongzhang@anl.gov" target="_blank">hongzhang@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word;line-break:after-white-space">
<br>
<div><span class=""><br>
<blockquote type="cite">
<div>On May 29, 2018, at 3:05 AM, Najeeb Ahmad <<a href="mailto:nahmad16@ku.edu.tr" target="_blank">nahmad16@ku.edu.tr</a>> wrote:</div>
<br class="m_-1410119242205368955Apple-interchange-newline">
<div><br class="m_-1410119242205368955Apple-interchange-newline">
<br style="font-family:Verdana;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div class="gmail_quote" style="font-family:Verdana;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
On Mon, May 28, 2018 at 9:32 PM, Smith, Barry F.<span class="m_-1410119242205368955Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span><span class="m_-1410119242205368955Apple-converted-space"> </span>wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<span><br>
<br>
> On May 28, 2018, at 10:32 AM, Najeeb Ahmad <<a href="mailto:nahmad16@ku.edu.tr" target="_blank">nahmad16@ku.edu.tr</a>> wrote:<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> Thanks a lot Satish for your prompt reply.<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> I just checked that SuperLU_dist package works only for matrices of type aij. and uses lu preconditioner. I am currently working with baij matrix. What is the best preconditioner choice for baij matrices on parallel machines?<br>
<br>
</span>    The best preconditioner is always problem specific. Where does your problem come from? CFD? Structural mechanics? other apps?<br>
</blockquote>
<div>        </div>
<div>       <span class="m_-1410119242205368955Apple-converted-space"> </span><font color="#0000ff">I am interested in writing solver for reservoir simulation employing FVM and unstructured grids. My main objective is to study performance of the code with different
 data structures/data layouts and architecture specific optimizations, specifically targeting the multicore architectures like KNL for instance. Later the study may be extended to include GPUs. The options for switching between AIJ and BAIJ etc. are therefore
 very useful for my study. </font></div>
<div><font color="#0000ff"><br>
</font></div>
<div><font color="#0000ff">        The purpose why I wanted to change the preconditioner is that the default preconditioner is giving me different iterations count for different number of processesors. I would rather like a preconditioner
 that would give me same iteration count for any processor count so that I can better compare the performance results. </font></div>
<div><font color="#0000ff"><br>
</font></div>
<div><font color="#0000ff">        Your suggestions in this regard are highly appreciated, specifically with reference to the following points:</font></div>
<div><font color="#0000ff">       </font></div>
<div><font color="#0000ff">         - Is it possible to explicitly use high bandwidth memory in PETSc for selected object placement (e.g. using memkind library for instance)?</font></div>
</div>
</div>
</blockquote>
<div><br>
</div>
</span><div>Yes, see <a href="http://www.mcs.anl.gov/petsc/petsc-3.8/src/sys/memory/mhbw.c.html" target="_blank">http://www.mcs.anl.gov/<wbr>petsc/petsc-3.8/src/sys/<wbr>memory/mhbw.c.html</a></div>
<div><br>
</div>
<div>This was developed to use memkind to handle adjoint checkpointing where I want to use HBW memory for computation and DRAM for storing checkpoints. But it can be used for your purpose as well.</div>
<div><br>
</div>
<div>When configure PETSc, use "--with-memkind-dir=" to specify the location of the memkind library.</div>
<div>The runtime option "-malloc_hbw" will allow you to allocate all PETSc objects in HBW memory. If the HBW memory is ran out, it falls back to DRAM.</div>
<div><br>
</div>
<div>If you want to place selective objects in DRAM, you can do</div>
<div><br>
</div>
<div>PetscMallocSetDRAM()  </div>
<div>...  allocate your objects ...</div>
<div><span style="white-space:pre-wrap">PetscMallocResetDRAM()</span></div>
<div><br>
</div>
<div>An example usage can be found at</div>
<div><a href="http://www.mcs.anl.gov/petsc/petsc-dev/src/ts/trajectory/impls/memory/trajmemory.c" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>petsc-dev/src/ts/trajectory/<wbr>impls/memory/trajmemory.c</a></div><span class="">
<div><br>
</div>
<br>
<blockquote type="cite">
<div>
<div class="gmail_quote" style="font-family:Verdana;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div><font color="#0000ff">         - What would it take to take advantage of architecture specific compiler flags to achieve good performance on a given platform (e.g. -xMIC-AVX512 for AVX512 on KNL, #pragma SIMD etc.). </font></div>
</div>
</div>
</blockquote>
<div><br>
</div>
</span><div>To build PETSc on KNL with AVX512 enabled, see the example scripts </div>
<div>config/examples/arch-linux-<wbr>knl.py</div>
<div>config/examples/arch-cray-<wbr>xc40-knl-opt.py</div>
<div><br>
</div>
<div>Note that the MatMult kernel (for AIJ and SELL) has been manually optimized for best performance.</div>
<div><br>
</div>
<div>Hong (Mr.)</div><div><div class="h5">
<br>
<blockquote type="cite">
<div>
<div class="gmail_quote" style="font-family:Verdana;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div><font color="#0000ff">       Sorry for some very basic questions as I am a novice PETSc user. </font></div>
<div><font color="#0000ff"><br>
</font></div>
<div><font color="#0000ff">     Thanks for your time :)</font></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
     Anyways you probably want to make your code be able to switch between AIJ and BAIJ at run time since the different formats support somewhat different solvers. If your code alls MatSetFromOptions then you can switch via the command line option -mat_type
 aij or baij <span class="m_-1410119242205368955Apple-converted-space"> </span><br>
<span class="m_-1410119242205368955HOEnZb"><font color="#888888"><br>
   Barry<br>
</font></span>
<div class="m_-1410119242205368955HOEnZb">
<div class="m_-1410119242205368955h5"><br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> Thanks<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> On Mon, May 28, 2018 at 8:23 PM, Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br>
> On Mon, 28 May 2018, Najeeb Ahmad wrote:<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> > Hi All,<br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> > I have Petsc release version 3.9.2 configured with the following options:<br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> > Configure options --with-cc=mpiicc --with-cxx=mpiicpc --with-fc=mpiifort<br>
> > --download-fblaslapack=1<br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> > Now I want to use PCILU in my code and when I set the PC type to PCILU in<br>
> > the code, I get the following error:<br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> > [0]PETSC ERROR: --------------------- Error Message<br>
> > ------------------------------<wbr>------------------------------<wbr>--<br>
> > [0]PETSC ERROR: See<br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><a href="http://www.mcs.anl.gov/petsc/documentation/linearsolvertable.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/<wbr>petsc/documentation/linearsolv<wbr>ertable.html</a><span class="m_-1410119242205368955Apple-converted-space"> </span>for<br>
> > possible LU and Cholesky solvers<br>
> > [0]PETSC ERROR: Could not locate a solver package. Perhaps you must<br>
> > ./configure with --download-<package><br>
> > [0]PETSC ERROR: See<span class="m_-1410119242205368955Apple-converted-space"> </span><a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/<wbr>petsc/documentation/faq.html</a><span class="m_-1410119242205368955Apple-converted-space"> </span>f<wbr>or<br>
> > trouble shooting.<br>
> > [0]PETSC ERROR: Petsc Release Version 3.9.2, unknown<br>
> > [0]PETSC ERROR: ./main on a arch-linux2-c-debug named Karachi by nahmad Mon<br>
> > May 28 17:52:41 2018<br>
> > [0]PETSC ERROR: Configure options --with-cc=mpiicc --with-cxx=mpiicpc<br>
> > --with-fc=mpiifort --download-fblaslapack=1<br>
> > [0]PETSC ERROR: #1 MatGetFactor() line 4318 in<br>
> > /home/nahmad/PETSc/petsc/src/m<wbr>at/interface/matrix.c<br>
> > [0]PETSC ERROR: #2 PCSetUp_ILU() line 142 in<br>
> > /home/nahmad/PETSc/petsc/src/k<wbr>sp/pc/impls/factor/ilu/ilu.c<br>
> > [0]PETSC ERROR: #3 PCSetUp() line 923 in<br>
> > /home/nahmad/PETSc/petsc/src/k<wbr>sp/pc/interface/precon.c<br>
> > [0]PETSC ERROR: #4 KSPSetUp() line 381 in<br>
> > /home/nahmad/PETSc/petsc/src/k<wbr>sp/ksp/interface/itfunc.c<br>
> > [0]PETSC ERROR: #5 KSPSolve() line 612 in<br>
> > /home/nahmad/PETSc/petsc/src/k<wbr>sp/ksp/interface/itfunc.c<br>
> > [0]PETSC ERROR: #6 SolveSystem() line 60 in<br>
> > /home/nahmad/Aramco/petsc/pets<wbr>c/BlockSolveTest/src/main.c<br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> > I assume that I am missing LU package like SuperLU_dist for instance and I<br>
> > need to download and configure it with Petsc.<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> yes - petsc has sequential LU - but you need superlu_dist/mumps for parallel lu.<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> > I am wondering what is the best way to reconfigure Petsc to download and<br>
> > use the appropriate package to support PCILU?<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> Rerun configure with the additional option --download-superlu_dist=1.<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> You can do this with current PETSC_ARCH you are using [i.e reinstall<br>
> over the current build] - or use a different PETSC_ARCH - so both<br>
> builds exist and useable.<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> Satish<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> > You advice is highly appreciated.<br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> ><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> --<span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> Najeeb Ahmad<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> Research and Teaching Assistant<br>
> PARallel and MultiCORE Computing Laboratory (ParCoreLab)<span class="m_-1410119242205368955Apple-converted-space"> </span><br>
> Computer Science and Engineering<br>
> Koç University, Istanbul, Turkey<br>
><span class="m_-1410119242205368955Apple-converted-space"> </span><br>
<br>
</div>
</div>
</blockquote>
</div>
<br style="font-family:Verdana;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<br clear="all" style="font-family:Verdana;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div style="font-family:Verdana;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<br>
</div>
<span style="font-family:Verdana;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important">--<span class="m_-1410119242205368955Apple-converted-space"> </span></span><br style="font-family:Verdana;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div class="m_-1410119242205368955gmail_signature" data-smartmail="gmail_signature" style="font-family:Verdana;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div>
<div></div>
<font size="2"><b><span style="color:rgb(7,55,99)"><i>Najeeb Ahmad</i></span></b></font></div>
<div><font size="2"><b><font color="#073763"><i><br>
</i></font></b></font>
<div dir="ltr" style="font-size:small">
<div><font size="2"><b><span style="color:rgb(120,63,4)">Research and Teaching Assistant</span><br>
</b></font></div>
<div><font size="2"><b><font>PARallel and MultiCORE Computing Laboratory (ParCoreLab)</font><span style="color:rgb(120,63,4)"> </span></b></font></div>
<font size="2"><b>Computer Science and Engineering<br>
</b></font></div>
<div style="font-size:small"><font size="2"><b>Koç University, Istanbul, Turkey</b></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div></div></div>
<br>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div></div><font size="2"><b><span style="color:rgb(7,55,99)"><i>Najeeb Ahmad</i></span></b></font></div><div><font size="2"><b><font color="#073763"><i><br></i></font></b></font><div dir="ltr" style="font-size:small"><div><font size="2"><b><span style="color:rgb(120,63,4)">Research and Teaching Assistant</span><br></b></font></div><div><font size="2"><b><font color="#000000">PARallel and MultiCORE Computing Laboratory (ParCoreLab)</font><span style="color:rgb(120,63,4)"> </span></b></font></div><font size="2"><b>Computer Science and Engineering<br></b></font></div><div style="font-size:small"><font size="2"><b>Koç University, Istanbul, Turkey</b></font></div></div></div></div><div><font size="2"><b><br></b></font></div></div></div></div></div></div></div></div>
</div>