/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
xbt_dict_foreach(edges,cursor,edge_name,edge) {
- linkContainers(
- PJ_container_get(static_cast<const char*>(edge->src->data)),
- PJ_container_get(static_cast<const char*>(edge->dst->data)), filter);
+ linkContainers(simgrid::instr::Container::byName(static_cast<const char*>(edge->src->data)),
+ simgrid::instr::Container::byName(static_cast<const char*>(edge->dst->data)), filter);
}
xbt_dict_free (&nodes);
xbt_dict_free (&edges);
if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) {
simgrid::instr::Type* bandwidth = container->type_->getChildOrNull("bandwidth");
if (bandwidth == nullptr)
- bandwidth = simgrid::instr::Type::variableNew("bandwidth", nullptr, container->type_);
+ bandwidth = simgrid::instr::Type::variableNew("bandwidth", "", container->type_);
simgrid::instr::Type* latency = container->type_->getChildOrNull("latency");
if (latency == nullptr)
- latency = simgrid::instr::Type::variableNew("latency", nullptr, container->type_);
+ latency = simgrid::instr::Type::variableNew("latency", "", container->type_);
new simgrid::instr::SetVariableEvent(0, container, bandwidth, bandwidth_value);
new simgrid::instr::SetVariableEvent(0, container, latency, latency_value);
}
if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) {
simgrid::instr::Type* speed = container->type_->getChildOrNull("power");
if (speed == nullptr){
- speed = simgrid::instr::Type::variableNew("power", nullptr, container->type_);
+ speed = simgrid::instr::Type::variableNew("power", "", container->type_);
}
double current_speed_state = host.getSpeed();
if (msg_process == nullptr){
msg_process = simgrid::instr::Type::containerNew("MSG_PROCESS", container->type_);
simgrid::instr::Type* state = simgrid::instr::Type::stateNew("MSG_PROCESS_STATE", msg_process);
- new simgrid::instr::Value("suspend", "1 0 1", state);
- simgrid::instr::Value::get_or_new("sleep", "1 1 0", state);
- simgrid::instr::Value::get_or_new("receive", "1 0 0", state);
- simgrid::instr::Value::get_or_new("send", "0 0 1", state);
- simgrid::instr::Value::get_or_new("task_execute", "0 1 1", state);
+ simgrid::instr::Value::byNameOrCreate("suspend", "1 0 1", state);
+ simgrid::instr::Value::byNameOrCreate("sleep", "1 1 0", state);
+ simgrid::instr::Value::byNameOrCreate("receive", "1 0 0", state);
+ simgrid::instr::Value::byNameOrCreate("send", "0 0 1", state);
+ simgrid::instr::Value::byNameOrCreate("task_execute", "0 1 1", state);
simgrid::instr::Type::linkNew("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
simgrid::instr::Type::linkNew("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
}
if (msg_vm == nullptr){
msg_vm = simgrid::instr::Type::containerNew("MSG_VM", container->type_);
simgrid::instr::Type* state = simgrid::instr::Type::stateNew("MSG_VM_STATE", msg_vm);
- new simgrid::instr::Value("suspend", "1 0 1", state);
- simgrid::instr::Value::get_or_new("sleep", "1 1 0", state);
- simgrid::instr::Value::get_or_new("receive", "1 0 0", state);
- simgrid::instr::Value::get_or_new("send", "0 0 1", state);
- simgrid::instr::Value::get_or_new("task_execute", "0 1 1", state);
+ simgrid::instr::Value::byNameOrCreate("suspend", "1 0 1", state);
+ simgrid::instr::Value::byNameOrCreate("sleep", "1 1 0", state);
+ simgrid::instr::Value::byNameOrCreate("receive", "1 0 0", state);
+ simgrid::instr::Value::byNameOrCreate("send", "0 0 1", state);
+ simgrid::instr::Value::byNameOrCreate("task_execute", "0 1 1", state);
simgrid::instr::Type::linkNew("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
simgrid::instr::Type::linkNew("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm);
}
*/
static void recursiveNewVariableType(const char* new_typename, const char* color, simgrid::instr::Type* root)
{
+
if (not strcmp(root->name_, "HOST")) {
char tnstr[INSTR_DEFAULT_STR_SIZE];
snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "p%s", new_typename);
- simgrid::instr::Type::variableNew(tnstr, color, root);
+ simgrid::instr::Type::variableNew(tnstr, color == nullptr ? "" : color, root);
}
if (not strcmp(root->name_, "MSG_VM")) {
char tnstr[INSTR_DEFAULT_STR_SIZE];
snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "p%s", new_typename);
- simgrid::instr::Type::variableNew(tnstr, color, root);
+ simgrid::instr::Type::variableNew(tnstr, color == nullptr ? "" : color, root);
}
if (not strcmp(root->name_, "LINK")) {
char tnstr[INSTR_DEFAULT_STR_SIZE];
snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "b%s", new_typename);
- simgrid::instr::Type::variableNew(tnstr, color, root);
+ simgrid::instr::Type::variableNew(tnstr, color == nullptr ? "" : color, root);
}
xbt_dict_cursor_t cursor = nullptr;
simgrid::instr::Type* child_type;
char *name;
xbt_dict_foreach (root->children_, cursor, name, child_type) {
- recursiveNewVariableType (new_typename, color, child_type);
+ recursiveNewVariableType(new_typename, color == nullptr ? "" : color, child_type);
}
}
simgrid::instr::Type* root)
{
if (not strcmp(root->name_, father_type)) {
- simgrid::instr::Type::variableNew(new_typename, color, root);
+ simgrid::instr::Type::variableNew(new_typename, color == nullptr ? "" : color, root);
}
xbt_dict_cursor_t cursor = nullptr;
simgrid::instr::Type* child_type;
simgrid::instr::Type* root)
{
if (not strcmp(root->name_, type_name)) {
- new simgrid::instr::Value(val, color, root);
+ simgrid::instr::Value::byNameOrCreate(val, color, root);
}
xbt_dict_cursor_t cursor = nullptr;
simgrid::instr::Type* child_type;