qimpy.mpi.TaskDivision
- class TaskDivision(*, n_tot, n_procs, i_proc, name=None)
Bases:
object
Division of a number of tasks over MPI.
- Parameters:
n_tot (int) –
n_procs (int) –
i_proc (int) –
name (str | None) –
- __init__(*, n_tot, n_procs, i_proc, name=None)
Divide n_tot tasks among n_procs processes. Report division and load balance if name is not None.
- Parameters:
n_tot (int) –
n_procs (int) –
i_proc (int) –
name (str | None) –
- Return type:
None
Methods
Divide n_tot tasks among n_procs processes.
Return whether current process is responsible for task i
Return process index i_proc responsible for task i
Return process index i_proc responsible for each task in i
Attributes
Total number of tasks over all processes
Number of processes to split over
Rank of current process
Number of tasks on each process (till we run out)
Cumulative task counts (n_procs+1 ints)
Task start index on current process
Task stop index on current process
Number of tasks on current process
- is_mine(i)
Return whether current process is responsible for task i
- Parameters:
i (int) –
- Return type:
bool
- whose(i)
Return process index i_proc responsible for task i
- Parameters:
i (int) –
- Return type:
int
- whose_each(i)
Return process index i_proc responsible for each task in i
- Parameters:
i (Tensor) –
- Return type:
Tensor
- i_proc: int
Rank of current process
- i_start: int
Task start index on current process
- i_stop: int
Task stop index on current process
- n_each: int
Number of tasks on each process (till we run out)
- n_mine: int
Number of tasks on current process
- n_prev: ndarray
Cumulative task counts (n_procs+1 ints)
- n_procs: int
Number of processes to split over
- n_tot: int
Total number of tasks over all processes