OSError: libxsmm.so: cannot open shared object file

Hello Team PyFR,

I am unable to run pyfr with Openmp.
(cuda works fine)
followed the instructions in the installation page of pyfr for libxsmm.

Could you please suggest what should be done for such error.

steps followed for libxsmm

git clone https://github.com/libxsmm/libxsmm.git
cd libxsmm
make -j4 STATIC=0 BLAS=0
export PYFR_XSMM_LIBRARY_PATH="path/to/lib/libxsmm.so"

Error when using openmp

Traceback (most recent call last):
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/ctypesutil.py", line 58, in load_library
    return ctypes.CDLL(lname)
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/ctypes/__init__.py", line 382, in __init__
Traceback (most recent call last):
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/ctypesutil.py", line 58, in load_library
    self._handle = _dlopen(self._name, mode)
OSError: libxsmm.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vg767303/miniconda3/envs/PyFR/bin/pyfr", line 8, in <module>
    sys.exit(main())
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/__main__.py", line 118, in main
    return ctypes.CDLL(lname)
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/ctypes/__init__.py", line 382, in __init__
    args.process(args)
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/__main__.py", line 251, in process_run
    _process_common(
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/__main__.py", line 230, in _process_common
    backend = get_backend(args.backend, cfg)
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/backends/__init__.py", line 12, in get_backend
    self._handle = _dlopen(self._name, mode)
OSError: libxsmm.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vg767303/miniconda3/envs/PyFR/bin/pyfr", line 8, in <module>
    sys.exit(main())
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/__main__.py", line 118, in main
    return subclass_where(BaseBackend, name=name.lower())(cfg)
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/backends/openmp/base.py", line 58, in __init__
    args.process(args)
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/__main__.py", line 251, in process_run
    _process_common(
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/__main__.py", line 230, in _process_common
    self._providers = [k(self) for k in kprovcls]
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/backends/openmp/base.py", line 58, in <listcomp>
    backend = get_backend(args.backend, cfg)
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/backends/__init__.py", line 12, in get_backend
    self._providers = [k(self) for k in kprovcls]
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/backends/openmp/xsmm.py", line 34, in __init__
    return subclass_where(BaseBackend, name=name.lower())(cfg)
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/backends/openmp/base.py", line 58, in __init__
    self._wrappers = w = XSMMWrappers()
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/ctypesutil.py", line 15, in __init__
    self._lib = lib = load_library(self._libname)
  File "/home/vg767303/miniconda3/envs/PyFR/lib/python3.9/site-packages/pyfr/ctypesutil.py", line 67, in load_library
    raise OSError(f'Unable to load {name}')
OSError: Unable to load xsmm
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0

Regards,
Manu.

Can you check that the shared object file libxsmm.so is in the location that you’re pointing pyfr to?

Also if you’re using the most up to date version of pyfr, you’ll need to be running Python>=3.10, and not 3.9.

Hello Mr. Will,

Yes the libxsmm.so file is in the location and i even updated to the Python==3.10.9.
Still I am receiving the same error.

Thank you and Regards,
Manu.

From the install guide:

In order for PyFR to find libxsmm it must be located in a directory which is on the library search path.

Regards, Freddie.

Hello Mr.Freddie,

Thank you for your prompt reply.

I sorted out the issue, thanks to your feedback.

When I was using openmp for pyfr euler example it worked but when tried on my mesh case it is showing an error.
The mesh works fine with cuda.
can you suggest what could be the issue and how can I sort it out.

Thank you and Regards,
Manu.

Your shared file system is broken in one way or another.

The ideal solution would be to resolve this issue. However, as a workaround you can do:

export PYFR_DEBUG_OMP_DISABLE_CACHE=true

which will disable the cache.

Regards, Freddie.