pynucastro.reduction.reduction_utils module

pynucastro.reduction.reduction_utils module#

class pynucastro.reduction.reduction_utils.FailedMPIImport(error=None, msg=None)[source]#

Bases: object

Class that can replace an mpi4py.MPI import and will throw an error if used.

exception pynucastro.reduction.reduction_utils.MPIImportError[source]#

Bases: Exception

pynucastro.reduction.reduction_utils.mpi_importer()[source]#

Lazy MPI import, where we only throw an error if the import failed and then we attempt to use the object.

pynucastro.reduction.reduction_utils.mpi_numpy_decomp(MPI_N, MPI_rank, n)[source]#

Decompose a set of conditions for MPI_N MPI processes, where the conditions are a sequence of 3 sequences with ordering (composition_sequence, density_sequence, temperature_sequence). This structure for the dataset is necessary for the vectorized reduction algorithms.

pynucastro.reduction.reduction_utils.to_list(x, n=1)[source]#

Convert a sequence or non-iterable to a list. In the non-iterable case, the supplied object will be repeated n times (default 1).