Skip to content

Commit d43cf75

Browse files
authored
Merge pull request #38 from SidoShiro/dev
Submission
2 parents 9ed0821 + e304b67 commit d43cf75

23 files changed

Lines changed: 1960 additions & 295 deletions

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,23 @@ set(SRCS
2323
src/cli/user.c
2424
src/network/communication.c
2525
src/network/data_communication.c
26-
src/utils/queue.c)
26+
src/utils/queue.c src/network/leader_utils.c)
2727

2828

2929
set(MAIN src/main/main.c)
3030

3131
set(TEST_MAIN test/main_test.c)
3232

33+
set(FAILURE_DEMO src/demo/main_election_with_failures.c)
34+
3335

3436
include_directories("include/")
3537
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
3638

39+
3740
add_executable(dmalloc ${SRCS} ${MAIN} ${MPI_C_LIBRARIES})
3841

39-
include_directories("include/")
4042
add_executable(test_dmalloc ${SRCS} ${TEST_MAIN} ${MPI_C_LIBRARIES})
43+
44+
add_executable(failure_demo ${SRCS} ${FAILURE_DEMO} ${MPI_C_LIBRARIES})
45+

DEMO.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Demo
2+
3+
## P1
4+
5+
* Explications
6+
7+
* Utilisation classique
8+
* Caractères
9+
10+
## P2
11+
12+
* Images
13+
14+
* Stocker, la récrire dans un nouveau fichier + feh
15+
16+
* Stocker, modifier, récrire dans un nouveau fichier + feh
17+
18+
## P3
19+
20+
* Leader election
21+
* Kill Leader, New Leader
22+
23+
24+
## P4
25+
26+
* Etienne utilisé
27+

README.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,30 @@ default is 20.
3737

3838
# Todo
3939

40-
* command line
41-
* graph loading
42-
* from .dot (network and capacities of each node)
43-
* map generation
44-
* leader election
40+
* New features
41+
* Byzantine
42+
* Snap
43+
44+
## Command Line of dmalloc
45+
46+
dmalloc commands:
47+
48+
| **Command** | **Desc.** |
49+
| h | display all available commands with their description |
50+
| t | show table of allocations |
51+
| m `size` | return `address` to cmd user of the required allocation |
52+
| f `address` | free address, Warning if already free |
53+
| w `address` `datasize` `data` | write at the address the data of size datasize |
54+
| w `address` `file` | write all content of file at address |
55+
| w `address` `file` `datasize` | write datasize bytes from file to the address |
56+
| r `address` `datasize` | read datasize bytes at address |
57+
| r `address` `file` | read all bytes of the block at address into file |
58+
| r `address` `file` `datasize` | read datasize bytes at address into file |
59+
| d `address` | dump in as text all data of the block stored in address |
60+
| d net | dump all allocation |
61+
| kill `node_id` | kill node refered by `id` |
62+
| revive `node_id` | revive `id` |
63+
4564

4665
## Important structs/classes
4766

@@ -76,22 +95,6 @@ default is 20.
7695
* size
7796
* id (the machine containing this address)
7897

79-
## Command Line
80-
81-
| **Command** | **Desc.** |
82-
|-----------------------------------|---------------------------------------------------------|
83-
| h | display all available commands with their description |
84-
| m `size` | return `address` to cmd user of the required allocation |
85-
| f `address` | free address, Warning if already free |
86-
| w `address` `datasize` `data` | write at the address the data of size datasize |
87-
| r `address` `datasize` | read datasize bytes at address |
88-
| d `address` | dump in as text all data of the block stored in address |
89-
| d `address` `file` | dump address data in file |
90-
| snap | give user a snap of the network (print) |
91-
| snap `file` | same as snap but stored in file |
92-
| dnet | write a .dot file of the network |
93-
| kill `id` | kill node refered by `id` |
94-
| revive `id` | revive `id` |
9598

9699
## Node Life Cycles
97100

demo/HarryPotterWiki

Lines changed: 1084 additions & 0 deletions
Large diffs are not rendered by default.

demo/ferrari.jpg

98.5 KB
Loading

demo/loi1901

Lines changed: 330 additions & 0 deletions
Large diffs are not rendered by default.

demo/tank.jpg

9.39 KB
Loading

hostfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
localhost slots=25
1+
localhost slots=1000

include/communication.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define TAG_MSG 3
1212
#define TAG_DATA 4
1313
#define TAG_ELECTION 5
14+
#define TAG_REVIVE 6
1415

1516
/*
1617
* Send the given message 'm' to the destination node

include/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef DISTRIBUTEDMALLOC_GLOBALS_H
22
#define DISTRIBUTEDMALLOC_GLOBALS_H
33

4-
#define DEF_NODE_SIZE 128
4+
#define DEF_NODE_SIZE 10000
55
#define DEF_NODE_USER 0
66
#define DEF_NODE_LEADER 1
77

0 commit comments

Comments
 (0)