implementations.convergence_controller_classes.spread_step_sizes module

class SpreadStepSizesBlockwise(controller, params, description, **kwargs)[source]

Bases: ConvergenceController

Take the step size from the last step in the block and spread it to all steps in the next block such that every step in a block always has the same step size. By block we refer to a composite collocation problem, which is solved in pipelined SDC parallel-in-time.

Also, we overrule the step size control here, if we get close to the final time and we would take too large of a step otherwise.

classmethod get_implementation(useMPI, **kwargs)[source]

Get MPI or non-MPI version

Parameters:

useMPI (bool) – The implementation that you want

Returns:

The child class implementing the desired flavor

Return type:

cls

get_step_from_which_to_spread(restarts, new_steps, size, S)[source]

Return the index of the step from which to spread the step size to all steps in the next block.

Parameters:
  • restarts (list) – List of booleans for each step, showing if it wants to be restarted

  • new_steps (list) – List of the new step sizes on the finest level of each step

  • size (int) – Size of the time communicator

  • S (pySDC.Step.step) – The current step

Returns:

The index of the step from which we want to spread the step size

Return type:

int

setup(controller, params, description, **kwargs)[source]

Define parameters here

Parameters:
  • controller (pySDC.Controller) – The controller

  • params (dict) – The params passed for this specific convergence controller

  • description (dict) – The description object used to instantiate the controller

Returns:

The updated params dictionary

Return type:

(dict)

class SpreadStepSizesBlockwiseMPI(controller, params, description, **kwargs)[source]

Bases: SpreadStepSizesBlockwise

MPI version

get_step_from_which_to_spread(comm, S)[source]

Return the index of the step from which to spread the step size to all steps in the next block.

Parameters:
  • comm (mpi4py.MPI.Intracomm) – Communicator

  • S (pySDC.Step.step) – The current step

Returns:

The index of the step from which we want to spread the step size

Return type:

int

prepare_next_block(controller, S, size, time, Tend, comm, **kwargs)[source]

Spread the step size of the last step with no restarted predecessors to all steps and limit the step size based on Tend

Parameters:
  • controller (pySDC.Controller) – The controller

  • S (pySDC.step) – The current step

  • size (int) – The number of ranks

  • time (float) – Time of the first step

  • Tend (float) – Final time of the simulation

  • comm (mpi4py.MPI.Intracomm) – Communicator

Returns:

None

class SpreadStepSizesBlockwiseNonMPI(controller, params, description, **kwargs)[source]

Bases: SpreadStepSizesBlockwise

Non-MPI version

get_step_from_which_to_spread(MS, S)[source]

Return the index of the step from which to spread the step size to all steps in the next block.

Parameters:
  • MS (list) – Active steps

  • S (pySDC.Step.step) – The current step

Returns:

The index of the step from which we want to spread the step size

Return type:

int

prepare_next_block(controller, S, size, time, Tend, MS, **kwargs)[source]

Spread the step size of the last step with no restarted predecessors to all steps and limit the step size based on Tend

Parameters:
  • controller (pySDC.Controller) – The controller

  • S (pySDC.step) – The current step

  • size (int) – The number of ranks

  • time (list) – List containing the time of all the steps handled by the controller (or float in MPI implementation)

  • Tend (float) – Final time of the simulation

  • MS (list) – Active steps

Returns:

None