Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix MC with the class-hierarchification of simgrid::simix::Synchro
[simgrid.git] / src / mc / mc_request.cpp
1 /* Copyright (c) 2008-2015. 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 <cassert>
8
9 #include <xbt/log.h>
10 #include <xbt/str.h>
11 #include <xbt/sysdep.h>
12 #include <xbt/dynar.h>
13 #include <xbt/swag.h>
14
15 #include "src/mc/mc_request.h"
16 #include "src/mc/mc_safety.h"
17 #include "src/mc/mc_private.h"
18 #include "src/mc/mc_smx.h"
19 #include "src/mc/mc_xbt.hpp"
20
21 using simgrid::mc::remote;
22
23 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_request, mc,
24                                 "Logging specific to MC (request)");
25
26 static char *pointer_to_string(void *pointer);
27 static char *buff_size_to_string(size_t size);
28
29 static inline
30 simgrid::simix::Comm* MC_get_comm(smx_simcall_t r)
31 {
32   switch (r->call ) {
33   case SIMCALL_COMM_WAIT:
34     return static_cast<simgrid::simix::Comm*>(simcall_comm_wait__get__comm(r));
35   case SIMCALL_COMM_TEST:
36     return static_cast<simgrid::simix::Comm*>(simcall_comm_test__get__comm(r));
37   default:
38     return nullptr;
39   }
40 }
41
42 static inline
43 smx_mailbox_t MC_get_mbox(smx_simcall_t r)
44 {
45   switch(r->call) {
46   case SIMCALL_COMM_ISEND:
47     return simcall_comm_isend__get__mbox(r);
48   case SIMCALL_COMM_IRECV:
49     return simcall_comm_irecv__get__mbox(r);
50   default:
51     return nullptr;
52   }
53 }
54
55 namespace simgrid {
56 namespace mc {
57
58 // Does half the job
59 static inline
60 bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2)
61 {
62   if (r1->call == SIMCALL_COMM_ISEND && r2->call == SIMCALL_COMM_IRECV)
63     return false;
64
65   if (r1->call == SIMCALL_COMM_IRECV && r2->call == SIMCALL_COMM_ISEND)
66     return false;
67
68   // Those are internal requests, we do not need indirection
69   // because those objects are copies:
70   simgrid::simix::Comm* synchro1 = MC_get_comm(r1);
71   simgrid::simix::Comm* synchro2 = MC_get_comm(r2);
72
73   if ((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
74       && r2->call == SIMCALL_COMM_WAIT) {
75
76     smx_mailbox_t mbox = MC_get_mbox(r1);
77
78     if (mbox != synchro2->mbox_cpy
79         && simcall_comm_wait__get__timeout(r2) <= 0)
80       return false;
81
82     if ((r1->issuer != synchro2->src_proc)
83         && (r1->issuer != synchro2->dst_proc)
84         && simcall_comm_wait__get__timeout(r2) <= 0)
85       return false;
86
87     if ((r1->call == SIMCALL_COMM_ISEND)
88         && (synchro2->type == SIMIX_COMM_SEND)
89         && (synchro2->src_buff !=
90             simcall_comm_isend__get__src_buff(r1))
91         && simcall_comm_wait__get__timeout(r2) <= 0)
92       return false;
93
94     if ((r1->call == SIMCALL_COMM_IRECV)
95         && (synchro2->type == SIMIX_COMM_RECEIVE)
96         && (synchro2->dst_buff != simcall_comm_irecv__get__dst_buff(r1))
97         && simcall_comm_wait__get__timeout(r2) <= 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 0
105   if((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
106      &&  r2->call == SIMCALL_COMM_TEST)
107      return FALSE;
108 #endif
109
110   if (r1->call == SIMCALL_COMM_WAIT
111       && (r2->call == SIMCALL_COMM_WAIT || r2->call == SIMCALL_COMM_TEST)
112       && (synchro1->src_proc == nullptr || synchro1->dst_proc == nullptr))
113     return false;
114
115   if (r1->call == SIMCALL_COMM_TEST &&
116       (simcall_comm_test__get__comm(r1) == nullptr
117        || synchro1->src_buff == nullptr
118        || synchro1->dst_buff == nullptr))
119     return false;
120
121   if (r1->call == SIMCALL_COMM_TEST && r2->call == SIMCALL_COMM_WAIT
122       && synchro1->src_buff == synchro2->src_buff
123       && synchro1->dst_buff == synchro2->dst_buff)
124     return false;
125
126   if (r1->call == SIMCALL_COMM_WAIT && r2->call == SIMCALL_COMM_TEST
127       && synchro1->src_buff != nullptr
128       && synchro1->dst_buff != nullptr
129       && synchro2->src_buff != nullptr
130       && synchro2->dst_buff != nullptr
131       && synchro1->dst_buff != synchro2->src_buff
132       && synchro1->dst_buff != synchro2->dst_buff
133       && synchro2->dst_buff != synchro1->src_buff)
134     return false;
135
136   return true;
137 }
138
139 // Those are internal_req
140 bool request_depend(smx_simcall_t r1, smx_simcall_t r2)
141 {
142   if (r1->issuer == r2->issuer)
143     return false;
144
145   /* Wait with timeout transitions are not considered by the independance theorem, thus we consider them as dependant with all other transitions */
146   if ((r1->call == SIMCALL_COMM_WAIT && simcall_comm_wait__get__timeout(r1) > 0)
147       || (r2->call == SIMCALL_COMM_WAIT
148           && simcall_comm_wait__get__timeout(r2) > 0))
149     return TRUE;
150
151   if (r1->call != r2->call)
152     return request_depend_asymmetric(r1, r2)
153       && request_depend_asymmetric(r2, r1);
154
155   // Those are internal requests, we do not need indirection
156   // because those objects are copies:
157   simgrid::simix::Comm* synchro1 = MC_get_comm(r1);
158   simgrid::simix::Comm* synchro2 = MC_get_comm(r2);
159
160   switch(r1->call) {
161   case SIMCALL_COMM_ISEND:
162     return simcall_comm_isend__get__mbox(r1)
163       == simcall_comm_isend__get__mbox(r2);
164   case SIMCALL_COMM_IRECV:
165     return simcall_comm_irecv__get__mbox(r1)
166       == simcall_comm_irecv__get__mbox(r2);
167   case SIMCALL_COMM_WAIT:
168     if (synchro1->src_buff == synchro2->src_buff
169         && synchro1->dst_buff == synchro2->dst_buff)
170       return false;
171     else if (synchro1->src_buff != nullptr
172         && synchro1->dst_buff != nullptr
173         && synchro2->src_buff != nullptr
174         && synchro2->dst_buff != nullptr
175         && synchro1->dst_buff != synchro2->src_buff
176         && synchro1->dst_buff != synchro2->dst_buff
177         && synchro2->dst_buff != synchro1->src_buff)
178       return false;
179     else
180       return true;
181   default:
182     return true;
183   }
184 }
185
186 }
187 }
188
189 static char *pointer_to_string(void *pointer)
190 {
191
192   if (XBT_LOG_ISENABLED(mc_request, xbt_log_priority_verbose))
193     return bprintf("%p", pointer);
194
195   return xbt_strdup("(verbose only)");
196 }
197
198 static char *buff_size_to_string(size_t buff_size)
199 {
200
201   if (XBT_LOG_ISENABLED(mc_request, xbt_log_priority_verbose))
202     return bprintf("%zu", buff_size);
203
204   return xbt_strdup("(verbose only)");
205 }
206
207
208 std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid::mc::RequestType request_type)
209 {
210   xbt_assert(mc_model_checker != nullptr);
211
212   bool use_remote_comm = true;
213   switch(request_type) {
214   case simgrid::mc::RequestType::simix:
215     use_remote_comm = true;
216     break;
217   case simgrid::mc::RequestType::executed:
218   case simgrid::mc::RequestType::internal:
219     use_remote_comm = false;
220     break;
221   }
222
223   const char* type = nullptr;
224   char *args = nullptr;
225
226   smx_process_t issuer = MC_smx_simcall_get_issuer(req);
227
228   switch (req->call) {
229
230   case SIMCALL_COMM_ISEND: {
231     type = "iSend";
232     char* p = pointer_to_string(simcall_comm_isend__get__src_buff(req));
233     char* bs = buff_size_to_string(simcall_comm_isend__get__src_buff_size(req));
234     if (issuer->host)
235       args =
236           bprintf("src=(%lu)%s (%s), buff=%s, size=%s", issuer->pid,
237                   MC_smx_process_get_host_name(issuer),
238                   MC_smx_process_get_name(issuer),
239                   p, bs);
240     else
241       args =
242           bprintf("src=(%lu)%s, buff=%s, size=%s", issuer->pid,
243                   MC_smx_process_get_name(issuer), p, bs);
244     xbt_free(bs);
245     xbt_free(p);
246     break;
247   }
248
249   case SIMCALL_COMM_IRECV: {
250     size_t* remote_size = simcall_comm_irecv__get__dst_buff_size(req);
251
252     // size_t size = size_pointer ? *size_pointer : 0;
253     size_t size = 0;
254     if (remote_size)
255       mc_model_checker->process().read_bytes(&size, sizeof(size),
256         remote(remote_size));
257
258     type = "iRecv";
259     char* p = pointer_to_string(simcall_comm_irecv__get__dst_buff(req));
260     char* bs = buff_size_to_string(size);
261     if (issuer->host)
262       args =
263           bprintf("dst=(%lu)%s (%s), buff=%s, size=%s", issuer->pid,
264                   MC_smx_process_get_host_name(issuer),
265                   MC_smx_process_get_name(issuer),
266                   p, bs);
267     else
268       args =
269           bprintf("dst=(%lu)%s, buff=%s, size=%s", issuer->pid,
270                   MC_smx_process_get_name(issuer),
271                   p, bs);
272     xbt_free(bs);
273     xbt_free(p);
274     break;
275   }
276
277   case SIMCALL_COMM_WAIT: {
278     simgrid::simix::Comm* remote_act =
279       static_cast<simgrid::simix::Comm*>(simcall_comm_wait__get__comm(req));
280     char* p;
281     if (value == -1) {
282       type = "WaitTimeout";
283       p = pointer_to_string(remote_act);
284       args = bprintf("comm=%s", p);
285     } else {
286       type = "Wait";
287       p = pointer_to_string(remote_act);
288
289       simgrid::mc::Remote<simgrid::simix::Comm> temp_synchro;
290       simgrid::simix::Comm* act;
291       if (use_remote_comm) {
292         mc_model_checker->process().read(temp_synchro, remote(
293           static_cast<simgrid::simix::Comm*>(remote_act)));
294         act = static_cast<simgrid::simix::Comm*>(temp_synchro.data());
295       } else
296         act = remote_act;
297
298       smx_process_t src_proc = mc_model_checker->process().resolveProcess(
299         simgrid::mc::remote(act->src_proc));
300       smx_process_t dst_proc = mc_model_checker->process().resolveProcess(
301         simgrid::mc::remote(act->dst_proc));
302       args = bprintf("comm=%s [(%lu)%s (%s)-> (%lu)%s (%s)]", p,
303                      src_proc ? src_proc->pid : 0,
304                      src_proc ? MC_smx_process_get_host_name(src_proc) : "",
305                      src_proc ? MC_smx_process_get_name(src_proc) : "",
306                      dst_proc ? dst_proc->pid : 0,
307                      dst_proc ? MC_smx_process_get_host_name(dst_proc) : "",
308                      dst_proc ? MC_smx_process_get_name(dst_proc) : "");
309     }
310     xbt_free(p);
311     break;
312   }
313
314   case SIMCALL_COMM_TEST: {
315     simgrid::simix::Comm* remote_act = static_cast<simgrid::simix::Comm*>(
316       simcall_comm_test__get__comm(req));
317     simgrid::mc::Remote<simgrid::simix::Comm> temp_synchro;
318     simgrid::simix::Comm* act;
319     if (use_remote_comm) {
320       mc_model_checker->process().read(temp_synchro, remote(
321         static_cast<simgrid::simix::Comm*>(remote_act)));
322       act = static_cast<simgrid::simix::Comm*>(temp_synchro.data());
323     } else
324       act = remote_act;
325
326     char* p;
327     if (act->src_proc == nullptr || act->dst_proc == nullptr) {
328       type = "Test FALSE";
329       p = pointer_to_string(remote_act);
330       args = bprintf("comm=%s", p);
331     } else {
332       type = "Test TRUE";
333       p = pointer_to_string(remote_act);
334
335       smx_process_t src_proc = mc_model_checker->process().resolveProcess(
336         simgrid::mc::remote(act->src_proc));
337       smx_process_t dst_proc = mc_model_checker->process().resolveProcess(
338         simgrid::mc::remote(act->dst_proc));
339       args = bprintf("comm=%s [(%lu)%s (%s) -> (%lu)%s (%s)]", p,
340                      src_proc->pid,
341                      MC_smx_process_get_name(src_proc),
342                      MC_smx_process_get_host_name(src_proc),
343                      dst_proc->pid,
344                      MC_smx_process_get_name(dst_proc),
345                      MC_smx_process_get_host_name(dst_proc));
346     }
347     xbt_free(p);
348     break;
349   }
350
351   case SIMCALL_COMM_WAITANY: {
352     type = "WaitAny";
353     s_xbt_dynar_t comms;
354     mc_model_checker->process().read_bytes(
355       &comms, sizeof(comms), remote(simcall_comm_waitany__get__comms(req)));
356     if (!xbt_dynar_is_empty(&comms)) {
357       smx_synchro_t remote_sync;
358       read_element(mc_model_checker->process(),
359         &remote_sync, remote(simcall_comm_waitany__get__comms(req)), value,
360         sizeof(remote_sync));
361       char* p = pointer_to_string(remote_sync);
362       args = bprintf("comm=%s (%d of %lu)",
363         p, value + 1, xbt_dynar_length(&comms));
364       xbt_free(p);
365     } else
366       args = bprintf("comm at idx %d", value);
367     break;
368   }
369
370   case SIMCALL_COMM_TESTANY:
371     if (value == -1) {
372       type = "TestAny FALSE";
373       args = xbt_strdup("-");
374     } else {
375       type = "TestAny";
376       args =
377           bprintf("(%d of %zu)", value + 1,
378                   read_length(mc_model_checker->process(),
379                     simcall_comm_testany__get__comms(req)));
380     }
381     break;
382
383   case SIMCALL_MUTEX_TRYLOCK:
384   case SIMCALL_MUTEX_LOCK: {
385     if (req->call == SIMCALL_MUTEX_LOCK)
386       type = "Mutex LOCK";
387     else
388       type = "Mutex TRYLOCK";
389
390     s_smx_mutex_t mutex;
391     mc_model_checker->process().read_bytes(&mutex, sizeof(mutex),
392       remote(
393         req->call == SIMCALL_MUTEX_LOCK
394         ? simcall_mutex_lock__get__mutex(req)
395         : simcall_mutex_trylock__get__mutex(req)
396       ));
397     s_xbt_swag_t mutex_sleeping;
398     mc_model_checker->process().read_bytes(&mutex_sleeping, sizeof(mutex_sleeping),
399       remote(mutex.sleeping));
400
401     args = bprintf("locked = %d, owner = %d, sleeping = %d",
402       mutex.locked,
403       mutex.owner != nullptr ? (int) mc_model_checker->process().resolveProcess(
404         simgrid::mc::remote(mutex.owner))->pid : -1,
405       mutex_sleeping.count);
406     break;
407   }
408
409   case SIMCALL_MC_RANDOM:
410     type = "MC_RANDOM";
411     args = bprintf("%d", value);
412     break;
413
414   default:
415     THROW_UNIMPLEMENTED;
416   }
417
418   std::string str;
419   if (args != nullptr)
420     str = simgrid::xbt::string_printf("[(%lu)%s (%s)] %s(%s)", issuer->pid,
421                 MC_smx_process_get_host_name(issuer),
422                 MC_smx_process_get_name(issuer),
423                 type, args);
424   else
425     str = simgrid::xbt::string_printf("[(%lu)%s (%s)] %s ", issuer->pid,
426                 MC_smx_process_get_host_name(issuer),
427                 MC_smx_process_get_name(issuer),
428                 type);
429   xbt_free(args);
430   return str;
431 }
432
433 namespace simgrid {
434 namespace mc {
435
436 bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
437 {
438   smx_synchro_t remote_act = nullptr;
439   switch (req->call) {
440
441   case SIMCALL_COMM_WAIT:
442     /* FIXME: check also that src and dst processes are not suspended */
443     remote_act = simcall_comm_wait__get__comm(req);
444     break;
445
446   case SIMCALL_COMM_WAITANY: {
447     read_element(
448       mc_model_checker->process(), &remote_act,
449       remote(simcall_comm_waitany__get__comms(req)),
450       idx, sizeof(remote_act));
451     }
452     break;
453
454   case SIMCALL_COMM_TESTANY: {
455     read_element(
456       mc_model_checker->process(), &remote_act,
457       remote(simcall_comm_testany__get__comms(req)),
458       idx, sizeof(remote_act));
459     }
460     break;
461
462   default:
463     return true;
464   }
465
466   simgrid::mc::Remote<simgrid::simix::Comm> temp_comm;
467   mc_model_checker->process().read(temp_comm, remote(
468     static_cast<simgrid::simix::Comm*>(remote_act)));
469   simgrid::simix::Comm* comm = static_cast<simgrid::simix::Comm*>(temp_comm.data());
470   return comm->src_proc && comm->dst_proc;
471 }
472
473 bool process_is_enabled(smx_process_t process)
474 {
475   return simgrid::mc::request_is_enabled(&process->simcall);
476 }
477
478 static const char* colors[] = {
479   "blue",
480   "red",
481   "green3",
482   "goldenrod",
483   "brown",
484   "purple",
485   "magenta",
486   "turquoise4",
487   "gray25",
488   "forestgreen",
489   "hotpink",
490   "lightblue",
491   "tan",
492 };
493
494 static inline const char* get_color(int id)
495 {
496   return colors[id % (sizeof(colors) / sizeof(colors[0])) ];
497 }
498
499 std::string request_get_dot_output(smx_simcall_t req, int value)
500 {
501   std::string label;
502
503   const smx_process_t issuer = MC_smx_simcall_get_issuer(req);
504
505   switch (req->call) {
506   case SIMCALL_COMM_ISEND:
507     if (issuer->host)
508       label = simgrid::xbt::string_printf("[(%lu)%s] iSend", issuer->pid,
509                   MC_smx_process_get_host_name(issuer));
510     else
511       label = bprintf("[(%lu)] iSend", issuer->pid);
512     break;
513
514   case SIMCALL_COMM_IRECV:
515     if (issuer->host)
516       label = simgrid::xbt::string_printf("[(%lu)%s] iRecv", issuer->pid,
517                   MC_smx_process_get_host_name(issuer));
518     else
519       label = simgrid::xbt::string_printf("[(%lu)] iRecv", issuer->pid);
520     break;
521
522   case SIMCALL_COMM_WAIT: {
523     if (value == -1) {
524       if (issuer->host)
525         label = simgrid::xbt::string_printf("[(%lu)%s] WaitTimeout", issuer->pid,
526                     MC_smx_process_get_host_name(issuer));
527       else
528         label = simgrid::xbt::string_printf("[(%lu)] WaitTimeout", issuer->pid);
529     } else {
530       smx_synchro_t remote_act = simcall_comm_wait__get__comm(req);
531       simgrid::mc::Remote<simgrid::simix::Comm> temp_comm;
532       mc_model_checker->process().read(temp_comm, remote(
533         static_cast<simgrid::simix::Comm*>(remote_act)));
534       simgrid::simix::Comm* comm = static_cast<simgrid::simix::Comm*>(temp_comm.data());
535
536       smx_process_t src_proc = mc_model_checker->process().resolveProcess(
537         simgrid::mc::remote(comm->src_proc));
538       smx_process_t dst_proc = mc_model_checker->process().resolveProcess(
539         simgrid::mc::remote(comm->dst_proc));
540       if (issuer->host)
541         label = simgrid::xbt::string_printf("[(%lu)%s] Wait [(%lu)->(%lu)]",
542                     issuer->pid,
543                     MC_smx_process_get_host_name(issuer),
544                     src_proc ? src_proc->pid : 0,
545                     dst_proc ? dst_proc->pid : 0);
546       else
547         label = simgrid::xbt::string_printf("[(%lu)] Wait [(%lu)->(%lu)]",
548                     issuer->pid,
549                     src_proc ? src_proc->pid : 0,
550                     dst_proc ? dst_proc->pid : 0);
551     }
552     break;
553   }
554
555   case SIMCALL_COMM_TEST: {
556     smx_synchro_t remote_act = simcall_comm_test__get__comm(req);
557     simgrid::mc::Remote<simgrid::simix::Comm> temp_comm;
558     mc_model_checker->process().read(temp_comm, remote(
559       static_cast<simgrid::simix::Comm*>(remote_act)));
560     simgrid::simix::Comm* comm = static_cast<simgrid::simix::Comm*>(temp_comm.data());
561     if (comm->src_proc == nullptr || comm->dst_proc == nullptr) {
562       if (issuer->host)
563         label = simgrid::xbt::string_printf("[(%lu)%s] Test FALSE",
564                     issuer->pid,
565                     MC_smx_process_get_host_name(issuer));
566       else
567         label = bprintf("[(%lu)] Test FALSE", issuer->pid);
568     } else {
569       if (issuer->host)
570         label = simgrid::xbt::string_printf("[(%lu)%s] Test TRUE", issuer->pid,
571                     MC_smx_process_get_host_name(issuer));
572       else
573         label = simgrid::xbt::string_printf("[(%lu)] Test TRUE", issuer->pid);
574     }
575     break;
576   }
577
578   case SIMCALL_COMM_WAITANY: {
579     unsigned long comms_size = read_length(
580       mc_model_checker->process(), remote(simcall_comm_waitany__get__comms(req)));
581     if (issuer->host)
582       label = simgrid::xbt::string_printf("[(%lu)%s] WaitAny [%d of %lu]",
583                   issuer->pid,
584                   MC_smx_process_get_host_name(issuer), value + 1,
585                   comms_size);
586     else
587       label = simgrid::xbt::string_printf("[(%lu)] WaitAny [%d of %lu]",
588                   issuer->pid, value + 1, comms_size);
589     break;
590   }
591
592   case SIMCALL_COMM_TESTANY:
593     if (value == -1) {
594       if (issuer->host)
595         label = simgrid::xbt::string_printf("[(%lu)%s] TestAny FALSE",
596                     issuer->pid, MC_smx_process_get_host_name(issuer));
597       else
598         label = simgrid::xbt::string_printf("[(%lu)] TestAny FALSE", issuer->pid);
599     } else {
600       if (issuer->host)
601         label = simgrid::xbt::string_printf("[(%lu)%s] TestAny TRUE [%d of %lu]",
602                     issuer->pid,
603                     MC_smx_process_get_host_name(issuer), value + 1,
604                     xbt_dynar_length(simcall_comm_testany__get__comms(req)));
605       else
606         label = simgrid::xbt::string_printf("[(%lu)] TestAny TRUE [%d of %lu]",
607                     issuer->pid,
608                     value + 1,
609                     xbt_dynar_length(simcall_comm_testany__get__comms(req)));
610     }
611     break;
612
613   case SIMCALL_MUTEX_TRYLOCK:
614     label = simgrid::xbt::string_printf("[(%lu)] Mutex TRYLOCK", issuer->pid);
615     break;
616
617   case SIMCALL_MUTEX_LOCK:
618     label = simgrid::xbt::string_printf("[(%lu)] Mutex LOCK", issuer->pid);
619     break;
620
621   case SIMCALL_MC_RANDOM:
622     if (issuer->host)
623       label = simgrid::xbt::string_printf("[(%lu)%s] MC_RANDOM (%d)",
624                   issuer->pid, MC_smx_process_get_host_name(issuer), value);
625     else
626       label = simgrid::xbt::string_printf("[(%lu)] MC_RANDOM (%d)", issuer->pid, value);
627     break;
628
629   default:
630     THROW_UNIMPLEMENTED;
631   }
632
633   const char* color = get_color(issuer->pid - 1);
634   return  simgrid::xbt::string_printf(
635         "label = \"%s\", color = %s, fontcolor = %s", label.c_str(),
636         color, color);
637 }
638
639 }
640 }