3 int MC_request_depend(smx_req_t r1, smx_req_t r2)
5 if (r1->issuer == r2->issuer)
8 if (r1->call == REQ_COMM_ISEND && r2->call == REQ_COMM_ISEND
9 && r1->comm_isend.rdv != r2->comm_isend.rdv)
12 if (r1->call == REQ_COMM_IRECV && r2->call == REQ_COMM_IRECV
13 && r1->comm_irecv.rdv != r2->comm_irecv.rdv)
16 if (r1->call == REQ_COMM_WAIT && r2->call == REQ_COMM_WAIT
17 && r1->comm_wait.comm == r2->comm_wait.comm)
20 if (r1->call == REQ_COMM_WAIT && r2->call == REQ_COMM_WAIT
21 && r1->comm_wait.comm->comm.src_buff != NULL
22 && r1->comm_wait.comm->comm.dst_buff != NULL
23 && r2->comm_wait.comm->comm.src_buff != NULL
24 && r2->comm_wait.comm->comm.dst_buff != NULL
25 && r1->comm_wait.comm->comm.dst_buff != r2->comm_wait.comm->comm.src_buff
26 && r1->comm_wait.comm->comm.dst_buff != r2->comm_wait.comm->comm.dst_buff
27 && r2->comm_wait.comm->comm.dst_buff != r1->comm_wait.comm->comm.src_buff)
30 if(r1->call == REQ_COMM_TEST &&
31 (r1->comm_test.comm == NULL
32 || r1->comm_test.comm->comm.src_buff == NULL
33 || r1->comm_test.comm->comm.dst_buff == NULL))
36 if(r2->call == REQ_COMM_TEST &&
37 (r2->comm_test.comm == NULL
38 || r2->comm_test.comm->comm.src_buff == NULL
39 || r2->comm_test.comm->comm.dst_buff == NULL))
42 if (r1->call == REQ_COMM_TEST && r2->call == REQ_COMM_WAIT
43 && r1->comm_test.comm == r2->comm_wait.comm)
46 if (r1->call == REQ_COMM_WAIT && r2->call == REQ_COMM_TEST
47 && r1->comm_wait.comm == r2->comm_test.comm)
53 char *MC_request_to_string(smx_req_t req)
55 char *type = NULL, *args = NULL, *str = NULL;
56 smx_action_t act = NULL;
61 type = bprintf("iSend");
62 args = bprintf("src=%s, buff=%p, size=%zu", req->issuer->name,
63 req->comm_isend.src_buff, req->comm_isend.src_buff_size);
66 size = req->comm_irecv.dst_buff_size ? *req->comm_irecv.dst_buff_size : 0;
67 type = bprintf("iRecv");
68 args = bprintf("dst=%s, buff=%p, size=%zu", req->issuer->name,
69 req->comm_irecv.dst_buff, size);
72 act = req->comm_wait.comm;
73 type = bprintf("Wait");
74 args = bprintf("%p [%s(%lu) -> %s(%lu)]", act,
75 act->comm.src_proc ? act->comm.src_proc->name : "",
76 act->comm.src_proc ? act->comm.src_proc->pid : 0,
77 act->comm.dst_proc ? act->comm.dst_proc->name : "",
78 act->comm.dst_proc ? act->comm.dst_proc->pid : 0);
81 act = req->comm_test.comm;
82 type = bprintf("Test");
83 args = bprintf("%p [%s -> %s]", act,
84 act->comm.src_proc ? act->comm.src_proc->name : "",
85 act->comm.dst_proc ? act->comm.dst_proc->name : "");
88 case REQ_COMM_WAITANY:
89 type = bprintf("WaitAny");
91 /* FIXME: improve output */
94 case REQ_COMM_TESTANY:
95 type = bprintf("TestAny");
97 /* FIXME: improve output */
104 str = bprintf("[(%lu)%s] %s (%s)", req->issuer->pid ,req->issuer->name, type, args);
110 unsigned int MC_request_testany_fail(smx_req_t req)
115 xbt_dynar_foreach(req->comm_testany.comms, cursor, action){
116 if(action->comm.src_proc && action->comm.dst_proc)