From: schnorr Date: Mon, 13 Dec 2010 16:45:09 +0000 (+0000) Subject: [trace] smpi types declaration updated X-Git-Tag: v3.6_beta2~725 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a44a5cdc24133a53176fa14a31eb7c2471f8f0eb [trace] smpi types declaration updated git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9198 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c index 3fb5dbfbf5..ba9ec37faf 100644 --- a/src/instr/instr_config.c +++ b/src/instr/instr_config.c @@ -83,22 +83,6 @@ int TRACE_start() // pajeDefineContainerType("TASK", "HOST", "TASK"); // pajeDefineStateType("category", "TASK", "category"); // pajeDefineStateType("presence", "TASK", "presence"); -// } - - /* type hierarchy for - * --cfg=tracing/smpi - * --cfg=tracing/smpi/group - */ -// FIXME -// if (TRACE_smpi_is_enabled()) { -// if (TRACE_smpi_is_grouped()){ -// pajeDefineContainerType("MPI_PROCESS", "HOST", "MPI_PROCESS"); -// }else{ -// pajeDefineContainerType("MPI_PROCESS", "PLATFORM", "MPI_PROCESS"); -// } -// pajeDefineStateType("MPI_STATE", "MPI_PROCESS", "MPI_STATE"); -// pajeDefineLinkType("MPI_LINK", "0", "MPI_PROCESS", "MPI_PROCESS", -// "MPI_LINK"); // } } /* other trace initialization */ diff --git a/src/instr/instr_routing.c b/src/instr/instr_routing.c index 1c5deabba3..e26e3edbfa 100644 --- a/src/instr/instr_routing.c +++ b/src/instr/instr_routing.c @@ -18,6 +18,7 @@ typedef enum { TYPE_VARIABLE, TYPE_LINK, TYPE_CONTAINER, + TYPE_STATE, } e_entity_types; typedef struct s_type *type_t; @@ -118,6 +119,14 @@ static type_t newLinkType (const char *typename, e_entity_types kind, type_t fat return ret; } +static type_t newStateType (const char *typename, e_entity_types kind, type_t father) +{ + type_t ret = newType (typename, kind, father); +// INFO4("StateType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id); + pajeDefineStateType(ret->id, ret->father->id, ret->name); + return ret; +} + static type_t getContainerType (const char *typename, type_t father) { type_t ret; @@ -152,6 +161,15 @@ static type_t getLinkType (const char *typename, type_t father, type_t source, t return ret; } +static type_t getStateType (const char *typename, type_t father) +{ + type_t ret = xbt_dict_get_or_null (father->children, typename); + if (ret == NULL){ + ret = newStateType (typename, TYPE_STATE, father); + } + return ret; +} + void instr_routing_define_callbacks () { if (!TRACE_is_active()) @@ -396,6 +414,14 @@ static void instr_routing_parse_start_AS () rootContainer = newContainer ("0", INSTR_AS, NULL); xbt_dynar_push (currentContainer, rootContainer); + if (TRACE_smpi_is_enabled()) { + if (!TRACE_smpi_is_grouped()){ + container_t father = xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1); + type_t mpi = getContainerType("MPI_PROCESS", father->type); + getStateType ("MPI_STATE", mpi); + getLinkType ("MPI_LINK", rootType, mpi, mpi); + } + } } container_t father = xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1); container_t new = newContainer (A_surfxml_AS_id, INSTR_AS, father); @@ -437,6 +463,14 @@ static void instr_routing_parse_start_host () if (TRACE_uncategorized()){ getVariableType ("power_used", "0.5 0.5 0.5", new->type); } + + if (TRACE_smpi_is_enabled()) { + if (TRACE_smpi_is_grouped()){ + type_t mpi = getContainerType("MPI_PROCESS", new->type); + getStateType ("MPI_STATE", mpi); + getLinkType ("MPI_LINK", rootType, mpi, mpi); + } + } } static void instr_routing_parse_end_host ()