示例#1
0
    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)
示例#2
0
文件: base.py 项目: vincentlab/PyFR
    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)
示例#3
0
文件: base.py 项目: vavrines/PyFR
    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)
示例#4
0
文件: base.py 项目: vavrines/PyFR
 def __del__(self):
     if getattr(self, 'postactaid', None) is not None:
         prefork.wait(self.postactaid)
示例#5
0
 def __del__(self):
     if self.postactaid is not None:
         prefork.wait(self.postactaid)
示例#6
0
文件: base.py 项目: vincentlab/PyFR
 def __del__(self):
     if self.postactaid is not None:
         prefork.wait(self.postactaid)