ansys/pyfluent

Catching a server timeout

Opened this issue ยท 1 comments

๐Ÿ” Before submitting the issue

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

๐Ÿž Description of the bug

Hello, I'm running PyFluent on a SLURM HPC environment where the amount of Ansys HPC licenses is finite. It is very often that I'm not able to find licenses and my code terminates with the following output:

INFO:
Queuing for license HPC_PARALLEL has been initiated.
      The application will resume once the license is granted.
      Please use the lmutil lmstat utility to see who is currently using the license.

E1112 15:56:51.479564186  195523 server_chttp2.cc:40]        {"created":"@1731419811.479514442","description":"Only 1 addresses added out of total 
2resolved","file":"/home/staff/kkripa/tfsagent/_work/20/b/.conan/data/grpc_base/1.25.0/thirdparty/stable/build/1036933dfdff90461d4bf4154f59e6aa78392d87/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc","file_line":403,"referenced_errors":[{"created":"@1731419811.479495877","description":"Address family not supported by protocol","errno":97,"file":"/home/staff/kkripa/tfsagent/_work/20/b/.conan/data/grpc_base/1.25.0/thirdparty/stable/build/1036933dfdff90461d4bf4154f59e6aa78392d87/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc","file_line":395,"os_error":"Address family not supported by protocol","syscall":"socket","target_address":"[::1]:46831"}]}
Information: The server has started and is running.

Application is timed out, aborting ...

/mnt/apps/prebuilt/ansys/2023R2/ansys_inc/v232/fluent/fluent23.2.0/bin/fluent: line 2973: 195523 Aborted                 (core dumped) $NO_RUN $CORTEX_PRE $EXE -f $FLUENT_PROD $CX_FLAGS "$CX_FUNCTION"
pyfluent.general WARNING: Fluent Cortex properties unobtainable. 'force exit()' and othermethods are not going to work properly. Proceeding...

Is there a way (other than increasing the timeout to infinite) to catch this error, in order to re-launch FLUENT? I have tried the classic try/except but it seems that this error is internal.

๐Ÿ“ Steps to reproduce

Using:

        self.solver = pyfluent.launch_fluent(dimension=3, 
                                            precision='double', 
                                            mode="solver", 
                                            gpu=True, 
                                            processor_count=16, 
                                            ui_mode=gui, 
                                            additional_arguments="-gu -cflush", 
                                            cleanup_on_exit=True)

๐Ÿ’ป Which operating system are you using?

Linux

๐Ÿ“€ Which ANSYS version are you using?

ANSYS FLUENT 2023R2

PyFluent 0.21 (cannot really update right now)

๐Ÿ Which Python version are you using?

3.11

๐Ÿ“ฆ Installed packages

-

@christospliakos Please check if the following solution works.

  1. Set the environment variable PYFLUENT_WATCHDOG_EXCEPTION_ON_ERROR to 1.
  2. Catch LaunchFluentError from launch_fluent.
from ansys.fluent.core.launcher.error_handler import LaunchFluentError
try:
    solver = pyfluent.launch_fluent(...)  
except LaunchFluentError as ex:
    <relaunch code>