Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Flag global variables in mc_ignore as belonging to the MCer
[simgrid.git] / src / mc / mc_request.c
1 /* Copyright (c) 2008-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include "mc_request.h"
8 #include "mc_safety.h"
9 #include "mc_private.h"
10
11 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_request, mc,
12                                 "Logging specific to MC (request)");
13
14 static char *pointer_to_string(void *pointer);
15 static char *buff_size_to_string(size_t size);
16
17 int MC_request_depend(smx_simcall_t r1, smx_simcall_t r2)
18 {
19   if (mc_reduce_kind == e_mc_reduce_none)
20     return TRUE;
21
22   if (r1->issuer == r2->issuer)
23     return FALSE;
24
25   /* Wait with timeout transitions are not considered by the independance theorem, thus we consider them as dependant with all other transitions */
26   if ((r1->call == SIMCALL_COMM_WAIT && simcall_comm_wait__get__timeout(r1) > 0)
27       || (r2->call == SIMCALL_COMM_WAIT
28           && simcall_comm_wait__get__timeout(r2) > 0))
29     return TRUE;
30
31   if (r1->call == SIMCALL_COMM_ISEND && r2->call == SIMCALL_COMM_IRECV)
32     return FALSE;
33
34   if (r1->call == SIMCALL_COMM_IRECV && r2->call == SIMCALL_COMM_ISEND)
35     return FALSE;
36
37   if ((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
38       && r2->call == SIMCALL_COMM_WAIT) {
39
40     smx_rdv_t rdv =
41         r1->call ==
42         SIMCALL_COMM_ISEND ? simcall_comm_isend__get__rdv(r1) :
43         simcall_comm_irecv__get__rdv(r1);
44
45     if (rdv != simcall_comm_wait__get__comm(r2)->comm.rdv_cpy
46         && simcall_comm_wait__get__timeout(r2) <= 0)
47       return FALSE;
48
49     if ((r1->issuer != simcall_comm_wait__get__comm(r2)->comm.src_proc)
50         && (r1->issuer != simcall_comm_wait__get__comm(r2)->comm.dst_proc)
51         && simcall_comm_wait__get__timeout(r2) <= 0)
52       return FALSE;
53
54     if ((r1->call == SIMCALL_COMM_ISEND)
55         && (simcall_comm_wait__get__comm(r2)->comm.type == SIMIX_COMM_SEND)
56         && (simcall_comm_wait__get__comm(r2)->comm.src_buff !=
57             simcall_comm_isend__get__src_buff(r1))
58         && simcall_comm_wait__get__timeout(r2) <= 0)
59       return FALSE;
60
61     if ((r1->call == SIMCALL_COMM_IRECV)
62         && (simcall_comm_wait__get__comm(r2)->comm.type == SIMIX_COMM_RECEIVE)
63         && (simcall_comm_wait__get__comm(r2)->comm.dst_buff !=
64             simcall_comm_irecv__get__dst_buff(r1))
65         && simcall_comm_wait__get__timeout(r2) <= 0)
66       return FALSE;
67   }
68
69   if ((r2->call == SIMCALL_COMM_ISEND || r2->call == SIMCALL_COMM_IRECV)
70       && r1->call == SIMCALL_COMM_WAIT) {
71
72     smx_rdv_t rdv =
73         r2->call ==
74         SIMCALL_COMM_ISEND ? simcall_comm_isend__get__rdv(r2) :
75         simcall_comm_irecv__get__rdv(r2);
76
77     if (rdv != simcall_comm_wait__get__comm(r1)->comm.rdv_cpy
78         && simcall_comm_wait__get__timeout(r1) <= 0)
79       return FALSE;
80
81     if ((r2->issuer != simcall_comm_wait__get__comm(r1)->comm.src_proc)
82         && (r2->issuer != simcall_comm_wait__get__comm(r1)->comm.dst_proc)
83         && simcall_comm_wait__get__timeout(r1) <= 0)
84       return FALSE;
85
86     if ((r2->call == SIMCALL_COMM_ISEND)
87         && (simcall_comm_wait__get__comm(r1)->comm.type == SIMIX_COMM_SEND)
88         && (simcall_comm_wait__get__comm(r1)->comm.src_buff !=
89             simcall_comm_isend__get__src_buff(r2))
90         && simcall_comm_wait__get__timeout(r1) <= 0)
91       return FALSE;
92
93     if ((r2->call == SIMCALL_COMM_IRECV)
94         && (simcall_comm_wait__get__comm(r1)->comm.type == SIMIX_COMM_RECEIVE)
95         && (simcall_comm_wait__get__comm(r1)->comm.dst_buff !=
96             simcall_comm_irecv__get__dst_buff(r2))
97         && simcall_comm_wait__get__timeout(r1) <= 0)
98       return FALSE;
99   }
100
101   /* FIXME: the following rule assumes that the result of the
102    * isend/irecv call is not stored in a buffer used in the
103    * test call. */
104   /*if(   (r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
105      &&  r2->call == SIMCALL_COMM_TEST)
106      return FALSE; */
107
108   /* FIXME: the following rule assumes that the result of the
109    * isend/irecv call is not stored in a buffer used in the
110    * test call.*/
111   /*if(   (r2->call == SIMCALL_COMM_ISEND || r2->call == SIMCALL_COMM_IRECV)
112      && r1->call == SIMCALL_COMM_TEST)
113      return FALSE; */
114
115   if (r1->call == SIMCALL_COMM_ISEND && r2->call == SIMCALL_COMM_ISEND
116       && simcall_comm_isend__get__rdv(r1) != simcall_comm_isend__get__rdv(r2))
117     return FALSE;
118
119   if (r1->call == SIMCALL_COMM_IRECV && r2->call == SIMCALL_COMM_IRECV
120       && simcall_comm_irecv__get__rdv(r1) != simcall_comm_irecv__get__rdv(r2))
121     return FALSE;
122
123   if (r1->call == SIMCALL_COMM_WAIT
124       && (r2->call == SIMCALL_COMM_WAIT || r2->call == SIMCALL_COMM_TEST)
125       && (simcall_comm_wait__get__comm(r1)->comm.src_proc == NULL
126           || simcall_comm_wait__get__comm(r1)->comm.dst_proc == NULL))
127     return FALSE;
128
129   if (r2->call == SIMCALL_COMM_WAIT
130       && (r1->call == SIMCALL_COMM_WAIT || r1->call == SIMCALL_COMM_TEST)
131       && (simcall_comm_wait__get__comm(r2)->comm.src_proc == NULL
132           || simcall_comm_wait__get__comm(r2)->comm.dst_proc == NULL))
133     return FALSE;
134
135   if (r1->call == SIMCALL_COMM_WAIT && r2->call == SIMCALL_COMM_WAIT
136       && simcall_comm_wait__get__comm(r1)->comm.src_buff ==
137       simcall_comm_wait__get__comm(r2)->comm.src_buff
138       && simcall_comm_wait__get__comm(r1)->comm.dst_buff ==
139       simcall_comm_wait__get__comm(r2)->comm.dst_buff)
140     return FALSE;
141
142   if (r1->call == SIMCALL_COMM_WAIT && r2->call == SIMCALL_COMM_WAIT
143       && simcall_comm_wait__get__comm(r1)->comm.src_buff != NULL
144       && simcall_comm_wait__get__comm(r1)->comm.dst_buff != NULL
145       && simcall_comm_wait__get__comm(r2)->comm.src_buff != NULL
146       && simcall_comm_wait__get__comm(r2)->comm.dst_buff != NULL
147       && simcall_comm_wait__get__comm(r1)->comm.dst_buff !=
148       simcall_comm_wait__get__comm(r2)->comm.src_buff
149       && simcall_comm_wait__get__comm(r1)->comm.dst_buff !=
150       simcall_comm_wait__get__comm(r2)->comm.dst_buff
151       && simcall_comm_wait__get__comm(r2)->comm.dst_buff !=
152       simcall_comm_wait__get__comm(r1)->comm.src_buff)
153     return FALSE;
154
155   if (r1->call == SIMCALL_COMM_TEST &&
156       (simcall_comm_test__get__comm(r1) == NULL
157        || simcall_comm_test__get__comm(r1)->comm.src_buff == NULL
158        || simcall_comm_test__get__comm(r1)->comm.dst_buff == NULL))
159     return FALSE;
160
161   if (r2->call == SIMCALL_COMM_TEST &&
162       (simcall_comm_test__get__comm(r2) == NULL
163        || simcall_comm_test__get__comm(r2)->comm.src_buff == NULL
164        || simcall_comm_test__get__comm(r2)->comm.dst_buff == NULL))
165     return FALSE;
166
167   if (r1->call == SIMCALL_COMM_TEST && r2->call == SIMCALL_COMM_WAIT
168       && simcall_comm_test__get__comm(r1)->comm.src_buff ==
169       simcall_comm_wait__get__comm(r2)->comm.src_buff
170       && simcall_comm_test__get__comm(r1)->comm.dst_buff ==
171       simcall_comm_wait__get__comm(r2)->comm.dst_buff)
172     return FALSE;
173
174   if (r1->call == SIMCALL_COMM_WAIT && r2->call == SIMCALL_COMM_TEST
175       && simcall_comm_wait__get__comm(r1)->comm.src_buff ==
176       simcall_comm_test__get__comm(r2)->comm.src_buff
177       && simcall_comm_wait__get__comm(r1)->comm.dst_buff ==
178       simcall_comm_test__get__comm(r2)->comm.dst_buff)
179     return FALSE;
180
181   if (r1->call == SIMCALL_COMM_WAIT && r2->call == SIMCALL_COMM_TEST
182       && simcall_comm_wait__get__comm(r1)->comm.src_buff != NULL
183       && simcall_comm_wait__get__comm(r1)->comm.dst_buff != NULL
184       && simcall_comm_test__get__comm(r2)->comm.src_buff != NULL
185       && simcall_comm_test__get__comm(r2)->comm.dst_buff != NULL
186       && simcall_comm_wait__get__comm(r1)->comm.dst_buff !=
187       simcall_comm_test__get__comm(r2)->comm.src_buff
188       && simcall_comm_wait__get__comm(r1)->comm.dst_buff !=
189       simcall_comm_test__get__comm(r2)->comm.dst_buff
190       && simcall_comm_test__get__comm(r2)->comm.dst_buff !=
191       simcall_comm_wait__get__comm(r1)->comm.src_buff)
192     return FALSE;
193
194   if (r1->call == SIMCALL_COMM_TEST && r2->call == SIMCALL_COMM_WAIT
195       && simcall_comm_test__get__comm(r1)->comm.src_buff != NULL
196       && simcall_comm_test__get__comm(r1)->comm.dst_buff != NULL
197       && simcall_comm_wait__get__comm(r2)->comm.src_buff != NULL
198       && simcall_comm_wait__get__comm(r2)->comm.dst_buff != NULL
199       && simcall_comm_test__get__comm(r1)->comm.dst_buff !=
200       simcall_comm_wait__get__comm(r2)->comm.src_buff
201       && simcall_comm_test__get__comm(r1)->comm.dst_buff !=
202       simcall_comm_wait__get__comm(r2)->comm.dst_buff
203       && simcall_comm_wait__get__comm(r2)->comm.dst_buff !=
204       simcall_comm_test__get__comm(r1)->comm.src_buff)
205     return FALSE;
206
207
208   return TRUE;
209 }
210
211 static char *pointer_to_string(void *pointer)
212 {
213
214   if (XBT_LOG_ISENABLED(mc_request, xbt_log_priority_verbose))
215     return bprintf("%p", pointer);
216
217   return xbt_strdup("(verbose only)");
218 }
219
220 static char *buff_size_to_string(size_t buff_size)
221 {
222
223   if (XBT_LOG_ISENABLED(mc_request, xbt_log_priority_verbose))
224     return bprintf("%zu", buff_size);
225
226   return xbt_strdup("(verbose only)");
227 }
228
229
230 char *MC_request_to_string(smx_simcall_t req, int value)
231 {
232   char *type = NULL, *args = NULL, *str = NULL, *p = NULL, *bs = NULL;
233   smx_synchro_t act = NULL;
234   size_t size = 0;
235
236   switch (req->call) {
237   case SIMCALL_COMM_ISEND:
238     type = xbt_strdup("iSend");
239     p = pointer_to_string(simcall_comm_isend__get__src_buff(req));
240     bs = buff_size_to_string(simcall_comm_isend__get__src_buff_size(req));
241     if (req->issuer->smx_host)
242       args =
243           bprintf("src=(%lu)%s (%s), buff=%s, size=%s", req->issuer->pid,
244                   MSG_host_get_name(req->issuer->smx_host), req->issuer->name,
245                   p, bs);
246     else
247       args =
248           bprintf("src=(%lu)%s, buff=%s, size=%s", req->issuer->pid,
249                   req->issuer->name, p, bs);
250     break;
251   case SIMCALL_COMM_IRECV:
252     size =
253         simcall_comm_irecv__get__dst_buff_size(req) ?
254         *simcall_comm_irecv__get__dst_buff_size(req) : 0;
255     type = xbt_strdup("iRecv");
256     p = pointer_to_string(simcall_comm_irecv__get__dst_buff(req));
257     bs = buff_size_to_string(size);
258     if (req->issuer->smx_host)
259       args =
260           bprintf("dst=(%lu)%s (%s), buff=%s, size=%s", req->issuer->pid,
261                   MSG_host_get_name(req->issuer->smx_host), req->issuer->name,
262                   p, bs);
263     else
264       args =
265           bprintf("dst=(%lu)%s, buff=%s, size=%s", req->issuer->pid,
266                   req->issuer->name, p, bs);
267     break;
268   case SIMCALL_COMM_WAIT:
269     act = simcall_comm_wait__get__comm(req);
270     if (value == -1) {
271       type = xbt_strdup("WaitTimeout");
272       p = pointer_to_string(act);
273       args = bprintf("comm=%s", p);
274     } else {
275       type = xbt_strdup("Wait");
276       p = pointer_to_string(act);
277       args = bprintf("comm=%s [(%lu)%s (%s)-> (%lu)%s (%s)]", p,
278                      act->comm.src_proc ? act->comm.src_proc->pid : 0,
279                      act->comm.src_proc ? MSG_host_get_name(act->comm.src_proc->
280                                                             smx_host) : "",
281                      act->comm.src_proc ? act->comm.src_proc->name : "",
282                      act->comm.dst_proc ? act->comm.dst_proc->pid : 0,
283                      act->comm.dst_proc ? MSG_host_get_name(act->comm.dst_proc->
284                                                             smx_host) : "",
285                      act->comm.dst_proc ? act->comm.dst_proc->name : "");
286     }
287     break;
288   case SIMCALL_COMM_TEST:
289     act = simcall_comm_test__get__comm(req);
290     if (act->comm.src_proc == NULL || act->comm.dst_proc == NULL) {
291       type = xbt_strdup("Test FALSE");
292       p = pointer_to_string(act);
293       args = bprintf("comm=%s", p);
294     } else {
295       type = xbt_strdup("Test TRUE");
296       p = pointer_to_string(act);
297       args = bprintf("comm=%s [(%lu)%s (%s) -> (%lu)%s (%s)]", p,
298                      act->comm.src_proc->pid, act->comm.src_proc->name,
299                      MSG_host_get_name(act->comm.src_proc->smx_host),
300                      act->comm.dst_proc->pid, act->comm.dst_proc->name,
301                      MSG_host_get_name(act->comm.dst_proc->smx_host));
302     }
303     break;
304
305   case SIMCALL_COMM_WAITANY:
306     type = xbt_strdup("WaitAny");
307     if (!xbt_dynar_is_empty(simcall_comm_waitany__get__comms(req))) {
308       p = pointer_to_string(xbt_dynar_get_as
309                             (simcall_comm_waitany__get__comms(req), value,
310                              smx_synchro_t));
311       args =
312           bprintf("comm=%s (%d of %lu)", p, value + 1,
313                   xbt_dynar_length(simcall_comm_waitany__get__comms(req)));
314     } else {
315       args = bprintf("comm at idx %d", value);
316     }
317     break;
318
319   case SIMCALL_COMM_TESTANY:
320     if (value == -1) {
321       type = xbt_strdup("TestAny FALSE");
322       args = xbt_strdup("-");
323     } else {
324       type = xbt_strdup("TestAny");
325       args =
326           bprintf("(%d of %lu)", value + 1,
327                   xbt_dynar_length(simcall_comm_testany__get__comms(req)));
328     }
329     break;
330
331   case SIMCALL_MC_SNAPSHOT:
332     type = xbt_strdup("MC_SNAPSHOT");
333     args = NULL;
334     break;
335
336   case SIMCALL_MC_COMPARE_SNAPSHOTS:
337     type = xbt_strdup("MC_COMPARE_SNAPSHOTS");
338     args = NULL;
339     break;
340
341   case SIMCALL_MC_RANDOM:
342     type = xbt_strdup("MC_RANDOM");
343     args = bprintf("%d", value);
344     break;
345
346   default:
347     THROW_UNIMPLEMENTED;
348   }
349
350   if (args != NULL) {
351     str =
352         bprintf("[(%lu)%s (%s)] %s(%s)", req->issuer->pid,
353                 MSG_host_get_name(req->issuer->smx_host), req->issuer->name,
354                 type, args);
355   } else {
356     str =
357         bprintf("[(%lu)%s (%s)] %s ", req->issuer->pid,
358                 MSG_host_get_name(req->issuer->smx_host), req->issuer->name,
359                 type);
360   }
361
362   xbt_free(args);
363   xbt_free(type);
364   xbt_free(p);
365   xbt_free(bs);
366   return str;
367 }
368
369 unsigned int MC_request_testany_fail(smx_simcall_t req)
370 {
371   unsigned int cursor;
372   smx_synchro_t action;
373
374   xbt_dynar_foreach(simcall_comm_testany__get__comms(req), cursor, action) {
375     if (action->comm.src_proc && action->comm.dst_proc)
376       return FALSE;
377   }
378
379   return TRUE;
380 }
381
382 int MC_request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
383 {
384   smx_synchro_t act;
385
386   switch (req->call) {
387
388   case SIMCALL_COMM_WAIT:
389     /* FIXME: check also that src and dst processes are not suspended */
390     act = simcall_comm_wait__get__comm(req);
391     return (act->comm.src_proc && act->comm.dst_proc);
392     break;
393
394   case SIMCALL_COMM_WAITANY:
395     act =
396         xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), idx,
397                          smx_synchro_t);
398     return (act->comm.src_proc && act->comm.dst_proc);
399     break;
400
401   case SIMCALL_COMM_TESTANY:
402     act =
403         xbt_dynar_get_as(simcall_comm_testany__get__comms(req), idx,
404                          smx_synchro_t);
405     return (act->comm.src_proc && act->comm.dst_proc);
406     break;
407
408   default:
409     return TRUE;
410   }
411 }
412
413 int MC_process_is_enabled(smx_process_t process)
414 {
415   return MC_request_is_enabled(&process->simcall);
416 }
417
418 char *MC_request_get_dot_output(smx_simcall_t req, int value)
419 {
420
421   char *str = NULL, *label = NULL;
422   smx_synchro_t act = NULL;
423
424   switch (req->call) {
425   case SIMCALL_COMM_ISEND:
426     if (req->issuer->smx_host)
427       label =
428           bprintf("[(%lu)%s] iSend", req->issuer->pid,
429                   MSG_host_get_name(req->issuer->smx_host));
430     else
431       label = bprintf("[(%lu)] iSend", req->issuer->pid);
432     break;
433
434   case SIMCALL_COMM_IRECV:
435     if (req->issuer->smx_host)
436       label =
437           bprintf("[(%lu)%s] iRecv", req->issuer->pid,
438                   MSG_host_get_name(req->issuer->smx_host));
439     else
440       label = bprintf("[(%lu)] iRecv", req->issuer->pid);
441     break;
442
443   case SIMCALL_COMM_WAIT:
444     act = simcall_comm_wait__get__comm(req);
445     if (value == -1) {
446       if (req->issuer->smx_host)
447         label =
448             bprintf("[(%lu)%s] WaitTimeout", req->issuer->pid,
449                     MSG_host_get_name(req->issuer->smx_host));
450       else
451         label = bprintf("[(%lu)] WaitTimeout", req->issuer->pid);
452     } else {
453       if (req->issuer->smx_host)
454         label =
455             bprintf("[(%lu)%s] Wait [(%lu)->(%lu)]", req->issuer->pid,
456                     MSG_host_get_name(req->issuer->smx_host),
457                     act->comm.src_proc ? act->comm.src_proc->pid : 0,
458                     act->comm.dst_proc ? act->comm.dst_proc->pid : 0);
459       else
460         label =
461             bprintf("[(%lu)] Wait [(%lu)->(%lu)]", req->issuer->pid,
462                     act->comm.src_proc ? act->comm.src_proc->pid : 0,
463                     act->comm.dst_proc ? act->comm.dst_proc->pid : 0);
464     }
465     break;
466
467   case SIMCALL_COMM_TEST:
468     act = simcall_comm_test__get__comm(req);
469     if (act->comm.src_proc == NULL || act->comm.dst_proc == NULL) {
470       if (req->issuer->smx_host)
471         label =
472             bprintf("[(%lu)%s] Test FALSE", req->issuer->pid,
473                     MSG_host_get_name(req->issuer->smx_host));
474       else
475         label = bprintf("[(%lu)] Test FALSE", req->issuer->pid);
476     } else {
477       if (req->issuer->smx_host)
478         label =
479             bprintf("[(%lu)%s] Test TRUE", req->issuer->pid,
480                     MSG_host_get_name(req->issuer->smx_host));
481       else
482         label = bprintf("[(%lu)] Test TRUE", req->issuer->pid);
483     }
484     break;
485
486   case SIMCALL_COMM_WAITANY:
487     if (req->issuer->smx_host)
488       label =
489           bprintf("[(%lu)%s] WaitAny [%d of %lu]", req->issuer->pid,
490                   MSG_host_get_name(req->issuer->smx_host), value + 1,
491                   xbt_dynar_length(simcall_comm_waitany__get__comms(req)));
492     else
493       label =
494           bprintf("[(%lu)] WaitAny [%d of %lu]", req->issuer->pid, value + 1,
495                   xbt_dynar_length(simcall_comm_waitany__get__comms(req)));
496     break;
497
498   case SIMCALL_COMM_TESTANY:
499     if (value == -1) {
500       if (req->issuer->smx_host)
501         label =
502             bprintf("[(%lu)%s] TestAny FALSE", req->issuer->pid,
503                     MSG_host_get_name(req->issuer->smx_host));
504       else
505         label = bprintf("[(%lu)] TestAny FALSE", req->issuer->pid);
506     } else {
507       if (req->issuer->smx_host)
508         label =
509             bprintf("[(%lu)%s] TestAny TRUE [%d of %lu]", req->issuer->pid,
510                     MSG_host_get_name(req->issuer->smx_host), value + 1,
511                     xbt_dynar_length(simcall_comm_testany__get__comms(req)));
512       else
513         label =
514             bprintf("[(%lu)] TestAny TRUE [%d of %lu]", req->issuer->pid,
515                     value + 1,
516                     xbt_dynar_length(simcall_comm_testany__get__comms(req)));
517     }
518     break;
519
520   case SIMCALL_MC_RANDOM:
521     if (req->issuer->smx_host)
522       label =
523           bprintf("[(%lu)%s] MC_RANDOM (%d)", req->issuer->pid,
524                   MSG_host_get_name(req->issuer->smx_host), value);
525     else
526       label = bprintf("[(%lu)] MC_RANDOM (%d)", req->issuer->pid, value);
527     break;
528
529   case SIMCALL_MC_SNAPSHOT:
530     if (req->issuer->smx_host)
531       label =
532           bprintf("[(%lu)%s] MC_SNAPSHOT", req->issuer->pid,
533                   MSG_host_get_name(req->issuer->smx_host));
534     else
535       label = bprintf("[(%lu)] MC_SNAPSHOT", req->issuer->pid);
536     break;
537
538   case SIMCALL_MC_COMPARE_SNAPSHOTS:
539     if (req->issuer->smx_host)
540       label =
541           bprintf("[(%lu)%s] MC_COMPARE_SNAPSHOTS", req->issuer->pid,
542                   MSG_host_get_name(req->issuer->smx_host));
543     else
544       label = bprintf("[(%lu)] MC_COMPARE_SNAPSHOTS", req->issuer->pid);
545     break;
546
547   default:
548     THROW_UNIMPLEMENTED;
549   }
550
551   str =
552       bprintf("label = \"%s\", color = %s, fontcolor = %s", label,
553               colors[req->issuer->pid - 1], colors[req->issuer->pid - 1]);
554   xbt_free(label);
555   return str;
556
557 }