|
7 | 7 | #include "debug.h" |
8 | 8 |
|
9 | 9 | int send_safe_message(struct message *m_send, struct queue *queue, int tag) { |
10 | | - debug("init send safe message", m_send->id_s); |
| 10 | + //debug("init send safe message", m_send->id_s); |
11 | 11 | MPI_Send(m_send, sizeof(struct message), MPI_BYTE, m_send->id_t, tag, MPI_COMM_WORLD); |
12 | 12 |
|
13 | 13 | struct message *m_recv = calloc(1, sizeof(struct message)); |
@@ -47,15 +47,15 @@ int send_safe_message(struct message *m_send, struct queue *queue, int tag) { |
47 | 47 | struct message *receive_message(struct queue *message_queue, int tag) { |
48 | 48 | struct message *m_recv = queue_pop(message_queue); |
49 | 49 | if (m_recv) { |
50 | | - debug("queue not empty", m_recv->id_t); |
| 50 | + //debug("queue not empty", m_recv->id_t); |
51 | 51 | return m_recv; |
52 | 52 | } |
53 | 53 | m_recv = calloc(1, sizeof(struct message)); |
54 | 54 | // What if m_recv->op = OP_ALIVE ? |
55 | 55 | MPI_Recv(m_recv, sizeof(struct message), MPI_BYTE, MPI_ANY_SOURCE, tag, MPI_COMM_WORLD, MPI_STATUS_IGNORE); |
56 | | - debug("queue empty, receive message", m_recv->id_t); |
| 56 | + //debug("queue empty, receive message", m_recv->id_t); |
57 | 57 | if (m_recv->need_callback) { |
58 | | - debug("send callback", m_recv->id_t); |
| 58 | + //debug("send callback", m_recv->id_t); |
59 | 59 | struct message *m_alive = generate_message_a(m_recv->id_t, m_recv->id_s, 0, 0, 0, OP_ALIVE, 0); |
60 | 60 | MPI_Send(m_alive, sizeof(struct message), MPI_BYTE, m_recv->id_s, tag, MPI_COMM_WORLD); |
61 | 61 | //printf("%u respond to %u %u with a %u __ \n", m_alive->id_s, status.MPI_SOURCE, m_alive->id_t, m_alive->op); |
|
0 commit comments