File: restore_cwd_filepaths.txt

package info (click to toggle)
dmtcp 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,496 kB
  • sloc: cpp: 33,592; ansic: 28,099; sh: 6,735; makefile: 1,950; perl: 1,690; python: 1,241; asm: 138; java: 13
file content (57 lines) | stat: -rw-r--r-- 2,774 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
## The initial draft of this writeup was provided by Joshua Louie.

Restoring CWD and files on restart:
==================================

Key:
InitWD - Work directory process started in
CkptWD - Work directory process was in when checkpoint occurred
FilePath - Absolute path to a file
RestoreWD - Work directory process is restored in

Example:
InitWD - /tmp/init_wd
CkptWD - /tmp/init_wd/subdir
FilePath1 - /tmp/init_wd/file1
FilePath2 - /tmp/somewhere/file2
RestoreWD - /tmp/restore_wd

A. Restore CWD: (Implemented in 2.1)
====================================

-+------------------------------------------------------------------------------
#| Steps                                    | Example
-+------------------------------------------------------------------------------
1| Determine relative relationship between  | ./subdir
 | InitWD and CkptWD                        |
++------------------------------------------+-----------------------------------
2| Attempt to cd to relative relationship   | cd ./subdir (Should
 | get us to /tmp/restore_wd/subdir)        |
-+------------------------------------------+-----------------------------------
3| If #2 fails, go to CkptWD                | cd /tmp/init_wd/subdir
-+------------------------------------------+-----------------------------------


B. Determine filepaths: (Partially implementation in 2.1)
=========================================================

-+------------------------------------------------------------------------------
#| Steps                                    | Example
-+------------------------------------------------------------------------------
1| Determine relative relationship between  | ../file1
 | CkptWD and FilePath1, assuming FilePath1 |
 | is located within InitWD                 |
-+------------------------------------------+-----------------------------------
2| Attempt to open FilePath1                | fopen("../file1", ...);
-+------------------------------------------+-----------------------------------
3| If #2 fails, try absolute path of        | fopen("/tmp/init_wd/file1",...)
 | FilePath1
-+------------------------------------------+-----------------------------------
4| If #2 and #3 fails, then error out       |
-+------------------------------------------+-----------------------------------
5| Determine relative relationship between  | /tmp/somewhere/file2
 | CkptWD and FilePath2, assuming FilePath2 | (Because file2 is not located
 | is located within InitWD                 |  within /tmp/init_wd)
-+------------------------------------------+-----------------------------------
6| Attempt to open FilePath2                | fopen("/tmp/somewhere/file2", ...)
-+------------------------------------------+-----------------------------------