PyPardiso: [Windows] The Pardiso solver failed with error code -3
Issue was first reported in https://github.com/LCA-ActivityBrowser/activity-browser/issues/694.
I can reproduce it on one of my windows installations (didn’t occur on the other one) by running the calculation step in the activity-browser:
Traceback (most recent call last):
File "C:\Users\Adrian\miniconda3\envs\ab\lib\site-packages\activity_browser\layouts\tabs\LCA_results_tab.py", line 60, in generate_setup
new_tab = LCAResultsSubTab(cs_name, presamples, self)
File "C:\Users\Adrian\miniconda3\envs\ab\lib\site-packages\activity_browser\layouts\tabs\LCA_results_tabs.py", line 101, in __init__
self.do_calculations()
File "C:\Users\Adrian\miniconda3\envs\ab\lib\site-packages\activity_browser\layouts\tabs\LCA_results_tabs.py", line 128, in do_calculations
self.mlca = MLCA(self.cs_name)
File "C:\Users\Adrian\miniconda3\envs\ab\lib\site-packages\activity_browser\bwutils\multilca.py", line 124, in __init__
self.lca.lci(factorize=True)
File "C:\Users\Adrian\miniconda3\envs\ab\lib\site-packages\bw2calc\lca.py", line 342, in lci
self.lci_calculation()
File "C:\Users\Adrian\miniconda3\envs\ab\lib\site-packages\bw2calc\lca.py", line 350, in lci_calculation
self.supply_array = self.solve_linear_system()
File "C:\Users\Adrian\miniconda3\envs\ab\lib\site-packages\bw2calc\lca.py", line 314, in solve_linear_system
return self.solver(self.demand_array)
File "C:\Users\Adrian\miniconda3\envs\ab\lib\site-packages\pypardiso\scipy_aliases.py", line 46, in spsolve
solver.factorize(A)
File "C:\Users\Adrian\miniconda3\envs\ab\lib\site-packages\pypardiso\pardiso_wrapper.py", line 150, in factorize
self._call_pardiso(A, b)
File "C:\Users\Adrian\miniconda3\envs\ab\lib\site-packages\pypardiso\pardiso_wrapper.py", line 281, in _call_pardiso
raise PyPardisoError(pardiso_error.value)
pypardiso.pardiso_wrapper.PyPardisoError: The Pardiso solver failed with error code -3. See Pardiso documentation for details.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (15 by maintainers)
Commits related to this issue
- Add tests for the readme example and issue #36 see https://github.com/haasad/PyPardisoProject/issues/36 — committed to haasad/PyPardiso by haasad 2 years ago
- Run test for a larger system see issues like https://github.com/haasad/PyPardisoProject/issues/36 — committed to haasad/PyPardiso by haasad a year ago
I was also bitten by this issue, under Linux. The issue appeared on an install that was created with:
The snippet above (the second conda execution in particular) pulled intel-openmp dependency and trashed my original environment.
TIP: keep
conda-forgeas the main source to get packagesa) Don’t forget to use it as the first channel in your
condacommands (update, install, etc.) or b) [nuke option] update your$HOME/.condarcto look like follows:ref here from conda-forge
and never forget you did this !
Indeed
After some more tests, I’m pretty certain that the issue is caused because
mklversion2021.4.0is not compatible withintel-openmp 2022.0.0. Themkl 2021.4.0package from both the conda defaults channel and pypi have pinned their dependency onintel-openmpto version2021.*.However on conda-forge this pinning of
intel-openmpto2021.*is missing formkl 2021.4.0:This leads to the current situation where
conda install -c conda-forge pypardisoinstallsmkl 2021.4.0alongsideintel-openmp 2022.0.0which are apparently not fully compatible. And whilemkl 2022.0.0is already available on conda-forge, the latest mkl-build oflibblashas an explicit dependency on the oldermkl 2021.4.0:thanks Adrian! with a fresh installation it does indeed work. I’ll follow your advice
That’s correct, according to my tests the problem only occurs with the combination of
mkl 2021.4andintel-openmp 2022.0.Summary of the current situation:
mkl 2021.4is not fully compatible withintel-openmp 2022.0, this only affects Windowspypardisoinstalled fromconda-forge, downgradingintel-openmpis a temporary solution to fix it:intel-openmpis only a Windows dependency (mklconda-forge packages for linux and osx both usellvm-openmp) and pypardiso is anoarchpackage, there is no straightforward way to fix this withpypardiso’s own dependency pinsPossible solutions:
libblaswith amkl 2022.0build, as the2022.0versions ofmklandintel-openmpappear to be compatible -> PR: https://github.com/conda-forge/blas-feedstock/pull/81intel-openmpin the conda-forgemklpackage -> issue: https://github.com/conda-forge/intel_repack-feedstock/issues/33pypardisofrom anoarchbuild to separate builds for each OS with a pinning for compatiblemklandintel-openmpon windows -> this is a lot of effort with the potential to break other things on linux and osx, last resortmkl-build oflibblasand pinmklto>=2022.0-> this is probably the way to go short-term if there is no progress on 1. and 2., but it could lead to changes in performance on all operating systems for non-pardiso linalg workloads, because of the diferent libblas-build