X-Git-Url: https://vgcfreebox.myrthtech.pt/gitweb/ue-pp-terminationdetectionalgorithm.git/blobdiff_plain/0a57aa135aa37d96925e3a437e0690de0b13a9e4..df5d391823a04906ddacef09ad616a5025fd1b61:/util.c diff --git a/util.c b/util.c index f7fdbfa..abf567b 100644 --- a/util.c +++ b/util.c @@ -9,7 +9,6 @@ #include #include - // controls the output of debugging messages, set to 1 to have no // messages int QUIET = 0; @@ -51,30 +50,4 @@ void warn(char *format, ...) va_start (args, format); vfprintf(stderr, format, args); va_end (args); -} - -/* - Evaluates Rule C & D of Dijkstra-Scholten. Caller must already hold state_mutex! -*/ -static void try_resolve_tree(int my_id) -{ - if (state == PASSIVE_STATE && deficit == 0) - { - if (is_initiator) { - // Root is passive and deficit is 0 -> Global Termination! - return; - } - - if (parent != -1) - { - control_message_t sig = {0}; - // Send acknowledgment signal up the tree to our parent - MPI_Send(&sig, sizeof(control_message_t), MPI_BYTE, parent, - CONTROL_SIGNAL, MPI_COMM_WORLD); - - trace("%d: [CONTROL] Sent tree-signal to parent %d\n", my_id, parent); - parent = -1; // Detach from tree - - } - } } \ No newline at end of file