def _invoke_postaction(self, **kwargs): comm, rank, root = get_comm_rank_root() # If we have a post-action and are the root rank then fire it if rank == root and self.postact: # If a post-action is currently running then wait for it if self.postactaid is not None: prefork.wait(self.postactaid) # Prepare the command line cmdline = shlex.split(self.postact.format(**kwargs)) # Invoke if self.postactmode == 'blocking': prefork.call(cmdline) else: self.postactaid = prefork.call_async(cmdline)
def _invoke_postaction(self, **kwargs): comm, rank, root = get_comm_rank_root() # If we have a post-action and are the root rank then fire it if rank == root and self.postact: # If a post-action is currently running then wait for it if self.postactaid is not None: prefork.wait(self.postactaid) # Prepare the command line cmdline = shlex.split(self.postact.format(**kwargs)) # Invoke if self.postactmode == "blocking": prefork.call(cmdline) else: self.postactaid = prefork.call_async(cmdline)
def _invoke_postaction(self, intg, **kwargs): comm, rank, root = get_comm_rank_root() # If we have a post-action and are the root rank then fire it if rank == root and self.postact: # If a post-action is currently running then wait for it if self.postactaid is not None: prefork.wait(self.postactaid) # Prepare the command line cmdline = shlex.split(self.postact.format(**kwargs)) # Invoke if self.postactmode == 'blocking': # Store returning code of the post-action # If it is different from zero # request intg to abort the computation intg.abort |= bool(prefork.call(cmdline)) else: self.postactaid = prefork.call_async(cmdline)