pylops.utils.scalability_test

pylops.utils.scalability_test(Op, x, workers=None, forward=True, ntimes=1)[source]

Scalability test.

Small auxiliary routine to test the performance of operators using multiprocessing/concurrent.futures. This helps identifying the maximum number of workers beyond which no performance gain is observed.

Parameters:
Oppylops.LinearOperator

Operator to test. It must allow for multiprocessing/multithreading.

xnumpy.ndarray, optional

Input vector.

workerslist, optional

Number of workers to test out. Defaults to [1, 2, 4].

forwardbool, optional

Apply forward (True) or adjoint (False)

ntimesint, optional

Number of times the forward/adjoint is applied whilst timing operations. Consider using \(n_{times} \ge 10\) to obtain a stable measure of the compute times and speedups.

Returns:
compute_timeslist

Compute times as function of workers

speeduplist

Speedup as function of workers

Examples using pylops.utils.scalability_test

Operators with Multithreading/Multiprocessing

Operators with Multithreading/Multiprocessing