- if (!created){//not declared, ignore
- return;
- }
- }
-
- char valuestr[100];
- snprintf(valuestr, 100, "%g", value);
-
- switch (what){
- case INSTR_US_DECLARE:
- instr_new_user_variable_type (father_type, variable, color);
- break;
- case INSTR_US_SET:
- {
- container_t container = PJ_container_get(resource);
- type_t type = PJ_type_get (variable, container->type);
- new_pajeSetVariable(time, container, type, value);
- }
- break;
- case INSTR_US_ADD:
- {
- container_t container = PJ_container_get(resource);
- type_t type = PJ_type_get (variable, container->type);
- new_pajeAddVariable(time, container, type, value);
- }
- break;
- case INSTR_US_SUB:
- {
- container_t container = PJ_container_get(resource);
- type_t type = PJ_type_get (variable, container->type);
- new_pajeSubVariable(time, container, type, value);
+ if (created != filter->end()) { // declared, let's work
+ simgrid::instr::VariableType* variable = simgrid::instr::Container::byName(resource)->getVariable(variable_name);
+ switch (what){
+ case INSTR_US_SET:
+ variable->setEvent(time, value);
+ break;
+ case INSTR_US_ADD:
+ variable->addEvent(time, value);
+ break;
+ case INSTR_US_SUB:
+ variable->subEvent(time, value);
+ break;
+ default:
+ THROW_IMPOSSIBLE;
+ break;
+ }