Analysis step error, reordering problem

Hello,
I get the error “PardisoError: Analysis step error, reordering problem ” during inversion.
pgi_model = inv.run(m0)

I use SimPEG v0.17.0.
Here the traceback:


PardisoError Traceback (most recent call last)
Cell In[35], line 2
1 # Invert
----> 2 pgi_model_no_info = inv.run(m0)

File ~/.conda/envs/SimPEG1/lib/python3.9/site-packages/SimPEG/utils/counter_utils.py:105, in timeIt..wrapper(self, *args, **kwargs)
103 if isinstance(counter, Counter):
104 counter.countTic(self.class.name + “.” + f.name)
→ 105 out = f(self, *args, **kwargs)
106 if isinstance(counter, Counter):
107 counter.countToc(self.class.name + “.” + f.name)

File ~/.conda/envs/SimPEG1/lib/python3.9/site-packages/SimPEG/inversion.py:63, in BaseInversion.run(self, m0)
56 @timeIt
57 def run(self, m0):
58 “”“run(m0)
59
60 Runs the inversion!
61
62 “””
—> 63 self.invProb.startup(m0)
64 self.directiveList.call(“initialize”)
65 print(“model has any nan: {:b}”.format(np.any(np.isnan(self.invProb.model))))

File ~/.conda/envs/SimPEG1/lib/python3.9/site-packages/SimPEG/utils/code_utils.py:178, in callHooks..callHooksWrap..wrapper(self, *args, **kwargs)
175 print((match + " is calling self." + method))
176 getattr(self, method)(*args, **kwargs)
→ 178 return f(self, *args, **kwargs)
179 else:
180 out = f(self, *args, **kwargs)

File ~/.conda/envs/SimPEG1/lib/python3.9/site-packages/SimPEG/inverse_problem.py:112, in BaseInvProblem.startup(self, m0)
104 if getattr(objfct.simulation, “solver”, None) is not None:
105 print(
106 “”"
107 SimPEG.InvProblem is setting bfgsH0 to the inverse of the eval2Deriv.
(…)
110 )
111 )
→ 112 self.opt.bfgsH0 = objfct.simulation.solver(
113 self.reg.deriv2(self.model), **objfct.simulation.solver_opts
114 )
115 break

File ~/.conda/envs/SimPEG1/lib/python3.9/site-packages/pymatsolver/direct.py:23, in Pardiso.init(self, A, **kwargs)
21 self.A = A
22 self.set_kwargs(**kwargs)
—> 23 self.solver = MKLPardisoSolver(
24 self.A,
25 matrix_type=self._matrixType(),
26 factor=False
27 )

File pydiso/mkl_solver.pyx:305, in pydiso.mkl_solver.MKLPardisoSolver.init()

File pydiso/mkl_solver.pyx:511, in pydiso.mkl_solver.MKLPardisoSolver._analyze()

PardisoError: Analysis step error, reordering problem

That’s a tough one, sometimes due to a system that is poorly conditioned.
It does look like it is happening in the BFGS part, so I would suggest switching optimization instead. That part of the code hasn’t been really looked at in a long time, and I personally just stopped using it.
Consider using the optimization.ProjectedGNCG with a directives.UpdatePreconditioner() instead. It will avoid hitting the solve altogether, and Jacobi is a much better pre-conditioner anyway.