exit#
- Mapdl.exit(save=False, force=False, **kwargs)#
Exit MAPDL.
- Parameters:
Notes
If Mapdl didn’t start the instance, then MAPDL is kept alive unless
force=True.If
PYMAPDL_START_INSTANCEis set toFalse(generally set in remote testing or documentation build), then MAPDL is kept alive. Override this behavior withforce=Trueto always force exiting MAPDL regardless of your local environment.On every path where MAPDL itself is left running (the ones above, an instance that has already exited, or an instance built while
pymapdl.BUILDING_GALLERYis set), the client side of the connection — the gRPC channel and the PIPE-drainer threads — is still released, because closing a gRPC channel is a purely client-side operation that does not stop the MAPDL server. Callreconnect_to_mapdl()to build a fresh channel and resume driving the same MAPDL session.If
Mapdl.finish_job_on_exitis set toTrueand there is a valid JobID inMapdl.jobid, then the SLURM job will be canceled.Examples
>>> mapdl.exit()