ansys / pyfluent

Pythonic interface to Ansys Fluent
https://fluent.docs.pyansys.com
MIT License
257 stars 41 forks source link

ServerInfo file empty, pyfluent slurm job, issue #1548 follow-up #2264

Open ClaraPicoron opened 10 months ago

ClaraPicoron commented 10 months ago

@dnwillia-work , the customer tested this:

import ansys.fluent.core as pyfluent
server_info_file = os.path.join(os.path.realpath('.'),"serverinfo")
solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None,start_instance=0, server_info_filepath=server_info_file )
solver.tui.file.read_case('test3.cas')
solver.solution.run_calculation.iterate(number_of_iterations=5000)

Unfortunately the serverinfo file is still not created with this error:

Traceback (most recent call last):
  File "/fscronos/work/fra/dtipd/dtipde/fs471c4n/PYANSYS/pyfluent.py", line 17, in <module>
    solver = pyfluent.launch_fluent(precision="double",  mode="solver", show_gui=None,start_instance=0, server_info_filepath=server_info_file )
  File "/home/fs471c4n/.local/lib/python3.9/site-packages/ansys/fluent/core/launcher/launcher.py", line 465, in launch_fluent
    ip, port, password = parse_server_info_file(server_info_filepath)
  File "/home/fs471c4n/.local/lib/python3.9/site-packages/ansys/fluent/core/session.py", line 26, in parse_server_info_file
    with open(filename, encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/fscronos/work/fra/dtipd/dtipde/fs471c4n/PYANSYS/serverinfo'
Failed to connect to bus: Connexion refusée

Originally posted by @ClaraPicoron in https://github.com/ansys/pyfluent/issues/1548#issuecomment-1782981923

ClaraPicoron commented 10 months ago

This is their Python configuration:

Python 3.9.7 ``` alabaster @ file:///home/ktietz/src/ci/alabaster_1611921544520/work anaconda-client @ file:///tmp/build/80754af9/anaconda-client_1635342557008/work anaconda-navigator==2.1.1 anaconda-project @ file:///tmp/build/80754af9/anaconda-project_1626085644852/work ansys-api-fluent==0.3.7 ansys-api-mapdl==0.5.1 ansys-api-meshing-prime==0.1.1 ansys-api-platform-instancemanagement==1.0.0b3 ansys-dpf-core==0.6.0 ansys-dpf-gate==0.2.1 ansys-dpf-gatebin==0.3.0 ansys-dpf-post==0.2.5 ansys-fluent-core==0.11.0 ansys-grantami-bomanalytics==1.0.1 ansys-grantami-bomanalytics-openapi==1.0.0 ansys-grpc-dpf==0.7.0 ansys-mapdl-core==0.63.2 ansys-mapdl-reader==0.52.0 ansys-meshing-prime==0.2.0 ansys-openapi-common==1.1.1 ansys-platform-instancemanagement==1.0.2 ansys-seascape==0.2.0 anyio @ file:///tmp/build/80754af9/anyio_1617783277988/work/dist appdirs==1.4.4 argh==0.26.2 argon2-cffi @ file:///tmp/build/80754af9/argon2-cffi_1613037499734/work arrow @ file:///tmp/build/80754af9/arrow_1617737686940/work asn1crypto @ file:///tmp/build/80754af9/asn1crypto_1596577642040/work astroid @ file:///tmp/build/80754af9/astroid_1628063140030/work astropy @ file:///tmp/build/80754af9/astropy_1629820331715/work async-generator @ file:///home/ktietz/src/ci/async_generator_1611927993394/work atomicwrites==1.4.0 attrs @ file:///tmp/build/80754af9/attrs_1620827162558/work autopep8 @ file:///tmp/build/80754af9/autopep8_1620866417880/work Babel @ file:///tmp/build/80754af9/babel_1620871417480/work backcall @ file:///home/ktietz/src/ci/backcall_1611930011877/work backports.functools-lru-cache @ file:///tmp/build/80754af9/backports.functools_lru_cache_1618170165463/work backports.shutil-get-terminal-size @ file:///tmp/build/80754af9/backports.shutil_get_terminal_size_1608222128777/work backports.tempfile @ file:///home/linux1/recipes/ci/backports.tempfile_1610991236607/work backports.weakref==1.0.post1 beautifulsoup4 @ file:///tmp/build/80754af9/beautifulsoup4_1631874778482/work binaryornot @ file:///tmp/build/80754af9/binaryornot_1617751525010/work bitarray @ file:///tmp/build/80754af9/bitarray_1629132848682/work bkcharts==0.2 black==19.10b0 bleach @ file:///tmp/build/80754af9/bleach_1628110601003/work bokeh @ file:///tmp/build/80754af9/bokeh_1635312808503/work boto==2.49.0 Bottleneck @ file:///tmp/build/80754af9/bottleneck_1607575130224/work brotlipy==0.7.0 cached-property @ file:///tmp/build/80754af9/cached-property_1600785575025/work cachetools==5.3.0 certifi==2022.12.7 cffi==1.15.0 chardet @ file:///tmp/build/80754af9/chardet_1607706775000/work charset-normalizer==3.0.1 click==8.0.3 cloudpickle @ file:///tmp/build/80754af9/cloudpickle_1632508026186/work clr-loader==0.2.5 clyent==1.2.2 colorama @ file:///tmp/build/80754af9/colorama_1607707115595/work conda==4.10.3 conda-build==3.21.5 conda-content-trust @ file:///tmp/build/80754af9/conda-content-trust_1617045594566/work conda-pack @ file:///tmp/build/80754af9/conda-pack_1611163042455/work conda-package-handling @ file:///tmp/build/80754af9/conda-package-handling_1618262147379/work conda-repo-cli @ file:///tmp/build/80754af9/conda-repo-cli_1620168426516/work conda-token @ file:///tmp/build/80754af9/conda-token_1620076980546/work conda-verify==3.4.2 contextlib2 @ file:///Users/ktietz/demo/mc3/conda-bld/contextlib2_1630668244042/work contourpy==1.0.7 cookiecutter @ file:///tmp/build/80754af9/cookiecutter_1617748928239/work cryptography==39.0.0 cycler==0.11.0 Cython @ file:///tmp/build/80754af9/cython_1636035166688/work cytoolz==0.11.0 daal4py==2021.3.0 dask==2021.10.0 debugpy @ file:///tmp/build/80754af9/debugpy_1629214122703/work decorator @ file:///tmp/build/80754af9/decorator_1632776554403/work defusedxml @ file:///tmp/build/80754af9/defusedxml_1615228127516/work diff-match-patch @ file:///Users/ktietz/demo/mc3/conda-bld/diff-match-patch_1630511840874/work distributed @ file:///tmp/build/80754af9/distributed_1635956221111/work distro==1.8.0 docutils @ file:///tmp/build/80754af9/docutils_1620827980776/work dotnetcore2==3.1.23 entrypoints==0.3 et-xmlfile==1.1.0 fastcache @ file:///tmp/build/80754af9/fastcache_1607571273717/work filelock @ file:///tmp/build/80754af9/filelock_1635402558181/work flake8 @ file:///tmp/build/80754af9/flake8_1620776156532/work Flask @ file:///home/ktietz/src/ci/flask_1611932660458/work fonttools==4.38.0 fsspec @ file:///tmp/build/80754af9/fsspec_1632413898837/work future @ file:///tmp/build/80754af9/future_1607571303524/work geomdl==5.3.1 gevent @ file:///tmp/build/80754af9/gevent_1628273270105/work glob2 @ file:///home/linux1/recipes/ci/glob2_1610991677669/work gmpy2==2.0.8 google-api-core==2.10.1 google-api-python-client==2.76.0 google-auth==2.16.0 google-auth-httplib2==0.1.0 googleapis-common-protos==1.56.4 greenlet @ file:///tmp/build/80754af9/greenlet_1628888132713/work grpcio==1.51.1 h5py==3.8.0 HeapDict @ file:///Users/ktietz/demo/mc3/conda-bld/heapdict_1630598515714/work html5lib @ file:///Users/ktietz/demo/mc3/conda-bld/html5lib_1629144453894/work httplib2==0.21.0 idna==3.4 imagecodecs @ file:///tmp/build/80754af9/imagecodecs_1635529108216/work imageio==2.25.0 imagesize @ file:///Users/ktietz/demo/mc3/conda-bld/imagesize_1628863108022/work importlib-metadata==6.0.0 inflection==0.5.1 iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work intervaltree @ file:///Users/ktietz/demo/mc3/conda-bld/intervaltree_1630511889664/work ipykernel @ file:///tmp/build/80754af9/ipykernel_1633534655931/work/dist/ipykernel-6.4.1-py3-none-any.whl ipython @ file:///tmp/build/80754af9/ipython_1635944169458/work ipython-genutils @ file:///tmp/build/80754af9/ipython_genutils_1606773439826/work ipywidgets @ file:///tmp/build/80754af9/ipywidgets_1634143127070/work isort @ file:///tmp/build/80754af9/isort_1628603791788/work itsdangerous @ file:///tmp/build/80754af9/itsdangerous_1621432558163/work jdcal @ file:///Users/ktietz/demo/mc3/conda-bld/jdcal_1630584345063/work jedi @ file:///tmp/build/80754af9/jedi_1611333729159/work jeepney @ file:///tmp/build/80754af9/jeepney_1627537048313/work Jinja2 @ file:///tmp/build/80754af9/jinja2_1612213139570/work jinja2-time @ file:///tmp/build/80754af9/jinja2-time_1617751524098/work joblib @ file:///tmp/build/80754af9/joblib_1635411271373/work json5 @ file:///tmp/build/80754af9/json5_1624432770122/work jsonschema @ file:///Users/ktietz/demo/mc3/conda-bld/jsonschema_1630511932244/work jupyter @ file:///tmp/build/80754af9/jupyter_1607700846274/work jupyter-client @ file:///tmp/build/80754af9/jupyter_client_1616770841739/work jupyter-console @ file:///tmp/build/80754af9/jupyter_console_1616615302928/work jupyter-core @ file:///tmp/build/80754af9/jupyter_core_1633420104186/work jupyter-server @ file:///tmp/build/80754af9/jupyter_server_1616084066671/work jupyterlab @ file:///tmp/build/80754af9/jupyterlab_1635799997693/work jupyterlab-pygments @ file:///tmp/build/80754af9/jupyterlab_pygments_1601490720602/work jupyterlab-server @ file:///tmp/build/80754af9/jupyterlab_server_1633419203660/work jupyterlab-widgets @ file:///tmp/build/80754af9/jupyterlab_widgets_1609884341231/work keyring @ file:///tmp/build/80754af9/keyring_1629321552962/work kiwisolver==1.4.4 lazy-object-proxy @ file:///tmp/build/80754af9/lazy-object-proxy_1616529027849/work libarchive-c @ file:///tmp/build/80754af9/python-libarchive-c_1617780486945/work llvmlite==0.37.0 locket==0.2.1 lxml @ file:///tmp/build/80754af9/lxml_1616443220035/work MarkupSafe @ file:///tmp/build/80754af9/markupsafe_1607027305082/work matplotlib==3.6.3 matplotlib-inline @ file:///tmp/build/80754af9/matplotlib-inline_1628242447089/work mccabe==0.6.1 mistune @ file:///tmp/build/80754af9/mistune_1607364877025/work mkl-fft==1.3.1 mkl-random @ file:///tmp/build/80754af9/mkl_random_1626186066731/work mkl-service==2.4.0 mock @ file:///tmp/build/80754af9/mock_1607622725907/work more-itertools @ file:///tmp/build/80754af9/more-itertools_1635423142362/work mpmath==1.2.1 msgpack @ file:///tmp/build/80754af9/msgpack-python_1612287166301/work multipledispatch @ file:///tmp/build/80754af9/multipledispatch_1607574243360/work munkres==1.1.4 mypy-extensions==0.4.3 navigator-updater==0.2.1 nbclassic @ file:///tmp/build/80754af9/nbclassic_1616085367084/work nbclient @ file:///tmp/build/80754af9/nbclient_1614364831625/work nbconvert @ file:///tmp/build/80754af9/nbconvert_1624472883256/work nbformat @ file:///tmp/build/80754af9/nbformat_1617383369282/work nest-asyncio @ file:///tmp/build/80754af9/nest-asyncio_1613680548246/work networkx @ file:///tmp/build/80754af9/networkx_1633639043937/work nltk==3.6.5 nose @ file:///tmp/build/80754af9/nose_1606773131901/work notebook @ file:///tmp/build/80754af9/notebook_1635411643303/work ntlm-auth==1.5.0 numba @ file:///tmp/build/80754af9/numba_1635174338764/work numexpr @ file:///tmp/build/80754af9/numexpr_1618856529730/work numpy==1.24.1 numpydoc @ file:///tmp/build/80754af9/numpydoc_1605117425582/work olefile @ file:///Users/ktietz/demo/mc3/conda-bld/olefile_1629805411829/work openpyxl @ file:///tmp/build/80754af9/openpyxl_1632777717936/work packaging==23.0 pandas==1.5.3 pandocfilters @ file:///tmp/build/80754af9/pandocfilters_1605120906940/work parso @ file:///tmp/build/80754af9/parso_1617223946239/work partd @ file:///tmp/build/80754af9/partd_1618000087440/work path @ file:///tmp/build/80754af9/path_1623603407737/work pathlib2 @ file:///tmp/build/80754af9/pathlib2_1625585682511/work pathspec==0.7.0 patsy==0.5.2 pep8==1.7.1 pexpect==4.8.0 pickleshare @ file:///tmp/build/80754af9/pickleshare_1606932040724/work Pillow==9.4.0 pkginfo==1.7.1 plotly @ file:///Users/nicolas/opt/miniconda3/envs/env/conda-bld/plotly_1640057722145/work/packages/python/plotly/dist/plotly-5.5.0.tar.gz pluggy @ file:///tmp/build/80754af9/pluggy_1615976318790/work plumbum==1.8.1 ply==3.11 pooch==1.6.0 poyo @ file:///tmp/build/80754af9/poyo_1617751526755/work prometheus-client @ file:///tmp/build/80754af9/prometheus_client_1623189609245/work prompt-toolkit @ file:///tmp/build/80754af9/prompt-toolkit_1633440160888/work protobuf==3.20.1 protoc-gen-swagger==0.1.0 psutil==5.9.4 ptyprocess==0.7.0 py @ file:///tmp/build/80754af9/py_1607971587848/work pyaedt==0.6.3 pyansys==2023.1.3 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycodestyle @ file:///tmp/build/80754af9/pycodestyle_1615748559966/work pycosat==0.6.3 pycparser==2.21 pycurl==7.44.1 pydocstyle @ file:///tmp/build/80754af9/pydocstyle_1621600989141/work pyerfa @ file:///tmp/build/80754af9/pyerfa_1621556109336/work pyflakes @ file:///tmp/build/80754af9/pyflakes_1617200973297/work pyfluent @ file:///software/fra/dtip/DTIPD/DTIPDE/TOOLS_ANSYS/pyfluent Pygments @ file:///tmp/build/80754af9/pygments_1629234116488/work pyiges==0.2.1 PyJWT @ file:///tmp/build/80754af9/pyjwt_1619682484438/work pylint @ file:///tmp/build/80754af9/pylint_1627536788603/work pyls-spyder==0.4.0 pyodbc===4.0.0-unsupported pyOpenSSL @ file:///tmp/build/80754af9/pyopenssl_1635333100036/work pyparsing==3.0.9 pyrsistent @ file:///tmp/build/80754af9/pyrsistent_1636110951836/work PySocks @ file:///tmp/build/80754af9/pysocks_1605305812635/work pytest==6.2.4 python-dateutil==2.8.2 python-lsp-black @ file:///tmp/build/80754af9/python-lsp-black_1634232156041/work python-lsp-jsonrpc==1.0.0 python-lsp-server==1.2.4 python-slugify @ file:///tmp/build/80754af9/python-slugify_1620405669636/work pythonnet==3.0.0rc6 pytwin==0.2.0 pytz==2022.7.1 pyvista==0.38.1 PyWavelets @ file:///tmp/build/80754af9/pywavelets_1607645421828/work pyxdg @ file:///tmp/build/80754af9/pyxdg_1603822279816/work PyYAML==6.0 pyzmq @ file:///tmp/build/80754af9/pyzmq_1628275385016/work QDarkStyle @ file:///tmp/build/80754af9/qdarkstyle_1617386714626/work qstylizer @ file:///tmp/build/80754af9/qstylizer_1617713584600/work/dist/qstylizer-0.1.10-py2.py3-none-any.whl QtAwesome @ file:///tmp/build/80754af9/qtawesome_1615991616277/work qtconsole @ file:///tmp/build/80754af9/qtconsole_1632739723211/work QtPy @ file:///tmp/build/80754af9/qtpy_1629397026935/work regex @ file:///tmp/build/80754af9/regex_1628063347754/work requests==2.28.2 requests-ntlm==1.1.0 rope @ file:///tmp/build/80754af9/rope_1623703006312/work rpyc==5.0.1 rsa==4.9 Rtree @ file:///tmp/build/80754af9/rtree_1618420843093/work ruamel-yaml-conda @ file:///tmp/build/80754af9/ruamel_yaml_1616016711199/work scikit-image==0.18.3 scikit-learn @ file:///tmp/build/80754af9/scikit-learn_1621370406642/work scikit-learn-intelex==2021.20210714.170444 scipy==1.10.0 scooby==0.7.1 seaborn @ file:///tmp/build/80754af9/seaborn_1629307859561/work SecretStorage @ file:///tmp/build/80754af9/secretstorage_1614022780358/work Send2Trash @ file:///tmp/build/80754af9/send2trash_1632406701022/work simplegeneric==0.8.1 singledispatch @ file:///tmp/build/80754af9/singledispatch_1629321204894/work sip==4.19.13 six==1.16.0 sniffio @ file:///tmp/build/80754af9/sniffio_1614030464178/work snowballstemmer @ file:///tmp/build/80754af9/snowballstemmer_1611258885636/work sortedcollections @ file:///tmp/build/80754af9/sortedcollections_1611172717284/work sortedcontainers @ file:///tmp/build/80754af9/sortedcontainers_1623949099177/work soupsieve @ file:///tmp/build/80754af9/soupsieve_1616183228191/work Sphinx==4.2.0 sphinxcontrib-applehelp @ file:///home/ktietz/src/ci/sphinxcontrib-applehelp_1611920841464/work sphinxcontrib-devhelp @ file:///home/ktietz/src/ci/sphinxcontrib-devhelp_1611920923094/work sphinxcontrib-htmlhelp @ file:///tmp/build/80754af9/sphinxcontrib-htmlhelp_1623945626792/work sphinxcontrib-jsmath @ file:///home/ktietz/src/ci/sphinxcontrib-jsmath_1611920942228/work sphinxcontrib-qthelp @ file:///home/ktietz/src/ci/sphinxcontrib-qthelp_1611921055322/work sphinxcontrib-serializinghtml @ file:///tmp/build/80754af9/sphinxcontrib-serializinghtml_1624451540180/work sphinxcontrib-websupport @ file:///tmp/build/80754af9/sphinxcontrib-websupport_1597081412696/work spyder @ file:///tmp/build/80754af9/spyder_1636479868270/work spyder-kernels @ file:///tmp/build/80754af9/spyder-kernels_1634236920897/work SQLAlchemy @ file:///tmp/build/80754af9/sqlalchemy_1626947882125/work statsmodels @ file:///tmp/build/80754af9/statsmodels_1614022848006/work sympy @ file:///tmp/build/80754af9/sympy_1635237064765/work tables @ file:///tmp/build/80754af9/pytables_1607975397488/work TBB==0.2 tblib @ file:///Users/ktietz/demo/mc3/conda-bld/tblib_1629402031467/work terminado==0.9.4 testpath @ file:///tmp/build/80754af9/testpath_1624638946665/work text-unidecode @ file:///Users/ktietz/demo/mc3/conda-bld/text-unidecode_1629401354553/work textdistance @ file:///tmp/build/80754af9/textdistance_1612461398012/work threadpoolctl @ file:///Users/ktietz/demo/mc3/conda-bld/threadpoolctl_1629802263681/work three-merge @ file:///tmp/build/80754af9/three-merge_1607553261110/work tifffile @ file:///tmp/build/80754af9/tifffile_1627275862826/work tinycss @ file:///tmp/build/80754af9/tinycss_1617713798712/work toml @ file:///tmp/build/80754af9/toml_1616166611790/work toolz @ file:///home/linux1/recipes/ci/toolz_1610987900194/work tornado @ file:///tmp/build/80754af9/tornado_1606942317143/work tqdm==4.64.1 traitlets @ file:///tmp/build/80754af9/traitlets_1632522747050/work typed-ast @ file:///tmp/build/80754af9/typed-ast_1624953673314/work typing-extensions @ file:///tmp/build/80754af9/typing_extensions_1631814937681/work ujson @ file:///tmp/build/80754af9/ujson_1611259520328/work unicodecsv==0.14.1 Unidecode @ file:///tmp/build/80754af9/unidecode_1614712377438/work uritemplate==4.1.1 urllib3==1.26.14 vtk==9.2.5 watchdog @ file:///tmp/build/80754af9/watchdog_1624954998138/work wcwidth @ file:///Users/ktietz/demo/mc3/conda-bld/wcwidth_1629357192024/work webencodings==0.5.1 Werkzeug @ file:///tmp/build/80754af9/werkzeug_1635505089296/work whichcraft @ file:///tmp/build/80754af9/whichcraft_1617751293875/work widgetsnbextension @ file:///tmp/build/80754af9/widgetsnbextension_1607531506226/work wrapt @ file:///tmp/build/80754af9/wrapt_1607574498026/work wurlitzer @ file:///tmp/build/80754af9/wurlitzer_1626947795674/work xlrd @ file:///tmp/build/80754af9/xlrd_1608072521494/work XlsxWriter @ file:///tmp/build/80754af9/xlsxwriter_1628603415431/work xlwt==1.3.0 xmltodict @ file:///Users/ktietz/demo/mc3/conda-bld/xmltodict_1629301980723/work yapf @ file:///tmp/build/80754af9/yapf_1615749224965/work zict==2.0.0 zipp==3.12.0 zope.event==4.5.0 zope.interface @ file:///tmp/build/80754af9/zope.interface_1625036153595/work ```
ClaraPicoron commented 8 months ago

Hello, has there been any progress on this issue ? Thank you.

raph-luc commented 8 months ago

I'm not aware of the full context of this issue, but there have been Slurm/HPC improvements in PyFluent:

As of version 0.18.2, if you manually launch Fluent in a Slurm environment using a command such as fluent 3ddp -scheduler=slurm -scheduler_queue=cdc01 -sifile=server-info.txt -t28

You will be able to connect PyFluent to that Fluent instance (after the Slurm job starts running), using for example:

solver = pyfluent.connect_to_fluent(   
    server_info_filepath="server-info.txt",
    cleanup_on_exit=True,
)

cleanup_on_exit = True used in this example so that when solver.exit() is called in PyFluent, Fluent will exit and release the HPC resources.

The improvements coming in PyFluent 0.19 will make it easier to launch Fluent in a Slurm queue using PyFluent, as shown in the link I shared above.

christospliakos commented 8 months ago

PyFluent 0.19 was released yesterday. Any updates on the way of launching Fluent in a Slurm queue?

dnwillia commented 7 months ago

@christospliakos You should be able to launch it as documented. I've replied in your issue #2351.

dnwillia commented 7 months ago

@ClaraPicoron The launch option does not look right to me if that's run within the SLURM system. start_instance=0 is passed which means that an instance must already be running. Can they try:

solver = pyfluent.launch_fluent(precision="double",  mode="solver" )

and then does the script run? They should not need to pass the server info file argument at all unless they have previously started the job.

Also, please have a look at my post from #1548. It's still not clear to me what the customer is trying to do.