Пример #1
0
 def do_checkpoint(self):
     """Add a new Checkpoint to this branch."""
     new_ckpt = Checkpoint()
     self.add_checkpoint(new_ckpt)
     self.set_current_checkpoint(new_ckpt)
     dmtcpmanager.checkpoint()
     fredutil.fred_info("Created checkpoint #%d." %
                        self.get_last_checkpoint().get_index())
Пример #2
0
 def do_checkpoint(self):
     """Add a new Checkpoint to this branch."""
     new_ckpt = Checkpoint()
     self.add_checkpoint(new_ckpt)
     self.set_current_checkpoint(new_ckpt)
     dmtcpmanager.checkpoint()
     #fredutil.fred_debug(
     #    "!! Sleeping after checkpoint (ptrace instability hack)")
     #time.sleep(1)
     fredutil.fred_info("Created checkpoint #%d." %
                        self.get_last_checkpoint().get_index())
     return self.get_last_checkpoint().get_index()
Пример #3
0
 def do_checkpoint(self):
     """Add a new Checkpoint to this branch."""
     new_ckpt = Checkpoint()
     self.add_checkpoint(new_ckpt)
     self.set_current_checkpoint(new_ckpt)
     dmtcpmanager.checkpoint()
     #fredutil.fred_debug(
     #    "!! Sleeping after checkpoint (ptrace instability hack)")
     #time.sleep(1)
     fredutil.fred_info("Created checkpoint #%d." %
                        self.get_last_checkpoint().get_index())
     return self.get_last_checkpoint().get_index()
Пример #4
0
 def switch_to_branch(self, s_name):
     """Switch to the named branch."""
     if not dmtcpmanager.branch_exists(s_name):
         fredutil.fred_error("Branch '%s' does not exist." % s_name)
         return
     for b in self.l_branches:
         if b.get_name() == s_name:
             self.branch = b
     dmtcpmanager.switch_branch(s_name)
     # Switching to branches always restarts in ckpt 0:
     self.branch.set_current_checkpoint(self.branch.get_checkpoint(0))
     self.update_state()
     fredutil.fred_info("Switched to branch '%s'." % s_name)
Пример #5
0
 def do_branch(self, s_name):
     """Create and switch to a new branch named s_name."""
     if dmtcpmanager.branch_exists(s_name):
         fredutil.fred_error("Branch '%s' already exists." % s_name)
         return
     self.branch = Branch(s_name)
     self.l_branches.append(self.branch)
     dmtcpmanager.create_branch(s_name)
     # Creating branches always creates ckpt 0:
     self.branch.add_checkpoint(Checkpoint(0))
     self.branch.set_current_checkpoint(self.branch.get_checkpoint(0))
     self.update_state()
     fredutil.fred_info("Now in new branch '%s'." % s_name)
Пример #6
0
 def switch_to_branch(self, s_name):
     """Switch to the named branch."""
     if not dmtcpmanager.branch_exists(s_name):
         fredutil.fred_error("Branch '%s' does not exist." % s_name)
         return
     for b in self.l_branches:
         if b.get_name() == s_name:
             self.branch = b
     dmtcpmanager.switch_branch(s_name)
     # Switching to branches always restarts in ckpt 0:
     self.branch.set_current_checkpoint(self.branch.get_checkpoint(0))
     self.update_state()
     fredutil.fred_info("Switched to branch '%s'." % s_name)
Пример #7
0
 def do_branch(self, s_name):
     """Create and switch to a new branch named s_name."""
     if dmtcpmanager.branch_exists(s_name):
         fredutil.fred_error("Branch '%s' already exists." % s_name)
         return
     self.branch = Branch(s_name)
     self.l_branches.append(self.branch)
     dmtcpmanager.create_branch(s_name)
     # Creating branches always creates ckpt 0:
     self.branch.add_checkpoint(Checkpoint(0))
     self.branch.set_current_checkpoint(self.branch.get_checkpoint(0))
     self.update_state()
     fredutil.fred_info("Now in new branch '%s'." % s_name)
Пример #8
0
def resume(s_fred_tmpdir, s_resume_dir):
    """Set up tmpdir structure from a given path."""
    global gn_index_suffix
    if not os.path.exists(s_resume_dir):
        fredutil.fred_fatal("Cannot resume: bad path %s." % s_resume_dir)
    fredutil.fred_info("Removing existing FReD temp dir at %s." % s_fred_tmpdir)
    shutil.rmtree(s_fred_tmpdir, ignore_errors=True)
    fredutil.fred_info(
        "Copying files for session resume. This could take a " "few minutes if the checkpoint images are large."
    )
    shutil.copytree(s_resume_dir, os.environ["DMTCP_TMPDIR"] + "-MASTER")
    os.symlink(os.environ["DMTCP_TMPDIR"] + "-MASTER", os.environ["DMTCP_TMPDIR"])
    fredutil.fred_info("Resuming session.")
    reset_checkpoint_indexing()
    restart(0)
Пример #9
0
def resume(s_fred_tmpdir, s_resume_dir):
    """Set up tmpdir structure from a given path."""
    global gn_index_suffix
    if not os.path.exists(s_resume_dir):
        fredutil.fred_fatal("Cannot resume: bad path %s." % s_resume_dir)
    fredutil.fred_info("Removing existing FReD temp dir at %s." %
                       s_fred_tmpdir)
    shutil.rmtree(s_fred_tmpdir, ignore_errors=True)
    fredutil.fred_info("Copying files for session resume. This could take a "
                       "few minutes if the checkpoint images are large.")
    shutil.copytree(s_resume_dir, os.environ["DMTCP_TMPDIR"] + "-MASTER")
    os.symlink(os.environ["DMTCP_TMPDIR"] + "-MASTER",
               os.environ["DMTCP_TMPDIR"])
    fredutil.fred_info("Resuming session.")
    reset_checkpoint_indexing()
    restart(0)