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)
33 char *MC_request_to_string(smx_req_t req)
35 char *type = NULL, *args = NULL, *str = NULL;
36 smx_action_t act = NULL;
41 type = bprintf("iSend");
42 args = bprintf("src=%s, buff=%p, size=%zu", req->issuer->name,
43 req->comm_isend.src_buff, req->comm_isend.src_buff_size);
46 size = req->comm_irecv.dst_buff_size ? *req->comm_irecv.dst_buff_size : 0;
47 type = bprintf("iRecv");
48 args = bprintf("dst=%s, buff=%p, size=%zu", req->issuer->name,
49 req->comm_irecv.dst_buff, size);
52 act = req->comm_wait.comm;
53 type = bprintf("Wait");
54 args = bprintf("%p [%s(%lu) -> %s(%lu)]", act,
55 act->comm.src_proc ? act->comm.src_proc->name : "",
56 act->comm.src_proc ? act->comm.src_proc->pid : 0,
57 act->comm.dst_proc ? act->comm.dst_proc->name : "",
58 act->comm.dst_proc ? act->comm.dst_proc->pid : 0);
61 act = req->comm_test.comm;
62 type = bprintf("Test");
63 args = bprintf("%p [%s -> %s]", act,
64 act->comm.src_proc ? act->comm.src_proc->name : "",
65 act->comm.dst_proc ? act->comm.dst_proc->name : "");
68 case REQ_COMM_WAITANY:
69 type = bprintf("WaitAny");
71 /* FIXME: improve output */
74 case REQ_COMM_TESTANY:
75 type = bprintf("TestAny");
77 /* FIXME: improve output */
84 str = bprintf("[(%lu)%s] %s (%s)", req->issuer->pid ,req->issuer->name, type, args);
90 unsigned int MC_request_testany_fail(smx_req_t req)
95 xbt_dynar_foreach(req->comm_testany.comms, cursor, action){
96 if(action->comm.src_proc && action->comm.dst_proc)