Motivation
matmat/rmatmat are effectively a for...loop (list comprehension to be more precise) over columns of a matrix X - ie the same operator is repeatedly applied to each column.
This suggests that similar parallelism that we currently expose in the stacking operators could also be exposed at that level.
Proposal
-
Add a pool variable to matmat/rmatmat which when not None triggers a multiprocessor/multithreading version of _matmat/_rmatmat.
-
Create a MultiProcThreadLinearOperator base class that implements all common logic and subclass all stacking operators and Kronecker to it.
-
Modify Kronecker to pass the pool to matmat/rmatmat
Motivation
matmat/rmatmatare effectively a for...loop (list comprehension to be more precise) over columns of a matrix X - ie the same operator is repeatedly applied to each column.This suggests that similar parallelism that we currently expose in the stacking operators could also be exposed at that level.
Proposal
Add a
poolvariable tomatmat/rmatmatwhich when not None triggers a multiprocessor/multithreading version of_matmat/_rmatmat.Create a
MultiProcThreadLinearOperatorbase class that implements all common logic and subclass all stacking operators and Kronecker to it.Modify
Kroneckerto pass the pool tomatmat/rmatmat