Logo AND Algorithmique Numérique Distribuée

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