Skip to content

Commit

Permalink
add a doc section about GPUs (#1751)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Feb 13, 2025
1 parent 5886c9c commit e9bb41c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
37 changes: 33 additions & 4 deletions Docs/source/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ and the generic solvers:

* ``util/``: linear algebra solvers and other routines.

Design Philosophy

.. note::

All quantities are assumed to be in CGS units, unless otherwise
specified.

Design philosophy
=================

Any application that uses Microphysics will at minimum need to
Expand All @@ -67,7 +73,30 @@ solvers (ODE integration for the network and Newton-Raphson root
finding for the EOS) are separated from the specific implementations of
the microphysics.

.. note::

All quantities are assumed to be in CGS units, unless otherwise
specified.

GPU considerations
==================

.. index:: GPUs

All of the Microphysics routines are written to run on GPUs. This is
enabled in application codes by using the AMReX lambda-capturing
mechanism (see the [AMReX GPU
documentation](https://amrex-codes.github.io/amrex/docs_html/GPU.html)
for more information).

This means leveraging the AMReX data-structures, macros, and
functions. The unit tests (see :ref:`sec:unit_tests`) provide a good
reference for how to interface the Microphysics solvers and physics
terms with an AMReX-based code.

There are a few places where Microphysics behaves slightly differently
when running on a CPU vs. a GPU:

* In the VODE integrator, we disable Jacobian-caching to save memory.
See :ref:`ch:networks:integrators`.

* In general we disable printing from GPU kernels, due to register
pressure. Some output can be enabled by compiling with
``USE_GPU_PRINTF=TRUE``.
2 changes: 2 additions & 0 deletions Docs/source/unit_tests.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _sec:unit_tests:

**********************
Overview of Unit Tests
**********************
Expand Down

0 comments on commit e9bb41c

Please sign in to comment.