Skip to content

Commit 9c26cda

Browse files
authored
Merge pull request #7 from SidoShiro/dev
Dev into Master
2 parents 2d0f00d + 8d7ea96 commit 9c26cda

24 files changed

Lines changed: 525 additions & 25 deletions

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ project(DistributedMalloc)
88
find_package(MPI REQUIRED)
99

1010
# Vars with files for compilation
11-
set(SRCS src/main/main.c src/utils/utils.c src/cli/cli.c)
11+
set(SRCS src/main/main.c src/utils/utils.c src/cli/cli.c src/network/message.c src/network/block.c src/network/node.c src/utils/command_queue.c src/graph/graph.c)
12+
1213
include_directories("include/")
1314
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
1415

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,18 @@ mkdir build
1111
cd build
1212
cmake ..
1313
make
14-
./dmalloc [DOTFILE]
14+
mpirun --hostfile ../hostfile dmalloc [DOTFILE]
1515
```
1616

1717
In project directory:
1818

1919
```sh
2020
cmake .
2121
make
22-
./dmalloc [DOTFILE]
22+
mpirun --hostfile hostfile dmalloc [DOTFILE]
2323
```
2424

2525

26-
dmalloc usage :
27-
28-
```sh
29-
./dmalloc [DOTFILE]
30-
```
31-
3226
# Tooltips
3327

3428
* How to display a graph
@@ -88,4 +82,17 @@ dmalloc usage :
8882
| kill `id` | kill node refered by `id` |
8983
| revive `id` | revive `id` |
9084

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)
9198

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+
}

doc/user_commands.dot

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
digraph User_Command_Queue {
2+
3+
Command_1 [shape=box]
4+
Command_2 [shape=box]
5+
Command_3 [shape=box]
6+
Leader [shape=diamond]
7+
8+
Command_1 -> Command_2 -> Command_3;
9+
User -> Command_1;
10+
Command_3 -> Leader;
11+
}

hostfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
localhost slots=25

0 commit comments

Comments
 (0)