-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mapdl.exit
can be slow
#3514
Comments
Things to consider: https://stackoverflow.com/questions/21053380/what-does-del-do-exactly Having multiple references to MAPDL itself might be a performance penalty and might avoid killing MAPDL on time.
|
Removing: try:
self.exit(force=True)
except Exception as e:
pass
# Adding super call per:
# https://docs.python.org/3/reference/datamodel.html#object.__del__
try:
super().__del__()
except Exception as e:
pass to speed up the deletion from #3497. |
More stuff to consider later: @patch("ansys.mapdl.core.Mapdl.__init__", lambda *args, **kwargs: None)
def test_delete_mapdl_object():
mapdl_b = pymapdl.Mapdl()
mapdl_b._mapdl_on_hpc = True
with patch("ansys.mapdl.core.mapdl_grpc.MapdlGrpc.kill_job") as mock_exit:
del mapdl_b
mock_exit.assert_called_once() |
Related to #3462 |
I detected this while running on dev container. This method has become quite hacky. I should probably have a look at it eventually.
The text was updated successfully, but these errors were encountered: