[petsc-dev] Kokkos initialize

Mark Adams mfadams at lbl.gov
Fri Oct 16 08:07:38 CDT 2020


Junchao, I see this in cupminit.inc (twice)

#if defined(PETSC_HAVE_KOKKOS)
    ierr = PetscKokkosInitialize_Private();CHKERRQ(ierr);
    PetscBeganKokkos = PETSC_TRUE;
#endif

And I see

ierr = PetscKokkosInitializeCheck();CHKERRQ(ierr);

In the Kokkos operators.

Are these redundant?

On Thu, Oct 15, 2020 at 10:44 PM Mark Adams <mfadams at lbl.gov> wrote:

> Si it seems like these two calls in cupminit.inc are
> inconsistent with lazy:
>
> 22:41 adams/gamg-reduce-opt-cuda *= ~/petsc$ git grep PetscBeganKokkos
> src/sys/objects/cupminit.inc:    PetscBeganKokkos = PETSC_TRUE;
> src/sys/objects/cupminit.inc:    PetscBeganKokkos = PETSC_TRUE;
>
> I can do an MR to remove these if that is the case.
>
> Mark
>
> On Thu, Oct 15, 2020 at 8:34 PM Barry Smith <bsmith at petsc.dev> wrote:
>
>>
>>
>>   I thought the plan was that Kokkos also had a lazy initialization but
>> perhaps it does not and needs to be fixed.
>>
>>   Barry
>>
>> > On Oct 15, 2020, at 6:49 PM, Mark Adams <mfadams at lbl.gov> wrote:
>> >
>> > 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.
>> >
>> > 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?
>> >
>> > Mark
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20201016/8e65da0a/attachment.html>


More information about the petsc-dev mailing list