<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thanks Jed, Satish, and Richard for the quick and thorough responses.<br>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-size:11pt"><strong>Philip Fackler<br>
</strong></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div><span style="font-size:11pt">Research Software Engineer, Application Engineering Group</span></div>
<div><span style="font-size:11pt">Advanced Computing Systems Research Section</span></div>
<div><span style="font-size:11pt">Computer Science and Mathematics Division<br>
</span></div>
<div><span style="font-size:11pt"><strong>Oak Ridge National Laboratory</strong></span><span style="font-size:11pt"></span><br>
</div>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> petsc-users <petsc-users-bounces@mcs.anl.gov> on behalf of Richard Tran Mills via petsc-users <petsc-users@mcs.anl.gov><br>
<b>Sent:</b> Thursday, February 17, 2022 18:33<br>
<b>To:</b> petsc-users <petsc-users@mcs.anl.gov><br>
<b>Cc:</b> Blondel, Sophie <sblondel@utk.edu>; Roth, Philip <rothpc@ornl.gov>; xolotl-psi-development@lists.sourceforge.net <xolotl-psi-development@lists.sourceforge.net><br>
<b>Subject:</b> [EXTERNAL] Re: [petsc-users] Kokkos Interface for PETSc</font>
<div> </div>
</div>
<div>Hi Philip,<br>
<br>
Sorry to be a bit late in my reply. Jed has explained the gist of what's involved with using the Kokkos/Kokkos-kernels back-end for the PETSc solves, though, depending on exactly how Xolotl creates its vectors, there may be a bit of work required to ensure
that the command-line options specifying the matrix and GPU types get applied to the right objects, and that non-GPU types are not being hardcoded somewhere (by a call like "DMSetMatType(dm,MATAIJ)").<br>
<br>
In addition to looking at the -log_view output, since Xolotl uses TS you can specify "-ts_view" and look at the output that describes the solver hierarchy that Xolotl sets up. If matrix types are being set correctly, you'll see things like<br>
<br>
Mat Object: 1 MPI processes<br>
type: seqaijkokkos<br>
<br>
(I note that I've also sent a related message about getting Xolotl working with Kokkos back-ends on Summit to you, Sophie, and Phil in reply to old thread about this.)<br>
<br>
Were you also asking about how to use Kokkos for PETSc matrix assembly, or is that a question for later?<br>
<br>
Cheers,<br>
Richard<br>
<br>
<div class="x_moz-cite-prefix">On 2/15/22 09:07, Satish Balay via petsc-users wrote:<br>
</div>
<blockquote type="cite">
<pre class="x_moz-quote-pre">Also - perhaps the following info might be useful
Satish
----
balay@sb /home/balay/petsc (main=)
$ git grep -l download-kokkos-kernels config/examples
config/examples/arch-ci-freebsd-cxx-cmplx-pkgs-dbg.py
config/examples/arch-ci-linux-cuda-double.py
config/examples/arch-ci-linux-gcc-ifc-cmplx.py
config/examples/arch-ci-linux-hip-double.py
config/examples/arch-ci-linux-pkgs-dbg-ftn-interfaces.py
config/examples/arch-ci-linux-pkgs-valgrind.py
config/examples/arch-ci-osx-cxx-pkgs-opt.py
config/examples/arch-nvhpc.py
config/examples/arch-olcf-crusher.py
config/examples/arch-olcf-spock.py
balay@sb /home/balay/petsc (main=)
$ git grep -l "requires:.*kokkos_kernels"
src/ksp/ksp/tests/ex3.c
src/ksp/ksp/tests/ex43.c
src/ksp/ksp/tests/ex60.c
src/ksp/ksp/tutorials/ex7.c
src/mat/tests/ex123.c
src/mat/tests/ex132.c
src/mat/tests/ex2.c
src/mat/tests/ex250.c
src/mat/tests/ex251.c
src/mat/tests/ex252.c
src/mat/tests/ex254.c
src/mat/tests/ex5.c
src/mat/tests/ex62.c
src/mat/tutorials/ex5k.kokkos.cxx
src/snes/tests/ex13.c
src/snes/tutorials/ex13.c
src/snes/tutorials/ex3k.kokkos.cxx
src/snes/tutorials/ex56.c
src/ts/utils/dmplexlandau/tutorials/ex1.c
src/ts/utils/dmplexlandau/tutorials/ex1f90.F90
src/ts/utils/dmplexlandau/tutorials/ex2.c
src/vec/vec/tests/ex21.c
src/vec/vec/tests/ex22.c
src/vec/vec/tests/ex23.c
src/vec/vec/tests/ex28.c
src/vec/vec/tests/ex34.c
src/vec/vec/tests/ex37.c
src/vec/vec/tests/ex38.c
src/vec/vec/tests/ex4.c
src/vec/vec/tests/ex43.c
src/vec/vec/tests/ex60.c
src/vec/vec/tutorials/ex1.c
balay@sb /home/balay/petsc (main=)
$
On Tue, 15 Feb 2022, Satish Balay via petsc-users wrote:
</pre>
<blockquote type="cite">
<pre class="x_moz-quote-pre">Also - best to use petsc repo - 'main' branch.
And for install on crusher - check config/examples/arch-olcf-crusher.py
Satish
On Tue, 15 Feb 2022, Jed Brown wrote:
</pre>
<blockquote type="cite">
<pre class="x_moz-quote-pre">We need to make these docs more explicit, but the short answer is configure with --download-kokkos --download-kokkos-kernels and run almost any example with -dm_mat_type aijkokkos -dm_vec_type kokkos. If you run with -log_view, you should see that all the flops take place on the device and there are few host->device transfers. Message packing is done on the device and it'll use GPU-aware MPI. There are a few examples of residual evaluation and matrix assembly on the device using Kokkos. You can also see libCEED examples for assembly on the device into Kokkos matrices and vectors without touching host memory.
"Fackler, Philip via petsc-users" <a class="x_moz-txt-link-rfc2396E" href="mailto:petsc-users@mcs.anl.gov"><petsc-users@mcs.anl.gov></a> writes:
</pre>
<blockquote type="cite">
<pre class="x_moz-quote-pre">We're intending to transitioning the Xolotl interfaces with PETSc.
I am hoping someone (can) point us to some documentation (and examples) for using PETSc's Kokkos-based interface. If this does not yet exist, then perhaps some slides (like the ones Richard Mills showed at the NE-SciDAC all-hands meeting) showing some examples could get us started.
Thanks for any help that can be provided,
Philip Fackler
Research Software Engineer, Application Engineering Group
Advanced Computing Systems Research Section
Computer Science and Mathematics Division
Oak Ridge National Laboratory
</pre>
</blockquote>
<pre class="x_moz-quote-pre">
</pre>
</blockquote>
<pre class="x_moz-quote-pre">
</pre>
</blockquote>
<pre class="x_moz-quote-pre">
</pre>
</blockquote>
<br>
</div>
</body>
</html>