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:
- Op
pylops.LinearOperator Operator to test. It must allow for multiprocessing/multithreading.
- x
numpy.ndarray, optional Input vector.
- workers
list, optional Number of workers to test out. Defaults to [1, 2, 4].
- forward
bool, optional Apply forward (
True) or adjoint (False)- ntimes
int, 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.
- Op
- Returns: