# Analysis step error, not enough memory

**URL:** <https://simpeg.discourse.group/t/analysis-step-error-not-enough-memory/624>\
**Category:** Electromagnetics\
**Created:** [November 6, 2024, 4:14pm UTC](https://simpeg.discourse.group/t/analysis-step-error-not-enough-memory/624 "2024-11-06T16:14:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhovers](https://yyz2.discourse-cdn.com/free1/user_avatar/simpeg.discourse.group/mhovers/32/199_2.png) [@mhovers](https://simpeg.discourse.group/u/mhovers)\
**Post date:** [November 6, 2024, 4:14pm UTC](https://simpeg.discourse.group/t/analysis-step-error-not-enough-memory/624/1 "2024-11-06T16:14:12Z")

</div>

I am using the following steps to setup my Anaconda/python environment to run an FDEM casing model:

1. “git clone [GitHub - simpeg-research/heagy-2021-tle-casing](https://github.com/simpeg-research/heagy-2021-tle-casing.git)”
2. cd heagy-2021-tle-casing
3. set -scipy\<=1.6 in environment.yml
4. conda init
5. create a new terminal window and go to that for further commands
6. conda env create -f environment.yml
7. conda activate heagy-2021-tle-casing
8. pip uninstall empymod
9. pip install empymod==2.2.0
10. pip install --upgrade simpeg==0.21.1

I am running a big mesh for a CSEM source-receiver configuration with steel casing at r=0. The code takes ~ 350GM of memory on a machine with ~ 750 GB of memory. When I increase the casing OD so that the mesh size increases, but still 100’s of GB below the machine max memory, I get the following crash:

Code:  
%%time

fields\_dict = {}  
dpred={}  
for key, m in models.items():  
if key not in fields\_dict.keys():  
t = time.time()  
fields\_dict[key] = sim.fields(m)  
dpred[key]=sim.dpred(m)  
print(f" … done {key}. {time.time()-t:1.2e} s")

## Crash:

PardisoError Traceback (most recent call last)

File :6

File [SimPEG/electromagnetics/frequency\_domain/simulation.py:178](https://simpeg.discourse.group/SimPEG/electromagnetics/frequency_domain/simulation.py#line=177), in BaseFDEMSimulation.fields(self, m)

**176** A = self.getA(freq)

**177** rhs = self.getRHS(freq)

→ 178 Ainv = self.solver(A, \*\*self.solver\_opts)

**179** u = Ainv \* rhs

**180**  **if**  **not** self.forward\_only:

**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, not enough memory

I have tired “conda install mkl=2022.1” but that does not help.

Can anyone suggest how to debug this or if the modules I am using are out of date??  
Thanks for any help.
