ansys.mapdl.core.cli.stop.stop#

ansys.mapdl.core.cli.stop.stop(port=None, pid=None, all=False)#

Stop MAPDL instances running on a given port or with a given process ID.

When neither port nor pid is given, the instance running on port 50052 is stopped.

Parameters:
portint, optional

Port where the MAPDL instance to stop is running.

pidint, optional

Process ID of the MAPDL instance to stop. The whole process tree is stopped, children first.

allbool, default: False

Whether to stop every MAPDL instance owned by the current user, regardless of its port or process ID. Takes precedence over port and pid.

Returns:
list of int

Process IDs of the instances that have been stopped. An empty list means that no matching instance was found or that none could be killed.

Raises:
TypeError

When pid is given but is not an int.

Return type:

List[int]

Examples

Stop the instance running on the default port:

>>> from ansys.mapdl.core.launcher.connection import stop
>>> stop()
[23644]

Stop every running instance:

>>> stop(all=True)
[23644, 23645]