brightway-lca / brightway2-calc

The calculation engine for the Brightway2 life cycle assessment framework.
BSD 3-Clause "New" or "Revised" License
11 stars 14 forks source link

Factorizing matrices with pypardiso is not a no-op #98

Open marc-vdm opened 3 weeks ago

marc-vdm commented 3 weeks ago

Factorizing matrices with pypardiso is not a no-op and more importantly, can have substantial benefit to calculation speed.

While I don't mind warning users of potential limited benefit, I think it's not wise to outright deny users to factorize their A matrices through the below code.

https://github.com/brightway-lca/brightway2-calc/blob/adc379e04929821c7f798cd3491242c80df67309/bw2calc/lca_base.py#L119-L120

See also https://github.com/haasad/PyPardiso/issues/75 for further discussion.


edit: Also see the Pardiso documentation on solver phases, A matrix decomposition is possible https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2024-1/pardiso.html#GUID-FB4D5442-2BE8-4687-A6F6-D2AAE34B8A87