From: schnorr Date: Mon, 13 Dec 2010 16:44:57 +0000 (+0000) Subject: [trace] filter out the reverse connections to get a smaller trace file X-Git-Tag: v3.6_beta2~734 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4277cbd7d67751bb303dad5183248c416663fa45 [trace] filter out the reverse connections to get a smaller trace file git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9189 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/instr/instr_routing.c b/src/instr/instr_routing.c index 037c934816..43b97781f7 100644 --- a/src/instr/instr_routing.c +++ b/src/instr/instr_routing.c @@ -206,8 +206,21 @@ static void recursiveGraphExtraction (container_t container) container_t child1, child2; const char *child_name1, *child_name2; + xbt_dict_t filter = xbt_dict_new (); + xbt_dict_foreach(container->children, cursor1, child_name1, child1) { xbt_dict_foreach(container->children, cursor2, child_name2, child2) { + //check if we already register this pair (we only need one direction) + char aux1[INSTR_DEFAULT_STR_SIZE], aux2[INSTR_DEFAULT_STR_SIZE]; + snprintf (aux1, INSTR_DEFAULT_STR_SIZE, "%s%s", child_name1, child_name2); + snprintf (aux2, INSTR_DEFAULT_STR_SIZE, "%s%s", child_name2, child_name1); + if (xbt_dict_get_or_null (filter, aux1)) continue; + if (xbt_dict_get_or_null (filter, aux2)) continue; + + //ok, not found, register it + xbt_dict_set (filter, aux1, xbt_strdup ("1"), xbt_free); + xbt_dict_set (filter, aux2, xbt_strdup ("1"), xbt_free); + if ((child1->kind == INSTR_HOST || child1->kind == INSTR_ROUTER) && (child2->kind == INSTR_HOST || child2->kind == INSTR_ROUTER)){ @@ -257,6 +270,7 @@ static void recursiveGraphExtraction (container_t container) } } } + xbt_dict_free(&filter); } }