  In this paper, we introduce the Python framework PyMGRIT, which implements
the multigrid-reduction-in-time (MGRIT) algorithm for solving the (non-)linear
systems arising from the discretization of time-dependent problems. The MGRIT
algorithm is a reduction-based iterative method that allows parallel-in-time
simulations, i. e., calculating multiple time steps simultaneously in a
simulation, by using a time-grid hierarchy. The PyMGRIT framework features many
different variants of the MGRIT algorithm, ranging from different multigrid
cycle types and relaxation schemes, as well as various coarsening strategies,
including time-only and space-time coarsening, to using different time
integrators on different levels in the multigrid hierachy. PyMGRIT allows
serial runs for prototyping and testing of new approaches, as well as parallel
runs using the Message Passing Interface (MPI). Here, we describe the
implementation of the MGRIT algorithm in PyMGRIT and present the usage from
both user and developer point of views. Three examples illustrate different
aspects of the package, including pure time parallelism as well as space-time
parallelism by coupling PyMGRIT with PETSc or Firedrake, which enable spatial
parallelism through MPI.
