<div dir="ltr">I don't have a problem with that.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 16, 2020 at 11:16 AM Junchao Zhang <<a href="mailto:junchao.zhang@gmail.com">junchao.zhang@gmail.com</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"><div dir="ltr">Let me have a look. cupminit.inc is a template for CUDA and HIP. It is OK if you see some symbols twice.<br clear="all"><div><div dir="ltr"><div dir="ltr">--Junchao Zhang</div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 16, 2020 at 8:22 AM Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</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"><div dir="ltr">Junchao, I see this in cupminit.inc (twice)<br><font face="monospace"><br>#if defined(PETSC_HAVE_KOKKOS)<br> ierr = PetscKokkosInitialize_Private();CHKERRQ(ierr);<br> PetscBeganKokkos = PETSC_TRUE;<br>#endif<br></font><br>And I see<br><br>ierr = PetscKokkosInitializeCheck();CHKERRQ(ierr);<br><br>In the Kokkos operators. <div><br></div><div>Are these redundant?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 15, 2020 at 10:44 PM Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</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"><div dir="ltr">Si it seems like these two calls in cupminit.inc are inconsistent with lazy:<div><br><div>22:41 adams/gamg-reduce-opt-cuda *= ~/petsc$ git grep PetscBeganKokkos<br>src/sys/objects/cupminit.inc: PetscBeganKokkos = PETSC_TRUE;<br>src/sys/objects/cupminit.inc: PetscBeganKokkos = PETSC_TRUE;<br></div></div><div><br></div><div>I can do an MR to remove these if that is the case.</div><div><br></div><div>Mark</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 15, 2020 at 8:34 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</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"><br>
<br>
I thought the plan was that Kokkos also had a lazy initialization but perhaps it does not and needs to be fixed.<br>
<br>
Barry<br>
<br>
> On Oct 15, 2020, at 6:49 PM, Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> wrote:<br>
> <br>
> I am running a on SUMMIt with a Kokkos cuda configuration and while debugging with ddt I noticed that it spent a long time in KokkosInit, but I was not using Kokkos. KokkosInit was call in PETSc's GPU init, which seems logical enough, but it would be better if it is not called if you are not using Kokkos.<br>
> <br>
> I recall seeing places where Kokkos is checked when calling a Kokkos method (ie, lazy initialization). Do we have policy on whether we are being lazy with KokkosInit or not?<br>
> <br>
> Mark<br>
<br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>