+
+static void print_node(const CycleNode *node, FILE *file, int label)
+{
+ modelclock_t idx;
+ if (node->is_promise()) {
+ const Promise *promise = node->getPromise();
+ idx = promise->get_action()->get_seq_number();
+ fprintf(file, "P%u", idx);
+ if (label) {
+ int first = 1;
+ fprintf(file, " [label=\"P%u, T", idx);
+ for (unsigned int i = 0 ; i < model->get_num_threads(); i++)
+ if (promise->thread_is_available(int_to_id(i))) {
+ fprintf(file, "%s%u", first ? "": ",", i);
+ first = 0;
+ }
+ fprintf(file, "\"]");
+ }
+ } else {
+ const ModelAction *act = node->getAction();
+ idx = act->get_seq_number();
+ fprintf(file, "N%u", idx);
+ if (label)
+ fprintf(file, " [label=\"N%u, T%u\"]", idx, act->get_tid());
+ }
+}
+