Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyDPF-core will not open result files from Ansys version older than 21 #748

Open
3 tasks done
iceblink-ansys opened this issue Jan 9, 2023 · 7 comments
Open
3 tasks done
Assignees
Labels
bug Something isn't working

Comments

@iceblink-ansys
Copy link

iceblink-ansys commented Jan 9, 2023

Before submitting the issue

  • I have checked for Compatibility issues
  • I have searched among the existing issues
  • I am using a Python virtual environment

Description of the bug

>>> from ansys.dpf import core as dpf
>>> model = dpf.Model('v18.rst')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/HPC_A/OF_ANSS/Users/me/pyAnsysEnv/lib/python3.7/site-packages/ansys/dpf/core/model.py", line 49, in __init__
    server = dpf.core._global_server()
  File "/HPC_A/OF_ANSS/Users/me/pyAnsysEnv/lib/python3.7/site-packages/ansys/dpf/core/server.py", line 69, in _global_server
    start_local_server(as_global=True)
  File "/HPC_A/OF_ANSS/Users/me/pyAnsysEnv/lib/python3.7/site-packages/ansys/dpf/core/server.py", line 191, in start_local_server
    raise errors.InvalidANSYSVersionError(f"Ansys v{ver} does not support DPF")
ansys.dpf.core.errors.InvalidANSYSVersionError: Ansys v182 does not support DPF

Steps To Reproduce

start pyAnsys virtual environment
start python

inside python do:

from ansys.dpf import core as dpf
model = dpf.Model('v18.rst')

Which Operating System are you using?

Linux

Which DPF/Ansys version are you using?

Ansys 2022 R2

Which Python version are you using?

3.7

Installed packages

Package Version


aiohttp 3.8.3
aiosignal 1.3.1
ansys-api-mapdl 0.5.1
ansys-api-platform-instancemanagement 1.0.0b3
ansys-corba 0.1.1
ansys-dpf-core 0.7.1
ansys-dpf-gate 0.3.0
ansys-dpf-gatebin 0.3.0
ansys-dpf-post 0.2.5
ansys-grpc-dpf 0.7.0
ansys-mapdl-core 0.63.4
ansys-mapdl-reader 0.52.4
ansys-platform-instancemanagement 1.0.2
appdirs 1.4.4
async-timeout 4.0.2
asynctest 0.13.0
attrs 22.1.0
cachetools 5.2.0
certifi 2022.12.7
charset-normalizer 2.1.1
cycler 0.11.0
fonttools 4.38.0
frozenlist 1.3.3
geomdl 5.3.1
google-api-core 2.11.0
google-api-python-client 2.70.0
google-auth 2.15.0
google-auth-httplib2 0.1.0
googleapis-common-protos 1.57.0
grpcio 1.51.1
httplib2 0.21.0
idna 3.4
imageio 2.22.4
importlib-metadata 5.1.0
kiwisolver 1.4.4
matplotlib 3.5.3
multidict 6.0.3
numpy 1.21.6
packaging 22.0
pexpect 4.8.0
Pillow 9.3.0
pip 22.3.1
pooch 1.6.0
protobuf 3.20.3
protoc-gen-swagger 0.1.0
psutil 5.9.4
ptyprocess 0.7.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pyiges 0.2.1
pyparsing 3.0.9
python-dateutil 2.8.2
pyvista 0.37.0
requests 2.28.1
rsa 4.9
scipy 1.7.3
scooby 0.7.0
setuptools 47.1.0
six 1.16.0
tqdm 4.64.1
typing_extensions 4.4.0
uritemplate 4.1.1
urllib3 1.26.13
vtk 9.2.2
wslink 1.9.2
yarl 1.8.2
zipp 3.11.0

@iceblink-ansys iceblink-ansys added the bug Something isn't working label Jan 9, 2023
@iceblink-ansys
Copy link
Author

iceblink-ansys commented Jan 9, 2023

Seems to be hardcoded in ansys/dpf/core/server.py:

line 178+

