Skip to content

Commit ab18fb2

Browse files
authored
Merge pull request #3 from SidoShiro/doc-README
Add README Node cycle drafts
2 parents 045685d + e817629 commit ab18fb2

7 files changed

Lines changed: 83 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,17 @@ mpirun --hostfile hostfile dmalloc [DOTFILE]
8282
| kill `id` | kill node refered by `id` |
8383
| revive `id` | revive `id` |
8484

85+
## Node Life Cycles
86+
87+
### Node Leader Elections
88+
89+
![Graph leader election](doc/node_election.png)
90+
91+
### Node Leader Cycle
92+
93+
![Graph leader cycle](doc/node_leader_proc.png)
94+
95+
### Node Cycle
96+
97+
![Graph leader election](doc/node_proc.png)
8598

doc/node_election.png

15.6 KB
Loading

doc/node_leader.dot

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
digraph Leader {
2+
is_now_leader -> Send_LEADER_to_USER -> Idle;
3+
Idle -> Idle;
4+
Idle -> USER_WRITE;
5+
Idle -> USER_READ;
6+
Idle -> USER_SNAP;
7+
Idle -> USER_MALLOC;
8+
Idle -> USER_FREE;
9+
Idle -> USER_DUMP;
10+
USER_DUMP -> USER_READ;
11+
Idle -> USER_KILL;
12+
Idle -> USER_REVIVE;
13+
USER_WRITE -> Send_WRITE -> Recv_OK_write -> Send_WRITE_DATA;
14+
USER_READ -> Send_READ -> Recv_OK_read -> Recv_READ_DATA;
15+
}

doc/node_leader_proc.png

109 KB
Loading

doc/node_proc.png

274 KB
Loading

doc/node_process.dot

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
digraph NodeProcess {
2+
Idle -> Idle;
3+
Idle -> Recv_WRITE;
4+
Recv_WRITE -> id_op_is_id_op_write;
5+
id_op_is_id_op_write -> Send_OK_write;
6+
Send_OK_write -> Recv_WRITE_DATA;
7+
Recv_WRITE_DATA -> id_op_is_id_op_write;
8+
id_op_is_id_op_write -> Idle;
9+
Recv_WRITE -> id_op_is_not_id_op_write;
10+
id_op_is_not_id_op_write -> Send_WRITE;
11+
Send_WRITE -> Recv_OK_write;
12+
Recv_OK_write -> Send_OK_write;
13+
Recv_WRITE_DATA -> id_op_is_not_id_op_write;
14+
id_op_is_not_id_op_write -> Send_WRITE_DATA;
15+
Send_WRITE_DATA -> Idle;
16+
Idle -> Recv_READ;
17+
Recv_READ -> id_op_is_id_op_read;
18+
id_op_is_id_op_read -> Send_OK_read;
19+
Send_OK_read -> Send_READ_DATA;
20+
Send_READ_DATA -> Idle;
21+
Recv_READ -> id_op_is_not_id_op_read;
22+
id_op_is_not_id_op_read -> Send_READ;
23+
Send_READ -> Recv_OK_read;
24+
Recv_OK_read -> Recv_READ_DATA;
25+
Recv_READ_DATA -> Send_OK_read;
26+
Idle -> Recv_DIE;
27+
Recv_DIE -> id_op_is_id_op_die;
28+
id_op_is_id_op_die -> DIE;
29+
Recv_DIE -> id_op_is_not_id_op_die;
30+
id_op_is_not_id_op_die -> Send_DIE;
31+
Send_DIE -> Idle;
32+
Idle -> Recv_REVIVE;
33+
Recv_REVIVE -> id_op_is_id_op_revive;
34+
id_op_is_id_op_revive -> Send_WARNING;
35+
Send_WARNING -> Idle;
36+
Recv_REVIVE -> id_op_is_not_id_op_revive;
37+
id_op_is_not_id_op_revive -> Send_REVIVE;
38+
Send_REVIVE -> Idle;
39+
DIE -> Recv_REVIVE_on_dead;
40+
Recv_REVIVE_on_dead -> Idle;
41+
Idle -> Recv_SNAP;
42+
Recv_SNAP -> id_op_is_id_op_snap;
43+
id_op_is_id_op_snap -> Send_OK_snap;
44+
Recv_SNAP -> id_op_is_not_id_op_snap;
45+
id_op_is_not_id_op_snap -> Send_SNAP;
46+
Send_SNAP -> Recv_OK_snap;
47+
Recv_OK_snap -> Recv_SNAP_DATA;
48+
Recv_SNAP_DATA -> Send_OK_snap;
49+
Send_OK_snap -> Send_SNAP_DATA;
50+
Send_SNAP_DATA -> Idle;
51+
}

doc/node_start.dot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
digraph NodeStart {
2+
NodeInit -> Send_LEADER;
3+
Send_LEADER -> Recv_LEADER;
4+
}

0 commit comments

Comments
 (0)