- pajeDefineVariableType(variable, "HOST", variable);
- } else if (strcmp(what, "set") == 0) {
- pajeSetVariable(time, variable, MSG_host_self()->name, valuestr);
- } else if (strcmp(what, "add") == 0) {
- pajeAddVariable(time, variable, MSG_host_self()->name, valuestr);
- } else if (strcmp(what, "sub") == 0) {
- pajeSubVariable(time, variable, MSG_host_self()->name, valuestr);
+ {
+ //check if hosts have been created
+ xbt_assert1 (hosts_types != NULL && xbt_dict_length(hosts_types) != 0,
+ "%s must be called after environment creation", __FUNCTION__);
+ }
+
+ char new_type[INSTR_DEFAULT_STR_SIZE];
+ xbt_dict_cursor_t cursor = NULL;
+ char *type;
+ void *data;
+ xbt_dict_foreach(hosts_types, cursor, type, data) {
+ snprintf (new_type, INSTR_DEFAULT_STR_SIZE, "%s-%s", variable, type);
+ pajeDefineVariableType (new_type, type, variable);
+ }
+ } else{
+ char *host_name = MSG_host_self()->name;
+ char *host_type = instr_host_type (host_name);
+ char variable_type[INSTR_DEFAULT_STR_SIZE];
+ snprintf (variable_type, INSTR_DEFAULT_STR_SIZE, "%s-%s", variable, host_type);
+
+ if (strcmp(what, "set") == 0) {
+ pajeSetVariable(time, variable_type, host_name, valuestr);
+ } else if (strcmp(what, "add") == 0) {
+ pajeAddVariable(time, variable_type, host_name, valuestr);
+ } else if (strcmp(what, "sub") == 0) {
+ pajeSubVariable(time, variable_type, host_name, valuestr);
+ }