Returns
-------
server : server.ServerBase
"""
from ansys.dpf.core.misc import is_pypim_configured
use_docker = use_docker_by_default and docker_config.use_docker
use_pypim = use_pypim_by_default and is_pypim_configured()
if not use_docker and not use_pypim:
    ansys_path = get_ansys_path(ansys_path)
    # parse the version to an int and check for supported
    try:
        ver = int(str(ansys_path)[-3:])
        if ver < 211:
            raise errors.InvalidANSYSVersionError(f"Ansys v{ver} does not support DPF")
        if ver == 211 and is_ubuntu():
            raise OSError("DPF on v211 does not support Ubuntu")
    except ValueError:
        pass

@PProfizi
Copy link
Contributor

PProfizi commented Jan 9, 2023

@iceblink-ansys ok so the issue is that while you seem to have ANSYS 2022R2 installed (you mention it in the issue description), DPF tries to start a server using your 2018.2 installation folder.
This is most likely a problem of path/environment variable.
As shown in the code you shared, what is tested is the ansys_path variable. Yours seems to include v182.

The problem is not with the result file.

Could you please try:

from ansys.dpf import core as dpf
dpf.server.start_local_server(as_global=True, ansys_path=FULL_PATH_TO_YOUR_222_INSTALLATION_FOLDER)
model = dpf.Model('v18.rst')

DPF should detect your 2022.2 installation if either:

  • you the have AWP_ROOT222 environment variable set (should have been set by the Workbench installation procedure)
  • you have a v222 folder in the regular installation path, usually C:\Program Files\ANSYS Inc\
  • you have declared a custom default path for DPF using the environment variable ANSYS_DPF_PATH

@PProfizi PProfizi self-assigned this Jan 9, 2023
@iceblink-ansys
Copy link
Author

iceblink-ansys commented Jan 9, 2023

@PProfizi when i try that:

>>> from ansys.dpf import core as dpf
>>> my_ansys_path = "/HPC_A/system/eb/common/software/ANSYS/2022R2/v222"
>>> dpf.server.start_local_server(as_global=True, ansys_path=my_ansys_path)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/HPC_A/OF_ANSS/Users/me/pyAnsysEnv/lib/python3.7/site-packages/ansys/dpf/core/server.py", line 237, in start_local_server
    load_operators=load_operators, timeout=timeout, context=context)
  File "/HPC_A/OF_ANSS/Users/me/pyAnsysEnv/lib/python3.7/site-packages/ansys/dpf/core/server_types.py", line 843, in __init__
    raise e
  File "/HPC_A/OF_ANSS/Users/me/pyAnsysEnv/lib/python3.7/site-packages/ansys/dpf/core/server_types.py", line 837, in __init__
    data_processing_core_load_api(path, "common")
  File "/HPC_A/OF_ANSS/Users/me/pyAnsysEnv/lib/python3.7/site-packages/ansys/dpf/gate/utils.py", line 13, in data_processing_core_load_api
    raise Exception(errorMsg.value)
Exception: Unable to load /HPC_A/system/eb/common/software/ANSYS/2022R2/v222/aisol/dll/linx64/libDataProcessingCore.so. Error is "/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /HPC_A/system/eb/common/software/ANSYS/2022R2/v222/aisol/dll/linx64/libDataProcessingCore.so)"

It may be that our IT folks have missed some environment variable when they set up the linux "module" for Ansys 2022. Though it is strange that it does find v18 then, since the linux module for that version is not loaded.
The "2022R2/v222" seems a bit double to me, but maybe that is done by our IT folks on purpose.

$ module list

Currently Loaded Modules:

  1. shared 2) DefaultModules 3) bla/bla/2.2.5 4) default-environment 5) ANSYS/2022R2
$ set |grep 2022
CMAKE_PREFIX_PATH=/HPC_A/system/eb/common/software/ANSYS/2022R2
EBDEVELANSYS=/HPC_A/system/eb/common/software/ANSYS/2022R2/easybuild/ANSYS-2022R2-easybuild-devel
EBROOTANSYS=/HPC_A/system/eb/common/software/ANSYS/2022R2
EBVERSIONANSYS=2022
ICEM_ACN=/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/icemcfd/linux64_amd
LD_LIBRARY_PATH=/cm/shared/apps/bla:/cm/shared/apps/bla/lib64:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/commonfiles/CPython/3_7/linx64/Release/python/lib
LOADEDMODULES=shared:DefaultModules:bla/bla/2.2.5:default-environment:ANSYS/2022R2
PATH=/HPC_A/system/eb/common/software/ANSYS/2022R2:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/fensapice/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/CEI/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/icemcfd/linux64_amd/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/Icepak/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/polyflow/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/TurboGrid/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/fluent/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/CFX/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/CFD-Post/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/autodyn/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/ansys/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/RSM/bin:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/aisol/bin/linx64:/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/Framework/bin/Linux64:/HPC_A/OF_ANSS/Users/me/pyAnsysEnv/bin:/cm/shared/apps/bla/current/sbin:/cm/shared/apps/bla/current/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/mssql-tools/bin:/HPC_A/OF_ANSS/Users/me/.local/bin:/HPC_A/OF_ANSS/Users/me/bin
_LMFILES_=/cm/local/modulefiles/shared:/usr/share/modulefiles/DefaultModules.lua:/cm/local/modulefiles/bla/bla/2.2.5:/cm/shared/modulefiles/default-environment:/HPC_A/system/eb/common/modules/all/ANSYS/2022R2.lua
__LMOD_REF_COUNT_CMAKE_PREFIX_PATH=/HPC_A/system/eb/common/software/ANSYS/2022R2:1
__LMOD_REF_COUNT_LOADEDMODULES='shared:1;DefaultModules:1;bla/bla/2.2.5:1;default-environment:1;ANSYS/2022R2:1'
__LMOD_REF_COUNT_PATH='/HPC_A/system/eb/common/software/ANSYS/2022R2:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/fensapice/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/CEI/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/icemcfd/linux64_amd/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/Icepak/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/polyflow/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/TurboGrid/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/fluent/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/CFX/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/CFD-Post/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/autodyn/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/ansys/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/RSM/bin:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/aisol/bin/linx64:1;/HPC_A/system/eb/common/software/ANSYS/2022R2/v222/Framework/bin/Linux64:1;/HPC_A/OF_ANSS/Users/me/pyAnsysEnv/bin:1;/cm/shared/apps/bla/current/sbin:1;/cm/shared/apps/bla/current/bin:1;/usr/local/bin:2;/usr/bin:2;/usr/local/sbin:2;/usr/sbin:2;/opt/mssql-tools/bin:1;/HPC_A/OF_ANSS/Users/me/.local/bin:1;/HPC_A/OF_ANSS/Users/me/bin:1'
__LMOD_REF_COUNT__LMFILES_='/cm/local/modulefiles/shared:1;/usr/share/modulefiles/DefaultModules.lua:1;/cm/local/modulefiles/bla/bla/2.2.5:1;/cm/shared/modulefiles/default-environment:1;/HPC_A/system/eb/common/modules/all/ANSYS/2022R2.lua:1'

@PProfizi
Copy link
Contributor

PProfizi commented Jan 9, 2023

@iceblink-ansys,

  • concerning the 2022R2/v222, yes it is redundant. I guess your IT made the 2022R2 folder but then Ansys does create the v222 folder during installation.
  • DPF can find v182 as the "latest" ansys install automatically if it is the latest situated in the default "usr/ansys_inc" or "/ansys_inc" folder on Linux, which does not seem to be the case for your 2022R2 install. Otherwise there might be an environment variable actually set for 182.
  • the new error tells me that: it found your 2022R2 install and is trying to start a server, yet one of the dependencies of DPF (/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20') is not found. My best guess is your gcc compiler/linux distribution is most likely too old or needs an update.

@PProfizi
Copy link
Contributor

Hi @iceblink-ansys,
coming back to you about this issue.
It seems I was halfway right for the third point explaining your second error:
the problem is most likely that for some reason, the loaded libstdc++.so.6 on which DPF depends is the one of your system instead of the one packaged with DPF. Your Linux distribution might be a bit old, thus the one coming from your system is incompatible with GLIBCXX_3.4.20.
One solution is to add export LD_PRELOAD=$FULL_PATH_TO_YOUR_222_INSTALLATION_FOLDER/tp/stdc++/libstdc++.so.6:$LD_PRELOAD to your .bashrc file and see if the error persists.

Another solution is to use, if you can, the new standalone version of the DPF server, as described here, which works like a Python library.

@iceblink-ansys
Copy link
Author

If you put it this way, maybe I know where this is coming from...
The problem might be that I have setup my PyAnsys Venv in a Windows setting, and I am then using that Venv from within Linux. Could that be an issue?

@PProfizi
Copy link
Contributor

@iceblink-ansys I am not sure I see how it could directly be related to the error at hand, yet to me venvs are not portable, so it might very well be a problem anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants