X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/07c319ec54d6fc778ee3cc5e75a747242006723e..aea722d33a8fba9c4913c4378fc06e41f808c56f:/src/mc/mc_request.c diff --git a/src/mc/mc_request.c b/src/mc/mc_request.c index 147af343d5..fcc1d9c531 100644 --- a/src/mc/mc_request.c +++ b/src/mc/mc_request.c @@ -2,10 +2,7 @@ int MC_request_depend(smx_req_t r1, smx_req_t r2) { - if (r1->issuer == r2->issuer) - return FALSE; - - if (r1->call != r2->call) + if (r1->issuer == r2->issuer) return FALSE; if (r1->call == REQ_COMM_ISEND && r2->call == REQ_COMM_ISEND @@ -54,9 +51,11 @@ char *MC_request_to_string(smx_req_t req) case REQ_COMM_WAIT: act = req->comm_wait.comm; type = bprintf("Wait"); - args = bprintf("%p [%s -> %s]", act, + args = bprintf("%p [%s(%lu) -> %s(%lu)]", act, act->comm.src_proc ? act->comm.src_proc->name : "", - act->comm.dst_proc ? act->comm.dst_proc->name : ""); + act->comm.src_proc ? act->comm.src_proc->pid : 0, + act->comm.dst_proc ? act->comm.dst_proc->name : "", + act->comm.dst_proc ? act->comm.dst_proc->pid : 0); break; case REQ_COMM_TEST: act = req->comm_test.comm; @@ -65,11 +64,38 @@ char *MC_request_to_string(smx_req_t req) act->comm.src_proc ? act->comm.src_proc->name : "", act->comm.dst_proc ? act->comm.dst_proc->name : ""); break; + + case REQ_COMM_WAITANY: + type = bprintf("WaitAny"); + args = bprintf("-"); + /* FIXME: improve output */ + break; + + case REQ_COMM_TESTANY: + type = bprintf("TestAny"); + args = bprintf("-"); + /* FIXME: improve output */ + break; + default: THROW_UNIMPLEMENTED; } - str = bprintf("[%s] %s (%s)", req->issuer->name, type, args); + + str = bprintf("[(%lu)%s] %s (%s)", req->issuer->pid ,req->issuer->name, type, args); xbt_free(type); xbt_free(args); return str; -} \ No newline at end of file +} + +unsigned int MC_request_testany_fail(smx_req_t req) +{ + unsigned int cursor; + smx_action_t action; + + xbt_dynar_foreach(req->comm_testany.comms, cursor, action){ + if(action->comm.src_proc && action->comm.dst_proc) + return FALSE; + } + + return TRUE; +}