Issue found importing SimPEG/empymod regarding "numba" in a HPC cluster

Hi, SimPEG community!

I’ve been enjoying my experience using my windows/Linux PC setup for SimPEG and now I am trying to use it for a more scaled-up problem in HPC setup. I think I found an issue when importing empymod module in HPC (a CentOS machine).

The error seems like arising when the empymod is imported and referring to numba.

Here are highlights of my on-screen Traceback:

Traceback (most recent call last):
  ......
  File "/mypython/site-packages/numba/core/caching.py", line 347, in __init__
    raise RuntimeError("cannot cache function %r: no locator available "
RuntimeError: cannot cache function 'wavenumber': no locator available for file '/mypython/site-packages/empymod/kernel.py'
'/.myvirtualenvs/RegPy398/lib/python3.9/site-packages/empymod/kernel.py'

Indeed, it seems like the issue is similar to this OS-agnostic “numba” comment. (RuntimeError: cannot cache function 'square': no locator available for file · Issue #4908 · numba/numba · GitHub)

As I only need 3D DC/IP modeling and don’t need analytic solutions via empymod for the current task, I turned all the importing of empymod off so now it works without a runtime error.

Has anyone experienced a similar problem but come up with a better solution?

I hope this helps SimPEG developers and other users by opening the discussion.

Many thanks,

Kyubo

Hi @Kyubo,

Thanks for reporting. Could you tell me how you installed SimPEG? Is it with pip or with conda?

Reading through the issue you linked it looks like it will be fixed down the line. However, we could/should make the empymod lazy imported, so only if it is actually needed.

Thanks again!

What I don’t understand: If it is not used, then it shouldn’t be an issue and not result in an Error…

Hi @prisae!

"Could you tell me how you installed SimPEG? Is it with pipor withconda ?"
I tried both conda (conda install SimPEG --channel conda-forge) and pip (pip install SimPEG) on HPC, both showed the same error.

"What I don’t understand: If it is not used, then it shouldn’t be an issue and not result in an Error…"
That is what I really don’t understand too. The same code did not show any issues on my personal windows / Linux (ubuntu) machine.

Thanks!

Kyubo