odatse.algorithm.mapper_mpi module

class odatse.algorithm.mapper_mpi.Algorithm(info: Info, runner: Runner = None, domain=None, run_mode: str = 'initial')[source]

Bases: AlgorithmBase

Algorithm class for data analysis of quantum beam diffraction experiments. Inherits from odatse.algorithm.AlgorithmBase.

Initialize the Algorithm instance.

Parameters:
  • info (Info) – Information object containing algorithm parameters.

  • runner (Runner) – Optional runner object for submitting tasks.

  • domain – Optional domain object, defaults to MeshGrid.

  • run_mode (str) – Mode to run the algorithm, defaults to “initial”.

__init__(info: Info, runner: Runner = None, domain=None, run_mode: str = 'initial') None[source]

Initialize the Algorithm instance.

Parameters:
  • info (Info) – Information object containing algorithm parameters.

  • runner (Runner) – Optional runner object for submitting tasks.

  • domain – Optional domain object, defaults to MeshGrid.

  • run_mode (str) – Mode to run the algorithm, defaults to “initial”.

_initialize() None[source]

Initialize the algorithm parameters and timer.

_load_state(filename, restore_rng=True)[source]

Load the state of the algorithm from a file.

Parameters:
  • filename – The name of the file to load the state from.

  • restore_rng (bool) – Whether to restore the random number generator state.

_output_results()[source]

Output the results to the colormap file.

_post() Dict[source]

Post-process the results and gather data from all MPI ranks.

Returns:

Dictionary of results.

Return type:

Dict

_prepare() None[source]

Prepare the algorithm (no operation).

_run() None[source]

Execute the main algorithm process.

_save_state(filename) None[source]

Save the current state of the algorithm to a file.

Parameters:

filename – The name of the file to save the state to.