Skip to content

Commit 98bb3f0

Browse files
committed
leader: start execute_dump function
1 parent 8b8b44f commit 98bb3f0

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

src/network/leader.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,28 @@ void execute_write(struct leader_resources *l_r) {
396396
// MPI_Isend()
397397
}
398398

399+
void execute_dump(struct leader_resources *l_r) {
400+
struct data_address *d_a;
401+
d_a = peek_command(l_r->leader_command_queue);
402+
// 1 Get correct allocation (Handle notFound)
403+
size_t part_s = 0;
404+
struct allocation *c_a = give_for_v_address(l_r, d_a->address, &part_s);
405+
if (c_a == NULL) {
406+
debug("Seg Fault: requested dump to a not allocated address", l_r->id);
407+
return;
408+
}
409+
size_t a_size = size_of_allocation(c_a);
410+
char *dump = malloc(sizeof(char) * a_size);
411+
for (size_t i = 0; i < c_a->number_parts; i++) {
412+
struct block *b = c_a->parts[i];
413+
414+
}
415+
}
416+
417+
void execute_dump_all(struct leader_resources *l_r) {
418+
419+
}
420+
399421
void execute_command(struct leader_resources *l_r) {
400422
if (peek_user_command(l_r->leader_command_queue) != OP_NONE) {
401423

@@ -416,6 +438,12 @@ void execute_command(struct leader_resources *l_r) {
416438
execute_read(l_r);
417439
break;
418440
case OP_DUMP:
441+
debug("EXECUTE OP DUMP, LEADER", l_r->id);
442+
execute_dump(l_r);
443+
break;
444+
case OP_DUMP_ALL:
445+
debug("EXECUTE OP DUMP ALL, LEADER", l_r->id);
446+
execute_dump_all(l_r);
419447
break;
420448
case OP_SNAP:
421449
break;

0 commit comments

Comments
 (0)