Launcher#
Provides a module for launching Fluent.
This module supports both starting Fluent locally and connecting to a remote instance with gRPC.
Functions:
|
Connect to an existing Fluent server instance. |
|
Use the factory function to create a launcher for supported launch modes. |
|
Launch Fluent locally in server mode or connect to a running Fluent server instance. |
- ansys.fluent.core.launcher.launcher.connect_to_fluent(*, ip=None, port=None, address=None, cleanup_on_exit=False, start_transcript=True, server_info_file_name=None, password=None, allow_remote_host=False, certificates_folder=None, insecure_mode=False, start_watchdog=None, file_transfer_service=None)#
Connect to an existing Fluent server instance.
- Parameters:
- ip
str,optional IP address for connecting to an existing Fluent instance. The IP address defaults to
"127.0.0.1". You can also use the environment variablePYFLUENT_FLUENT_IP=<ip>to set this parameter. The explicit value ofiptakes precedence overPYFLUENT_FLUENT_IP=<ip>.- port
int,optional Port to listen on for an existing Fluent instance. You can use the environment variable
PYFLUENT_FLUENT_PORT=<port>to set a default value. The explicit value ofporttakes precedence overPYFLUENT_FLUENT_PORT=<port>.- address
str,optional Address for connecting to an existing Fluent instance. The address can be a TCP address of the form
<ip>:<port>or a Unix domain socket of the formunix:/<path>. The default isNone.- cleanup_on_exitbool,
optional Whether to shut down the connected Fluent session when PyFluent is exited, or the
exit()method is called on the session instance, or if the session instance becomes unreferenced. The default isFalse.- start_transcriptbool,
optional Whether to start streaming the Fluent transcript in the client. The default is
True. You can stop and start the streaming of the Fluent transcript subsequently via the method calls,transcript.start()andtranscript.stop()on the session object.- server_info_file_name: str
Path to server-info file written out by Fluent server. The default is
None. PyFluent uses the connection information in the file to connect to a running Fluent session.- password
str,optional Password to connect to existing Fluent instance.
- allow_remote_hostbool,
optional Whether to allow connecting to a remote Fluent instance.
- certificates_folder
str,optional Path to the folder containing TLS certificates for Fluent’s gRPC server.
- insecure_modebool,
optional If True, Fluent’s gRPC server will be connected in insecure mode without TLS. This mode is not recommended. For more details on the implications and usage of insecure mode, refer to the Fluent documentation.
- start_watchdog: bool, optional
When
cleanup_on_exitis True,start_watchdogdefaults to True, which means an independent watchdog process is run to ensure that any local Fluent connections are properly closed (or terminated if frozen) when Python process ends.- file_transfer_service
optional File transfer service. Uploads/downloads files to/from the server.
- ip
- Returns:
Union[Meshing,PureMeshing,Solver,SolverIcing]Session object.
- Raises:
ValueErrorRaised when neither certificates_folder nor insecure_mode are set while allow_remote_host is True. Raised when both certificates_folder and insecure_mode are set simultaneously. Raised when certificates_folder is set but allow_remote_host is False. Raised when insecure_mode is set but allow_remote_host is False.
- ansys.fluent.core.launcher.launcher.create_launcher(fluent_launch_mode=LaunchMode.STANDALONE, **kwargs)#
Use the factory function to create a launcher for supported launch modes.
- Parameters:
- fluent_launch_mode: LaunchMode
Supported Fluent launch modes. Options are
"LaunchMode.CONTAINER","LaunchMode.PIM","LaunchMode.SLURM", and"LaunchMode.STANDALONE". The default is"LaunchMode.STANDALONE".- kwargs
Any Keyword arguments.
- Returns
- ——-
- DockerLauncher | PIMLauncher | SlurmLauncher | StandaloneLauncher
Session launcher.
- Raises
- ——
- ValueError
If an unknown Fluent launch mode is passed.
- ansys.fluent.core.launcher.launcher.launch_fluent(*, product_version=None, dimension=Dimension.THREE, precision=Precision.DOUBLE, processor_count=None, journal_file_names=None, start_timeout=None, additional_arguments='', env=None, start_container=None, container_dict=None, dry_run=False, cleanup_on_exit=True, start_transcript=True, ui_mode=None, graphics_driver=None, case_file_name=None, case_data_file_name=None, lightweight_mode=None, mode=FluentMode.SOLVER, py=None, gpu=None, cwd=None, fluent_path=None, topy=None, start_watchdog=None, scheduler_options=None, file_transfer_service=None, use_docker_compose=False, use_podman_compose=False, certificates_folder=None, insecure_mode=False)#
Launch Fluent locally in server mode or connect to a running Fluent server instance.
- Returns:
Union[Meshing,PureMeshing,Solver,SolverIcing,tuple[str,str]]Session object or configuration dictionary if
dry_run = Truefor docker or a tuple of (fluent executable path, startup arguments) ifdry_run = Truefor standalone launch.
- Raises:
UnexpectedKeywordArgumentIf an unexpected keyword argument is provided.
ValueErrorIf both
use_docker_composeanduse_podman_composeare set toTrue.
Notes
Job scheduler environments such as SLURM, LSF, PBS, etc. allocates resources / compute nodes. The allocated machines and core counts are queried from the scheduler environment and passed to Fluent.
Deprecated since version v0.22.0: Argument ‘version’ is deprecated; use ‘dimension’ instead.
Deprecated since version v0.22.0: Argument ‘show_gui’ is deprecated; use ‘ui_mode’ instead.