If a client connected to i-PI dies during runtime, the default behavior of i-PI is that it removes the client from the client list and uses the remaining clients. To achieve the alternative behavior that i-PI quits if one client dies, how would you recommend to implement it?
If in the file sockets.py I try to import the softexit object of the ipi.utils.softexit module and then trigger a softexit, i-PI quits indeed but rather disgracefully:
Exception in thread poll_cp2k:
Traceback (most recent call last):
File ".../anaconda2/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File ".../anaconda2/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File ".../ipi/engine/forcefields.py", line 161, in _poll_loop
self.poll()
File ".../ipi/engine/forcefields.py", line 255, in poll
self.socket.poll()
File ".../ipi/interfaces/sockets.py", line 676, in poll
self.pool_update()
File ".../ipi/interfaces/sockets.py", line 496, in pool_update
softexit.trigger("Error: One client has died unexpectedly. Exiting i-PI...")
File ".../ipi/utils/softexit.py", line 89, in trigger
f()
File ".../ipi/engine/forcefields.py", line 214, in softexit
self.stop()
File ".../ipi/engine/forcefields.py", line 269, in stop
self._thread.join()
File ".../anaconda2/lib/python2.7/threading.py", line 931, in join
raise RuntimeError("cannot join current thread")
RuntimeError: cannot join current thread
If a client connected to i-PI dies during runtime, the default behavior of i-PI is that it removes the client from the client list and uses the remaining clients. To achieve the alternative behavior that i-PI quits if one client dies, how would you recommend to implement it?
If in the file sockets.py I try to import the softexit object of the ipi.utils.softexit module and then trigger a softexit, i-PI quits indeed but rather disgracefully: