zoomy_jax.symsolver.parallel#
Distributed runs on JAX: the halo exchange and the global reductions of the runtime’s name
table, one MPI rank per device. Used by zoomy_jax.symsolver.runtime when the solver gets
comm=; the exchanges are mpi4jax collectives, differentiable in both directions.
Module Contents#
Classes#
Context manager inside which |
Functions#
Bind this rank to one GPU of its node (round robin), before JAX starts if possible. No-op on
the CPU, with one GPU, or when |
|
The owned-cell mask |
|
The |
API#
- zoomy_jax.symsolver.parallel.bind_device(comm)#
Bind this rank to one GPU of its node (round robin), before JAX starts if possible. No-op on the CPU, with one GPU, or when
CUDA_VISIBLE_DEVICESis set.
- class zoomy_jax.symsolver.parallel.no_halo#
Context manager inside which
halois the identity, giving the rank’s own block of an operator (block-Jacobi preconditioner).
- zoomy_jax.symsolver.parallel.krylov(part, nc)#
The owned-cell mask
(nc,)and the global sum (allreduce) a distributed Krylov solve needs.Returns
(mask, gsum); insidecustom_linear_solvenothing is differentiated throughgsum.
- zoomy_jax.symsolver.parallel.blocks(part, mesh_np)#
The
haloexchange and the global reductions of the runtime’s name table for this rank’s piece, each face and cell counted once.Args
part:zoomy_core.mesh.distributed.Partitionof this rankmesh_np: the rank’s local mesh
Returns
dict with
halo,reduce_any,reduce_min,reduce_max