static bool trace_configured = false;
static bool trace_active = false;
-static Type* rootType = nullptr; /* the root type */
+static simgrid::instr::Type* rootType = nullptr; /* the root type */
instr_fmt_type_t instr_fmt_type = instr_fmt_paje;
TRACE_generate_viva_cat_conf();
/* dump trace buffer */
- TRACE_last_timestamp_to_dump = surf_get_clock();
+ simgrid::instr::TRACE_last_timestamp_to_dump = surf_get_clock();
TRACE_paje_dump_buffer(1);
/* destroy all data structures of tracing (and free) */
static void output_categories(const char* name, FILE* file)
{
- unsigned int i = created_categories.size();
+ unsigned int i = simgrid::instr::created_categories.size();
fprintf (file, " values = (");
- for (auto const& cat : created_categories) {
+ for (auto const& cat : simgrid::instr::created_categories) {
--i;
fprintf(file, "\"%s%s\"", name, cat.c_str());
if (i > 0) {
{
if (output && strlen(output) > 0){
//check if we do have categories declared
- if (created_categories.empty()) {
+ if (simgrid::instr::created_categories.empty()) {
XBT_INFO("No categories declared, ignoring generation of %s graph configuration", name);
return;
}
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_api, instr, "API");
-std::set<std::string> created_categories;
-std::set<std::string> declared_marks;
-std::set<std::string> user_host_variables;
-std::set<std::string> user_vm_variables;
-std::set<std::string> user_link_variables;
+std::set<std::string> simgrid::instr::created_categories;
+std::set<std::string> simgrid::instr::declared_marks;
+std::set<std::string> simgrid::instr::user_host_variables;
+std::set<std::string> simgrid::instr::user_vm_variables;
+std::set<std::string> simgrid::instr::user_link_variables;
extern std::set<std::string> trivaNodeTypes;
extern std::set<std::string> trivaEdgeTypes;
return;
//check if category is already created
- if (created_categories.find(category) != created_categories.end())
+ if (simgrid::instr::created_categories.find(category) != simgrid::instr::created_categories.end())
return;
else
- created_categories.insert(category);
+ simgrid::instr::created_categories.insert(category);
//define final_color
char final_color[INSTR_DEFAULT_STR_SIZE];
{
if (not TRACE_is_enabled() || not TRACE_categorized())
return nullptr;
- return instr_set_to_dynar(&created_categories);
+ return instr_set_to_dynar(&simgrid::instr::created_categories);
}
/** \ingroup TRACE_mark
THROWF (tracing_error, 1, "mark_type is nullptr");
//check if mark_type is already declared
- if (declared_marks.find(mark_type) != declared_marks.end()) {
+ if (simgrid::instr::declared_marks.find(mark_type) != simgrid::instr::declared_marks.end()) {
THROWF (tracing_error, 1, "mark_type with name (%s) is already declared", mark_type);
}
XBT_DEBUG("MARK,declare %s", mark_type);
- Type::eventNew(mark_type, PJ_type_get_root());
- declared_marks.insert(mark_type);
+ simgrid::instr::Type::eventNew(mark_type, PJ_type_get_root());
+ simgrid::instr::declared_marks.insert(mark_type);
}
/** \ingroup TRACE_mark
if (not mark_value)
THROWF (tracing_error, 1, "mark_value is nullptr");
- Type* type = PJ_type_get (mark_type, PJ_type_get_root());
+ simgrid::instr::Type* type = PJ_type_get(mark_type, PJ_type_get_root());
if (not type) {
THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
}
mark_color = white;
XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color);
- Value rett(mark_value, mark_color, type);
+ simgrid::instr::Value rett(mark_value, mark_color, type);
}
/** \ingroup TRACE_mark
THROWF (tracing_error, 1, "mark_value is nullptr");
//check if mark_type is already declared
- Type* type = PJ_type_get (mark_type, PJ_type_get_root());
+ simgrid::instr::Type* type = PJ_type_get(mark_type, PJ_type_get_root());
if (not type) {
THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
}
XBT_DEBUG("MARK %s %s", mark_type, mark_value);
- new NewEvent(MSG_get_clock(), PJ_container_get_root(), type, Value::get(mark_value, type));
+ new simgrid::instr::NewEvent(MSG_get_clock(), PJ_container_get_root(), type,
+ simgrid::instr::Value::get(mark_value, type));
}
/** \ingroup TRACE_mark
if (not TRACE_is_enabled())
return nullptr;
- return instr_set_to_dynar(&declared_marks);
+ return instr_set_to_dynar(&simgrid::instr::declared_marks);
}
static void instr_user_variable(double time, const char* resource, const char* variable, const char* father_type,
char valuestr[100];
snprintf(valuestr, 100, "%g", value);
container_t container = PJ_container_get(resource);
- Type* type = PJ_type_get (variable, container->type);
+ simgrid::instr::Type* type = PJ_type_get(variable, container->type);
switch (what){
case INSTR_US_SET:
- new SetVariableEvent(time, container, type, value);
+ new simgrid::instr::SetVariableEvent(time, container, type, value);
break;
case INSTR_US_ADD:
- new AddVariableEvent(time, container, type, value);
+ new simgrid::instr::AddVariableEvent(time, container, type, value);
break;
case INSTR_US_SUB:
- new SubVariableEvent(time, container, type, value);
+ new simgrid::instr::SubVariableEvent(time, container, type, value);
break;
default:
THROW_IMPOSSIBLE;
std::vector<simgrid::surf::LinkImpl*> route;
simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(src_elm, dst_elm, &route, nullptr);
for (auto const& link : route)
- instr_user_variable(time, link->cname(), variable, father_type, value, what, nullptr, &user_link_variables);
+ instr_user_variable(time, link->cname(), variable, father_type, value, what, nullptr,
+ &simgrid::instr::user_link_variables);
}
/** \ingroup TRACE_API
*/
void TRACE_vm_variable_declare (const char *variable)
{
- instr_user_variable(0, nullptr, variable, "MSG_VM", 0, INSTR_US_DECLARE, nullptr, &user_vm_variables);
+ instr_user_variable(0, nullptr, variable, "MSG_VM", 0, INSTR_US_DECLARE, nullptr, &simgrid::instr::user_vm_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_vm_variable_declare_with_color (const char *variable, const char *color)
{
- instr_user_variable(0, nullptr, variable, "MSG_VM", 0, INSTR_US_DECLARE, color, &user_vm_variables);
+ instr_user_variable(0, nullptr, variable, "MSG_VM", 0, INSTR_US_DECLARE, color, &simgrid::instr::user_vm_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_vm_variable_set_with_time (double time, const char *vm, const char *variable, double value)
{
- instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_SET, nullptr, &user_vm_variables);
+ instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_SET, nullptr, &simgrid::instr::user_vm_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_vm_variable_add_with_time (double time, const char *vm, const char *variable, double value)
{
- instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_ADD, nullptr, &user_vm_variables);
+ instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_ADD, nullptr, &simgrid::instr::user_vm_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_vm_variable_sub_with_time (double time, const char *vm, const char *variable, double value)
{
- instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_SUB, nullptr, &user_vm_variables);
+ instr_user_variable(time, vm, variable, "MSG_VM", value, INSTR_US_SUB, nullptr, &simgrid::instr::user_vm_variables);
}
/* for host variables */
*/
void TRACE_host_variable_declare (const char *variable)
{
- instr_user_variable(0, nullptr, variable, "HOST", 0, INSTR_US_DECLARE, nullptr, &user_host_variables);
+ instr_user_variable(0, nullptr, variable, "HOST", 0, INSTR_US_DECLARE, nullptr, &simgrid::instr::user_host_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_host_variable_declare_with_color (const char *variable, const char *color)
{
- instr_user_variable(0, nullptr, variable, "HOST", 0, INSTR_US_DECLARE, color, &user_host_variables);
+ instr_user_variable(0, nullptr, variable, "HOST", 0, INSTR_US_DECLARE, color, &simgrid::instr::user_host_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_host_variable_set_with_time (double time, const char *host, const char *variable, double value)
{
- instr_user_variable(time, host, variable, "HOST", value, INSTR_US_SET, nullptr, &user_host_variables);
+ instr_user_variable(time, host, variable, "HOST", value, INSTR_US_SET, nullptr, &simgrid::instr::user_host_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_host_variable_add_with_time (double time, const char *host, const char *variable, double value)
{
- instr_user_variable(time, host, variable, "HOST", value, INSTR_US_ADD, nullptr, &user_host_variables);
+ instr_user_variable(time, host, variable, "HOST", value, INSTR_US_ADD, nullptr, &simgrid::instr::user_host_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_host_variable_sub_with_time (double time, const char *host, const char *variable, double value)
{
- instr_user_variable(time, host, variable, "HOST", value, INSTR_US_SUB, nullptr, &user_host_variables);
+ instr_user_variable(time, host, variable, "HOST", value, INSTR_US_SUB, nullptr, &simgrid::instr::user_host_variables);
}
/** \ingroup TRACE_user_variables
*/
xbt_dynar_t TRACE_get_host_variables ()
{
- return instr_set_to_dynar(&user_host_variables);
+ return instr_set_to_dynar(&simgrid::instr::user_host_variables);
}
/* for link variables */
*/
void TRACE_link_variable_declare (const char *variable)
{
- instr_user_variable(0, nullptr, variable, "LINK", 0, INSTR_US_DECLARE, nullptr, &user_link_variables);
+ instr_user_variable(0, nullptr, variable, "LINK", 0, INSTR_US_DECLARE, nullptr, &simgrid::instr::user_link_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_link_variable_declare_with_color (const char *variable, const char *color)
{
- instr_user_variable(0, nullptr, variable, "LINK", 0, INSTR_US_DECLARE, color, &user_link_variables);
+ instr_user_variable(0, nullptr, variable, "LINK", 0, INSTR_US_DECLARE, color, &simgrid::instr::user_link_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_link_variable_set_with_time (double time, const char *link, const char *variable, double value)
{
- instr_user_variable(time, link, variable, "LINK", value, INSTR_US_SET, nullptr, &user_link_variables);
+ instr_user_variable(time, link, variable, "LINK", value, INSTR_US_SET, nullptr, &simgrid::instr::user_link_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_link_variable_add_with_time (double time, const char *link, const char *variable, double value)
{
- instr_user_variable(time, link, variable, "LINK", value, INSTR_US_ADD, nullptr, &user_link_variables);
+ instr_user_variable(time, link, variable, "LINK", value, INSTR_US_ADD, nullptr, &simgrid::instr::user_link_variables);
}
/** \ingroup TRACE_user_variables
*/
void TRACE_link_variable_sub_with_time (double time, const char *link, const char *variable, double value)
{
- instr_user_variable(time, link, variable, "LINK", value, INSTR_US_SUB, nullptr, &user_link_variables);
+ instr_user_variable(time, link, variable, "LINK", value, INSTR_US_SUB, nullptr, &simgrid::instr::user_link_variables);
}
/* for link variables, but with src and dst used for get_route */
*/
xbt_dynar_t TRACE_get_link_variables ()
{
- return instr_set_to_dynar(&user_link_variables);
+ return instr_set_to_dynar(&simgrid::instr::user_link_variables);
}
/** \ingroup TRACE_user_variables
void TRACE_host_set_state(const char* host, const char* state, const char* value_str)
{
container_t container = PJ_container_get(host);
- Type* type = PJ_type_get (state, container->type);
- Value* val =
- Value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
- new SetStateEvent(MSG_get_clock(), container, type, val);
+ simgrid::instr::Type* type = PJ_type_get(state, container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get_or_new(
+ value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
+ new simgrid::instr::SetStateEvent(MSG_get_clock(), container, type, val);
}
/** \ingroup TRACE_user_variables
void TRACE_host_push_state(const char* host, const char* state, const char* value_str)
{
container_t container = PJ_container_get(host);
- Type* type = PJ_type_get (state, container->type);
- Value* val =
- Value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
- new PushStateEvent(MSG_get_clock(), container, type, val);
+ simgrid::instr::Type* type = PJ_type_get(state, container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get_or_new(
+ value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
+ new simgrid::instr::PushStateEvent(MSG_get_clock(), container, type, val);
}
/** \ingroup TRACE_user_variables
void TRACE_host_pop_state (const char *host, const char *state)
{
container_t container = PJ_container_get(host);
- Type* type = PJ_type_get (state, container->type);
- new PopStateEvent(MSG_get_clock(), container, type);
+ simgrid::instr::Type* type = PJ_type_get(state, container->type);
+ new simgrid::instr::PopStateEvent(MSG_get_clock(), container, type);
}
/** \ingroup TRACE_API
rootContainer = root;
}
-container_t PJ_container_new (const char *name, e_container_types kind, container_t father)
+container_t PJ_container_new(const char* name, simgrid::instr::e_container_types kind, container_t father)
{
if (name == nullptr){
THROWF (tracing_error, 0, "can't create a container with a nullptr name");
snprintf (id_str, INSTR_DEFAULT_STR_SIZE, "%lld", container_id);
container_id++;
- container_t newContainer = xbt_new0(s_container, 1);
+ container_t newContainer = xbt_new0(simgrid::instr::s_container, 1);
newContainer->name = xbt_strdup (name); // name of the container
newContainer->id = xbt_strdup (id_str); // id (or alias) of the container
newContainer->father = father;
//Search for network_element_t
switch (kind){
- case INSTR_HOST:
+ case simgrid::instr::INSTR_HOST:
newContainer->netpoint = sg_host->pimpl_netpoint;
xbt_assert(newContainer->netpoint, "Element '%s' not found", name);
break;
- case INSTR_ROUTER:
+ case simgrid::instr::INSTR_ROUTER:
newContainer->netpoint = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
xbt_assert(newContainer->netpoint, "Element '%s' not found", name);
break;
- case INSTR_AS:
+ case simgrid::instr::INSTR_AS:
newContainer->netpoint = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
xbt_assert(newContainer->netpoint, "Element '%s' not found", name);
break;
}
// type definition (method depends on kind of this new container)
newContainer->kind = kind;
- if (newContainer->kind == INSTR_AS){
+ if (newContainer->kind == simgrid::instr::INSTR_AS) {
//if this container is of an AS, its type name depends on its level
char as_typename[INSTR_DEFAULT_STR_SIZE];
snprintf (as_typename, INSTR_DEFAULT_STR_SIZE, "L%d", newContainer->level);
if (newContainer->father){
- newContainer->type = Type::getOrNull (as_typename, newContainer->father->type);
+ newContainer->type = simgrid::instr::Type::getOrNull(as_typename, newContainer->father->type);
if (newContainer->type == nullptr){
- newContainer->type = Type::containerNew (as_typename, newContainer->father->type);
+ newContainer->type = simgrid::instr::Type::containerNew(as_typename, newContainer->father->type);
}
}else{
- newContainer->type = Type::containerNew ("0", nullptr);
+ newContainer->type = simgrid::instr::Type::containerNew("0", nullptr);
}
}else{
//otherwise, the name is its kind
char typeNameBuff[INSTR_DEFAULT_STR_SIZE];
switch (newContainer->kind){
- case INSTR_HOST:
+ case simgrid::instr::INSTR_HOST:
snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "HOST");
break;
- case INSTR_LINK:
+ case simgrid::instr::INSTR_LINK:
snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "LINK");
break;
- case INSTR_ROUTER:
+ case simgrid::instr::INSTR_ROUTER:
snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "ROUTER");
break;
- case INSTR_SMPI:
+ case simgrid::instr::INSTR_SMPI:
snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MPI");
break;
- case INSTR_MSG_PROCESS:
+ case simgrid::instr::INSTR_MSG_PROCESS:
snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_PROCESS");
break;
- case INSTR_MSG_VM:
+ case simgrid::instr::INSTR_MSG_VM:
snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_VM");
break;
- case INSTR_MSG_TASK:
+ case simgrid::instr::INSTR_MSG_TASK:
snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_TASK");
break;
default:
THROWF (tracing_error, 0, "new container kind is unknown.");
break;
}
- Type* type = Type::getOrNull (typeNameBuff, newContainer->father->type);
+ simgrid::instr::Type* type = simgrid::instr::Type::getOrNull(typeNameBuff, newContainer->father->type);
if (type == nullptr){
- newContainer->type = Type::containerNew (typeNameBuff, newContainer->father->type);
+ newContainer->type = simgrid::instr::Type::containerNew(typeNameBuff, newContainer->father->type);
}else{
newContainer->type = type;
}
XBT_DEBUG("Add container name '%s'",newContainer->name);
//register NODE types for triva configuration
- if (newContainer->kind == INSTR_HOST || newContainer->kind == INSTR_LINK || newContainer->kind == INSTR_ROUTER) {
+ if (newContainer->kind == simgrid::instr::INSTR_HOST || newContainer->kind == simgrid::instr::INSTR_LINK ||
+ newContainer->kind == simgrid::instr::INSTR_ROUTER) {
trivaNodeTypes.insert(newContainer->type->name);
}
return newContainer;
//obligation to dump previous events because they might
//reference the container that is about to be destroyed
- TRACE_last_timestamp_to_dump = surf_get_clock();
+ simgrid::instr::TRACE_last_timestamp_to_dump = surf_get_clock();
TRACE_paje_dump_buffer(1);
//trace my destruction
static void TRACE_header_PajeDefineContainerType (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeDefineContainerType %d\n", PAJE_DefineContainerType);
+ fprintf(tracing_file, "%%EventDef PajeDefineContainerType %d\n", simgrid::instr::PAJE_DefineContainerType);
fprintf(tracing_file, "%% Alias string\n");
if (basic){
fprintf(tracing_file, "%% ContainerType string\n");
static void TRACE_header_PajeDefineVariableType (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeDefineVariableType %d\n", PAJE_DefineVariableType);
+ fprintf(tracing_file, "%%EventDef PajeDefineVariableType %d\n", simgrid::instr::PAJE_DefineVariableType);
fprintf(tracing_file, "%% Alias string\n");
if (basic){
fprintf(tracing_file, "%% ContainerType string\n");
static void TRACE_header_PajeDefineStateType (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeDefineStateType %d\n", PAJE_DefineStateType);
+ fprintf(tracing_file, "%%EventDef PajeDefineStateType %d\n", simgrid::instr::PAJE_DefineStateType);
fprintf(tracing_file, "%% Alias string\n");
if (basic){
fprintf(tracing_file, "%% ContainerType string\n");
static void TRACE_header_PajeDefineEventType (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeDefineEventType %d\n", PAJE_DefineEventType);
+ fprintf(tracing_file, "%%EventDef PajeDefineEventType %d\n", simgrid::instr::PAJE_DefineEventType);
fprintf(tracing_file, "%% Alias string\n");
if (basic){
fprintf(tracing_file, "%% ContainerType string\n");
static void TRACE_header_PajeDefineLinkType (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeDefineLinkType %d\n", PAJE_DefineLinkType);
+ fprintf(tracing_file, "%%EventDef PajeDefineLinkType %d\n", simgrid::instr::PAJE_DefineLinkType);
fprintf(tracing_file, "%% Alias string\n");
if (basic){
fprintf(tracing_file, "%% ContainerType string\n");
static void TRACE_header_PajeDefineEntityValue (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeDefineEntityValue %d\n", PAJE_DefineEntityValue);
+ fprintf(tracing_file, "%%EventDef PajeDefineEntityValue %d\n", simgrid::instr::PAJE_DefineEntityValue);
fprintf(tracing_file, "%% Alias string\n");
if (basic){
fprintf(tracing_file, "%% EntityType string\n");
static void TRACE_header_PajeCreateContainer (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeCreateContainer %d\n", PAJE_CreateContainer);
+ fprintf(tracing_file, "%%EventDef PajeCreateContainer %d\n", simgrid::instr::PAJE_CreateContainer);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Alias string\n");
fprintf(tracing_file, "%% Type string\n");
static void TRACE_header_PajeDestroyContainer (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeDestroyContainer %d\n", PAJE_DestroyContainer);
+ fprintf(tracing_file, "%%EventDef PajeDestroyContainer %d\n", simgrid::instr::PAJE_DestroyContainer);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Name string\n");
static void TRACE_header_PajeSetVariable (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeSetVariable %d\n", PAJE_SetVariable);
+ fprintf(tracing_file, "%%EventDef PajeSetVariable %d\n", simgrid::instr::PAJE_SetVariable);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Container string\n");
static void TRACE_header_PajeAddVariable (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeAddVariable %d\n", PAJE_AddVariable);
+ fprintf(tracing_file, "%%EventDef PajeAddVariable %d\n", simgrid::instr::PAJE_AddVariable);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Container string\n");
static void TRACE_header_PajeSubVariable (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeSubVariable %d\n", PAJE_SubVariable);
+ fprintf(tracing_file, "%%EventDef PajeSubVariable %d\n", simgrid::instr::PAJE_SubVariable);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Container string\n");
static void TRACE_header_PajeSetState (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeSetState %d\n", PAJE_SetState);
+ fprintf(tracing_file, "%%EventDef PajeSetState %d\n", simgrid::instr::PAJE_SetState);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Container string\n");
static void TRACE_header_PajePushState (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajePushState %d\n", PAJE_PushState);
+ fprintf(tracing_file, "%%EventDef PajePushState %d\n", simgrid::instr::PAJE_PushState);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Container string\n");
static void TRACE_header_PajePopState (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajePopState %d\n", PAJE_PopState);
+ fprintf(tracing_file, "%%EventDef PajePopState %d\n", simgrid::instr::PAJE_PopState);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Container string\n");
{
if (basic) return;
- fprintf(tracing_file, "%%EventDef PajeResetState %d\n", PAJE_ResetState);
+ fprintf(tracing_file, "%%EventDef PajeResetState %d\n", simgrid::instr::PAJE_ResetState);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Container string\n");
static void TRACE_header_PajeStartLink (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeStartLink %d\n", PAJE_StartLink);
+ fprintf(tracing_file, "%%EventDef PajeStartLink %d\n", simgrid::instr::PAJE_StartLink);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Container string\n");
static void TRACE_header_PajeEndLink (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeEndLink %d\n", PAJE_EndLink);
+ fprintf(tracing_file, "%%EventDef PajeEndLink %d\n", simgrid::instr::PAJE_EndLink);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Container string\n");
static void TRACE_header_PajeNewEvent (int basic, int size)
{
- fprintf(tracing_file, "%%EventDef PajeNewEvent %d\n", PAJE_NewEvent);
+ fprintf(tracing_file, "%%EventDef PajeNewEvent %d\n", simgrid::instr::PAJE_NewEvent);
fprintf(tracing_file, "%% Time date\n");
fprintf(tracing_file, "%% Type string\n");
fprintf(tracing_file, "%% Container string\n");
static xbt_dict_t tracing_files = nullptr; // TI specific
static double prefix=0.0; // TI specific
-std::vector<PajeEvent*> buffer;
-void buffer_debug(std::vector<PajeEvent*> *buf);
+std::vector<simgrid::instr::PajeEvent*> buffer;
+void buffer_debug(std::vector<simgrid::instr::PajeEvent*>* buf);
void dump_comment (const char *comment)
{
}
buffer.clear();
}else{
- std::vector<PajeEvent*>::iterator i = buffer.begin();
+ std::vector<simgrid::instr::PajeEvent*>::iterator i = buffer.begin();
for (auto const& event : buffer) {
double head_timestamp = event->timestamp;
if (head_timestamp > TRACE_last_timestamp_to_dump)
XBT_DEBUG("%s: ends", __FUNCTION__);
}
-void buffer_debug(std::vector<PajeEvent*> *buf);
-void buffer_debug(std::vector<PajeEvent*> *buf) {
+void buffer_debug(std::vector<simgrid::instr::PajeEvent*>* buf);
+void buffer_debug(std::vector<simgrid::instr::PajeEvent*>* buf)
+{
return;
XBT_DEBUG(">>>>>> Dump the state of the buffer. %zu events", buf->size());
for (auto const& event : *buf) {
stream.clear();
}
-static void print_timestamp(PajeEvent* event) {
+static void print_timestamp(simgrid::instr::PajeEvent* event)
+{
stream << " ";
/* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
if (event->timestamp < 1e-12)
}
/* internal do the instrumentation module */
-static void insert_into_buffer (PajeEvent* tbi)
+static void insert_into_buffer(simgrid::instr::PajeEvent* tbi)
{
if (TRACE_buffer() == 0){
tbi->print ();
XBT_DEBUG("%s: insert event_type=%d, timestamp=%f, buffersize=%zu)",
__FUNCTION__, (int)tbi->event_type, tbi->timestamp, buffer.size());
- std::vector<PajeEvent*>::reverse_iterator i;
+ std::vector<simgrid::instr::PajeEvent*>::reverse_iterator i;
for (i = buffer.rbegin(); i != buffer.rend(); ++i) {
- PajeEvent* e1 = *i;
+ simgrid::instr::PajeEvent* e1 = *i;
XBT_DEBUG("compare to %p is of type %d; timestamp:%f", e1,
(int)e1->event_type, e1->timestamp);
if (e1->timestamp <= tbi->timestamp)
buffer_debug(&buffer);
}
-PajeEvent:: ~PajeEvent()
+simgrid::instr::PajeEvent::~PajeEvent()
{
XBT_DEBUG("%s not implemented for %p: event_type=%d, timestamp=%f", __FUNCTION__,
this, (int)event_type, timestamp);
XBT_DEBUG("Filename %s is closed", filename);
}
-void DefineContainerEvent(Type* type)
+void DefineContainerEvent(simgrid::instr::Type* type)
{
- XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineContainerType);
+ XBT_DEBUG("%s: event_type=%d", __FUNCTION__, simgrid::instr::PAJE_DefineContainerType);
//print it
if (instr_fmt_type == instr_fmt_paje) {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineContainerType, TRACE_precision(), 0.);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineContainerType,
+ TRACE_precision(), 0.);
stream << std::fixed << std::setprecision(TRACE_precision());
- stream << PAJE_DefineContainerType;
+ stream << simgrid::instr::PAJE_DefineContainerType;
stream << " " << type->id << " " << type->father->id << " " << type->name;
print_row();
} else if (instr_fmt_type == instr_fmt_TI) {
//--
}
-void LogVariableTypeDefinition(Type* type)
+void LogVariableTypeDefinition(simgrid::instr::Type* type)
{
- XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineVariableType);
+ XBT_DEBUG("%s: event_type=%d", __FUNCTION__, simgrid::instr::PAJE_DefineVariableType);
//print it
if (instr_fmt_type == instr_fmt_paje) {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineVariableType, TRACE_precision(), 0.);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << PAJE_DefineVariableType;
- stream << " " << type->id << " " << type->father->id << " " << type->name;
- if (type->color)
- stream << " \"" << type->color << "\"";
- print_row();
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineVariableType,
+ TRACE_precision(), 0.);
+ stream << std::fixed << std::setprecision(TRACE_precision());
+ stream << simgrid::instr::PAJE_DefineVariableType;
+ stream << " " << type->id << " " << type->father->id << " " << type->name;
+ if (type->color)
+ stream << " \"" << type->color << "\"";
+ print_row();
} else if (instr_fmt_type == instr_fmt_TI) {
/* Nothing to do */
} else {
}
}
-void LogStateTypeDefinition(Type* type)
+void LogStateTypeDefinition(simgrid::instr::Type* type)
{
//print it
if (instr_fmt_type == instr_fmt_paje) {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineStateType, TRACE_precision(), 0.);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << PAJE_DefineStateType;
- stream << " " << type->id << " " << type->father->id << " " << type->name;
- print_row();
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineStateType, TRACE_precision(),
+ 0.);
+ stream << std::fixed << std::setprecision(TRACE_precision());
+ stream << simgrid::instr::PAJE_DefineStateType;
+ stream << " " << type->id << " " << type->father->id << " " << type->name;
+ print_row();
} else if (instr_fmt_type == instr_fmt_TI) {
/* Nothing to do */
} else {
}
}
-void LogDefineEventType(Type* type)
+void LogDefineEventType(simgrid::instr::Type* type)
{
//print it
if (instr_fmt_type == instr_fmt_paje) {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineEventType, TRACE_precision(), 0.);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineEventType,
+ TRACE_precision(), 0.);
stream << std::fixed << std::setprecision(TRACE_precision());
- stream << PAJE_DefineEventType;
+ stream << simgrid::instr::PAJE_DefineEventType;
stream << " " << type->id << " " << type->father->id << " " << type->name;
print_row();
} else if (instr_fmt_type == instr_fmt_TI) {
}
}
-void LogLinkTypeDefinition(Type* type, Type* source, Type* dest)
+void LogLinkTypeDefinition(simgrid::instr::Type* type, simgrid::instr::Type* source, simgrid::instr::Type* dest)
{
- XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineLinkType);
+ XBT_DEBUG("%s: event_type=%d", __FUNCTION__, simgrid::instr::PAJE_DefineLinkType);
//print it
if (instr_fmt_type == instr_fmt_paje) {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineLinkType, TRACE_precision(), 0.);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << PAJE_DefineLinkType;
- stream << " " << type->id << " " << type->father->id << " " << source->id << " " << dest->id << " " << type->name;
- print_row();
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineLinkType, TRACE_precision(),
+ 0.);
+ stream << std::fixed << std::setprecision(TRACE_precision());
+ stream << simgrid::instr::PAJE_DefineLinkType;
+ stream << " " << type->id << " " << type->father->id << " " << source->id << " " << dest->id << " " << type->name;
+ print_row();
} else if (instr_fmt_type == instr_fmt_TI) {
/* Nothing to do */
} else {
}
}
-void LogEntityValue(Value* val)
+void LogEntityValue(simgrid::instr::Value* val)
{
- XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineEntityValue);
+ XBT_DEBUG("%s: event_type=%d", __FUNCTION__, simgrid::instr::PAJE_DefineEntityValue);
//print it
if (instr_fmt_type == instr_fmt_paje) {
stream << std::fixed << std::setprecision(TRACE_precision());
- stream << PAJE_DefineEntityValue;
+ stream << simgrid::instr::PAJE_DefineEntityValue;
stream << " " << val->id << " " << val->father->id << " " << val->name;
if (val->color)
stream << " \"" << val->color << "\"";
void LogContainerCreation (container_t container)
{
- double timestamp = SIMIX_get_clock();
+ double timestamp = SIMIX_get_clock();
- XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, PAJE_CreateContainer,timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, simgrid::instr::PAJE_CreateContainer, timestamp);
-if (instr_fmt_type == instr_fmt_paje) {
+ if (instr_fmt_type == instr_fmt_paje) {
stream << std::fixed << std::setprecision(TRACE_precision());
- stream << PAJE_CreateContainer;
+ stream << simgrid::instr::PAJE_CreateContainer;
stream << " ";
/* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
if (timestamp < 1e-12)
{
double timestamp = SIMIX_get_clock();
- XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, PAJE_DestroyContainer, timestamp);
+ XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, simgrid::instr::PAJE_DestroyContainer, timestamp);
-if (instr_fmt_type == instr_fmt_paje) {
+ if (instr_fmt_type == instr_fmt_paje) {
stream << std::fixed << std::setprecision(TRACE_precision());
- stream << PAJE_DestroyContainer;
+ stream << simgrid::instr::PAJE_DestroyContainer;
stream << " ";
/* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
if (timestamp < 1e-12)
}
}
-
-SetVariableEvent::SetVariableEvent (double timestamp, container_t container, Type* type, double value)
+simgrid::instr::SetVariableEvent::SetVariableEvent(double timestamp, container_t container, Type* type, double value)
{
this->event_type = PAJE_SetVariable;
this->timestamp = timestamp;
insert_into_buffer (this);
}
-void SetVariableEvent::print() {
+void simgrid::instr::SetVariableEvent::print()
+{
if (instr_fmt_type == instr_fmt_paje) {
XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
stream << std::fixed << std::setprecision(TRACE_precision());
}
}
-AddVariableEvent::AddVariableEvent (double timestamp, container_t container, Type* type, double value)
+simgrid::instr::AddVariableEvent::AddVariableEvent(double timestamp, container_t container, simgrid::instr::Type* type,
+ double value)
{
this->event_type = PAJE_AddVariable;
this->timestamp = timestamp;
insert_into_buffer (this);
}
-void AddVariableEvent::print() {
+void simgrid::instr::AddVariableEvent::print()
+{
if (instr_fmt_type == instr_fmt_paje) {
XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
stream << std::fixed << std::setprecision(TRACE_precision());
}
}
-SubVariableEvent::SubVariableEvent (double timestamp, container_t container, Type* type, double value)
+simgrid::instr::SubVariableEvent::SubVariableEvent(double timestamp, container_t container, Type* type, double value)
{
this->event_type = PAJE_SubVariable;
this->timestamp = timestamp;
insert_into_buffer (this);
}
-void SubVariableEvent::print() {
+void simgrid::instr::SubVariableEvent::print()
+{
if (instr_fmt_type == instr_fmt_paje) {
XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
stream << std::fixed << std::setprecision(TRACE_precision());
}
}
-SetStateEvent::SetStateEvent(double timestamp, container_t container, Type* type, Value* val)
+simgrid::instr::SetStateEvent::SetStateEvent(double timestamp, container_t container, Type* type, Value* val)
{
this->event_type = PAJE_SetState;
this->timestamp = timestamp;
insert_into_buffer (this);
}
-void SetStateEvent::print() {
+void simgrid::instr::SetStateEvent::print()
+{
if (instr_fmt_type == instr_fmt_paje) {
XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
stream << std::fixed << std::setprecision(TRACE_precision());
}
}
-PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* val, void* extra)
+simgrid::instr::PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* val,
+ void* extra)
{
this->event_type = PAJE_PushState;
this->timestamp = timestamp;
insert_into_buffer (this);
}
-PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* val)
+simgrid::instr::PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* val)
: PushStateEvent(timestamp, container, type, val, nullptr)
{}
-void PushStateEvent::print() {
+void simgrid::instr::PushStateEvent::print()
+{
if (instr_fmt_type == instr_fmt_paje) {
XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
stream << std::fixed << std::setprecision(TRACE_precision());
}
}
-
-PopStateEvent::PopStateEvent (double timestamp, container_t container, Type* type)
+simgrid::instr::PopStateEvent::PopStateEvent(double timestamp, container_t container, Type* type)
{
this->event_type = PAJE_PopState;
this->timestamp = timestamp;
insert_into_buffer (this);
}
-void PopStateEvent::print() {
+void simgrid::instr::PopStateEvent::print()
+{
if (instr_fmt_type == instr_fmt_paje) {
XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
stream << std::fixed << std::setprecision(TRACE_precision());
}
}
-ResetStateEvent::ResetStateEvent (double timestamp, container_t container, Type* type)
+simgrid::instr::ResetStateEvent::ResetStateEvent(double timestamp, container_t container, Type* type)
{
this->event_type = PAJE_ResetState;
this->timestamp = timestamp;
delete[] this;
}
-void ResetStateEvent::print() {
+void simgrid::instr::ResetStateEvent::print()
+{
if (instr_fmt_type == instr_fmt_paje) {
XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
stream << std::fixed << std::setprecision(TRACE_precision());
}
}
-StartLinkEvent::~StartLinkEvent()
+simgrid::instr::StartLinkEvent::~StartLinkEvent()
{
free(value);
free(key);
}
-StartLinkEvent::StartLinkEvent (double timestamp, container_t container,
- Type* type, container_t sourceContainer, const char *value, const char *key)
- : StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1)
+simgrid::instr::StartLinkEvent::StartLinkEvent(double timestamp, container_t container, Type* type,
+ container_t sourceContainer, const char* value, const char* key)
+ : StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1)
{}
-StartLinkEvent::StartLinkEvent (double timestamp, container_t container, Type* type, container_t sourceContainer,
- const char *value, const char *key, int size)
+simgrid::instr::StartLinkEvent::StartLinkEvent(double timestamp, container_t container, Type* type,
+ container_t sourceContainer, const char* value, const char* key,
+ int size)
{
event_type = PAJE_StartLink;
this->timestamp = timestamp;
insert_into_buffer (this);
}
-void StartLinkEvent::print() {
+void simgrid::instr::StartLinkEvent::print()
+{
if (instr_fmt_type == instr_fmt_paje) {
XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
stream << std::fixed << std::setprecision(TRACE_precision());
}
}
-EndLinkEvent::EndLinkEvent (double timestamp, container_t container, Type* type, container_t destContainer,
- const char *value, const char *key)
+simgrid::instr::EndLinkEvent::EndLinkEvent(double timestamp, container_t container, Type* type,
+ container_t destContainer, const char* value, const char* key)
{
this->event_type = PAJE_EndLink;
this->timestamp = timestamp;
insert_into_buffer (this);
}
-EndLinkEvent::~EndLinkEvent()
+simgrid::instr::EndLinkEvent::~EndLinkEvent()
{
free(value);
free(key);
}
-void EndLinkEvent::print() {
+void simgrid::instr::EndLinkEvent::print()
+{
if (instr_fmt_type == instr_fmt_paje) {
XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
stream << std::fixed << std::setprecision(TRACE_precision());
}
}
-NewEvent::NewEvent(double timestamp, container_t container, Type* type, Value* val)
+simgrid::instr::NewEvent::NewEvent(double timestamp, container_t container, Type* type, Value* val)
{
this->event_type = PAJE_NewEvent;
this->timestamp = timestamp;
insert_into_buffer (this);
}
-void NewEvent::print () {
+void simgrid::instr::NewEvent::print()
+{
if (instr_fmt_type == instr_fmt_paje) {
XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
stream << std::fixed << std::setprecision(TRACE_precision());
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_types, instr, "Paje tracing event system (types)");
-static Type* rootType = nullptr; /* the root type */
+static simgrid::instr::Type* rootType = nullptr; /* the root type */
void PJ_type_release ()
{
rootType = nullptr;
}
-Type* PJ_type_get_root()
+simgrid::instr::Type* PJ_type_get_root()
{
return rootType;
}
-Type::Type (const char *typeNameBuff, const char *key, const char *color, e_entity_types kind, Type* father)
+simgrid::instr::Type::Type(const char* typeNameBuff, const char* key, const char* color, e_entity_types kind,
+ Type* father)
{
if (typeNameBuff == nullptr || key == nullptr){
THROWF(tracing_error, 0, "can't create a new type with name or key equal nullptr");
}
}
-void PJ_type_free(Type* type)
+void PJ_type_free(simgrid::instr::Type* type)
{
- Value* val;
+ simgrid::instr::Value* val;
char *value_name;
xbt_dict_cursor_t cursor = nullptr;
xbt_dict_foreach (type->values, cursor, value_name, val) {
type = nullptr;
}
-void recursiveDestroyType(Type* type)
+void recursiveDestroyType(simgrid::instr::Type* type)
{
XBT_DEBUG("recursiveDestroyType %s", type->name);
xbt_dict_cursor_t cursor = nullptr;
- Type* child;
+ simgrid::instr::Type* child;
char *child_name;
xbt_dict_foreach(type->children, cursor, child_name, child) {
recursiveDestroyType (child);
PJ_type_free(type);
}
-Type* PJ_type_get(const char* name, Type* father)
+simgrid::instr::Type* PJ_type_get(const char* name, simgrid::instr::Type* father)
{
- Type* ret = Type::getOrNull (name, father);
+ simgrid::instr::Type* ret = simgrid::instr::Type::getOrNull(name, father);
if (ret == nullptr){
THROWF (tracing_error, 2, "type with name (%s) not found in father type (%s)", name, father->name);
}
return ret;
}
-Type* Type::getOrNull(const char* name, Type* father)
+simgrid::instr::Type* simgrid::instr::Type::getOrNull(const char* name, simgrid::instr::Type* father)
{
if (name == nullptr || father == nullptr){
THROWF (tracing_error, 0, "can't get type with a nullptr name or from a nullptr father");
}
- Type* ret = nullptr;
- Type* child;
+ simgrid::instr::Type* ret = nullptr;
+ simgrid::instr::Type* child;
char *child_name;
xbt_dict_cursor_t cursor = nullptr;
xbt_dict_foreach(father->children, cursor, child_name, child) {
return ret;
}
-Type* Type::containerNew(const char* name, Type* father)
+simgrid::instr::Type* simgrid::instr::Type::containerNew(const char* name, simgrid::instr::Type* father)
{
if (name == nullptr){
THROWF (tracing_error, 0, "can't create a container type with a nullptr name");
}
- Type* ret = new Type (name, name, nullptr, TYPE_CONTAINER, father);
+ simgrid::instr::Type* ret = new simgrid::instr::Type(name, name, nullptr, TYPE_CONTAINER, father);
if (father == nullptr) {
rootType = ret;
} else {
return ret;
}
-Type* Type::eventNew(const char* name, Type* father)
+simgrid::instr::Type* simgrid::instr::Type::eventNew(const char* name, simgrid::instr::Type* father)
{
if (name == nullptr){
THROWF (tracing_error, 0, "can't create an event type with a nullptr name");
return ret;
}
-Type* Type::variableNew(const char* name, const char* color, Type* father)
+simgrid::instr::Type* simgrid::instr::Type::variableNew(const char* name, const char* color,
+ simgrid::instr::Type* father)
{
if (name == nullptr){
THROWF (tracing_error, 0, "can't create a variable type with a nullptr name");
return ret;
}
-Type* Type::linkNew(const char* name, Type* father, Type* source, Type* dest)
+simgrid::instr::Type* simgrid::instr::Type::linkNew(const char* name, Type* father, Type* source, Type* dest)
{
if (name == nullptr){
THROWF (tracing_error, 0, "can't create a link type with a nullptr name");
return ret;
}
-Type* Type::stateNew(const char* name, Type* father)
+simgrid::instr::Type* simgrid::instr::Type::stateNew(const char* name, Type* father)
{
if (name == nullptr){
THROWF (tracing_error, 0, "can't create a state type with a nullptr name");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
-Value::Value(const char* name, const char* color, Type* father)
+simgrid::instr::Value::Value(const char* name, const char* color, simgrid::instr::Type* father)
{
if (name == nullptr || father == nullptr){
THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)");
LogEntityValue(this->ret);
};
-Value::~Value()
+simgrid::instr::Value::~Value()
{
/* FIXME: this should be cleanable
xbt_free(name);
*/
}
-Value* Value::get_or_new(const char* name, const char* color, Type* father)
+simgrid::instr::Value* simgrid::instr::Value::get_or_new(const char* name, const char* color,
+ simgrid::instr::Type* father)
{
Value* ret = 0;
try {
return ret;
}
-Value* Value::get(const char* name, Type* father)
+simgrid::instr::Value* simgrid::instr::Value::get(const char* name, Type* father)
{
if (name == nullptr || father == nullptr){
THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)");
#include "xbt/graph.h"
#include "xbt/dict.h"
+namespace simgrid {
+namespace instr {
typedef enum {
PAJE_DefineContainerType,
PAJE_DefineVariableType,
} e_container_types;
//--------------------------------------------------
-class s_container;
-typedef s_container *container_t;
class s_container {
public:
class SetVariableEvent : public PajeEvent {
private:
- container_t container;
- Type* type;
- double value;
+ s_container* container;
+ Type* type;
+ double value;
+
public:
- SetVariableEvent(double timestamp, container_t container, Type* type, double value);
+ SetVariableEvent(double timestamp, s_container* container, Type* type, double value);
void print() override;
};
class AddVariableEvent:public PajeEvent {
private:
- container_t container;
- Type* type;
- double value;
+ s_container* container;
+ Type* type;
+ double value;
+
public:
- AddVariableEvent(double timestamp, container_t container, Type* type, double value);
+ AddVariableEvent(double timestamp, s_container* container, Type* type, double value);
void print() override;
};
class SubVariableEvent : public PajeEvent {
private:
- container_t container;
- Type* type;
- double value;
+ s_container* container;
+ Type* type;
+ double value;
+
public:
- SubVariableEvent(double timestamp, container_t container, Type* type, double value);
+ SubVariableEvent(double timestamp, s_container* container, Type* type, double value);
void print() override;
};
//--------------------------------------------------
class SetStateEvent : public PajeEvent {
private:
- container_t container;
- Type* type;
- Value* val;
- const char* filename;
- int linenumber;
+ s_container* container;
+ Type* type;
+ Value* val;
+ const char* filename;
+ int linenumber;
+
public:
- SetStateEvent(double timestamp, container_t container, Type* type, Value* val);
+ SetStateEvent(double timestamp, s_container* container, Type* type, Value* val);
void print() override;
};
class PushStateEvent : public PajeEvent {
public:
- container_t container;
- Type* type;
- Value* val;
- int size;
- const char* filename;
- int linenumber;
- void* extra_;
+ s_container* container;
+ Type* type;
+ Value* val;
+ int size;
+ const char* filename;
+ int linenumber;
+ void* extra_;
+
public:
- PushStateEvent(double timestamp, container_t container, Type* type, Value* val);
- PushStateEvent(double timestamp, container_t container, Type* type, Value* val, void* extra);
+ PushStateEvent(double timestamp, s_container* container, Type* type, Value* val);
+ PushStateEvent(double timestamp, s_container* container, Type* type, Value* val, void* extra);
void print() override;
};
class PopStateEvent : public PajeEvent {
- container_t container;
+ s_container* container;
Type* type;
public:
- PopStateEvent(double timestamp, container_t container, Type* type);
+ PopStateEvent(double timestamp, s_container* container, Type* type);
void print() override;
};
class ResetStateEvent : public PajeEvent {
- container_t container;
+ s_container* container;
Type* type;
public:
- ResetStateEvent(double timestamp, container_t container, Type* type);
+ ResetStateEvent(double timestamp, s_container* container, Type* type);
void print() override;
};
class StartLinkEvent : public PajeEvent {
public:
- container_t container;
- Type* type;
- container_t sourceContainer;
- char *value;
- char *key;
- int size;
+ s_container* container;
+ Type* type;
+ s_container* sourceContainer;
+ char* value;
+ char* key;
+ int size;
+
public:
~StartLinkEvent();
- StartLinkEvent(double timestamp, container_t container, Type* type, container_t sourceContainer, const char* value,
- const char* key);
- StartLinkEvent(double timestamp, container_t container, Type* type, container_t sourceContainer, const char* value,
- const char* key, int size);
+ StartLinkEvent(double timestamp, s_container* container, Type* type, s_container* sourceContainer,
+ const char* value, const char* key);
+ StartLinkEvent(double timestamp, s_container* container, Type* type, s_container* sourceContainer,
+ const char* value, const char* key, int size);
void print() override;
};
class EndLinkEvent : public PajeEvent {
- container_t container;
+ s_container* container;
Type* type;
- container_t destContainer;
+ s_container* destContainer;
char *value;
char *key;
public:
- EndLinkEvent(double timestamp, container_t container, Type* type, container_t destContainer, const char* value,
+ EndLinkEvent(double timestamp, s_container* container, Type* type, s_container* destContainer, const char* value,
const char* key);
~EndLinkEvent();
void print() override;
class NewEvent : public PajeEvent {
public:
- container_t container;
- Type* type;
- Value* val;
-
-public:
- NewEvent(double timestamp, container_t container, Type* type, Value* val);
- void print() override;
+ s_container* container;
+ Type* type;
+ Value* val;
+ public:
+ NewEvent(double timestamp, s_container* container, Type* type, Value* val);
+ void print() override;
};
extern XBT_PRIVATE std::set<std::string> created_categories;
extern XBT_PRIVATE std::set<std::string> user_vm_variables;
extern XBT_PRIVATE std::set<std::string> user_link_variables;
extern XBT_PRIVATE double TRACE_last_timestamp_to_dump;
+}
+} // namespace simgrid::instr
+typedef simgrid::instr::s_container* container_t;
/* instr_paje_header.c */
XBT_PRIVATE void TRACE_header(int basic, int size);
XBT_PRIVATE long long int instr_new_paje_id ();
XBT_PRIVATE void PJ_container_alloc ();
XBT_PRIVATE void PJ_container_release ();
-XBT_PUBLIC(container_t) PJ_container_new (const char *name, e_container_types kind, container_t father);
+XBT_PUBLIC(container_t) PJ_container_new(const char* name, simgrid::instr::e_container_types kind, container_t father);
XBT_PUBLIC(container_t) PJ_container_get (const char *name);
XBT_PUBLIC(container_t) PJ_container_get_or_null (const char *name);
XBT_PUBLIC(container_t) PJ_container_get_root ();
/* instr_paje_types.c */
XBT_PRIVATE void PJ_type_release ();
-XBT_PUBLIC(Type*) PJ_type_get_root();
-XBT_PUBLIC(Type*) PJ_type_get(const char* name, Type* father);
-XBT_PRIVATE XBT_PRIVATE void PJ_type_free(Type* type);
+XBT_PUBLIC(simgrid::instr::Type*) PJ_type_get_root();
+XBT_PUBLIC(simgrid::instr::Type*) PJ_type_get(const char* name, simgrid::instr::Type* father);
+XBT_PRIVATE XBT_PRIVATE void PJ_type_free(simgrid::instr::Type* type);
/* instr_config.c */
-XBT_PRIVATE void recursiveDestroyType(Type* type);
+XBT_PRIVATE void recursiveDestroyType(simgrid::instr::Type* type);
XBT_PRIVATE void TRACE_TI_start();
XBT_PRIVATE void TRACE_TI_end();
SG_END_DECL()
-void DefineContainerEvent(Type* type);
-void LogVariableTypeDefinition(Type* type);
-void LogStateTypeDefinition(Type* type);
-void LogLinkTypeDefinition(Type* type, Type* source, Type* dest);
-void LogEntityValue(Value* val);
+void DefineContainerEvent(simgrid::instr::Type* type);
+void LogVariableTypeDefinition(simgrid::instr::Type* type);
+void LogStateTypeDefinition(simgrid::instr::Type* type);
+void LogLinkTypeDefinition(simgrid::instr::Type* type, simgrid::instr::Type* source, simgrid::instr::Type* dest);
+void LogEntityValue(simgrid::instr::Value* val);
void LogContainerCreation (container_t container);
void LogContainerDestruction (container_t container);
-void LogDefineEventType(Type* type);
+void LogDefineEventType(simgrid::instr::Type* type);
#endif
// check if key exists: if it doesn't, set the variable to zero and mark this in the dict
if (platform_variables.find(key) == platform_variables.end()) {
container_t container = PJ_container_get (resource);
- Type* type = PJ_type_get (variable, container->type);
- new SetVariableEvent (now, container, type, 0);
+ simgrid::instr::Type* type = PJ_type_get(variable, container->type);
+ new simgrid::instr::SetVariableEvent(now, container, type, 0);
platform_variables[key] = std::string("");
}
}
-static void instr_event (double now, double delta, Type* variable, container_t resource, double value)
+static void instr_event(double now, double delta, simgrid::instr::Type* variable, container_t resource, double value)
{
__TRACE_surf_check_variable_set_to_zero(now, variable->name, resource->name);
- new AddVariableEvent(now, resource, variable, value);
- new SubVariableEvent(now + delta, resource, variable, value);
+ new simgrid::instr::AddVariableEvent(now, resource, variable, value);
+ new simgrid::instr::SubVariableEvent(now + delta, resource, variable, value);
}
/* TRACE_surf_link_set_utilization: entry point from SimGrid */
if (TRACE_uncategorized()){
XBT_DEBUG("UNCAT LINK [%f - %f] %s bandwidth_used %f", now, now+delta, resource, value);
container_t container = PJ_container_get (resource);
- Type* type = PJ_type_get ("bandwidth_used", container->type);
+ simgrid::instr::Type* type = PJ_type_get("bandwidth_used", container->type);
instr_event (now, delta, type, container, value);
}
snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "b%s", category);
XBT_DEBUG("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, category_type, value);
container_t container = PJ_container_get (resource);
- Type* type = PJ_type_get (category_type, container->type);
+ simgrid::instr::Type* type = PJ_type_get(category_type, container->type);
instr_event (now, delta, type, container, value);
}
}
//trace uncategorized host utilization
if (TRACE_uncategorized()){
XBT_DEBUG("UNCAT HOST [%f - %f] %s power_used %f", now, now+delta, resource, value);
- Type* type = PJ_type_get ("power_used", container->type);
+ simgrid::instr::Type* type = PJ_type_get("power_used", container->type);
instr_event (now, delta, type, container, value);
}
char category_type[INSTR_DEFAULT_STR_SIZE];
snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "p%s", category);
XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, category_type, value);
- Type* type = PJ_type_get (category_type, container->type);
+ simgrid::instr::Type* type = PJ_type_get(category_type, container->type);
instr_event (now, delta, type, container, value);
}
}
//start link
container_t msg = PJ_container_get (instr_process_id(process, str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root());
- new StartLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_LINK", PJ_type_get_root());
+ new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
//destroy existing container of this process
TRACE_msg_process_destroy (MSG_process_get_name (process), MSG_process_get_PID (process));
//end link
msg = PJ_container_get(instr_process_id(process, str, len));
type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root());
- new EndLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
}
}
char str[INSTR_DEFAULT_STR_SIZE];
container_t host_container = PJ_container_get(host->getCname());
- PJ_container_new(instr_process_id_2(process_name, process_pid, str, len), INSTR_MSG_PROCESS, host_container);
+ PJ_container_new(instr_process_id_2(process_name, process_pid, str, len), simgrid::instr::INSTR_MSG_PROCESS,
+ host_container);
}
}
char str[INSTR_DEFAULT_STR_SIZE];
container_t process_container = PJ_container_get (instr_process_id(process, str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- Value* val = Value::get("suspend", type);
- new PushStateEvent(MSG_get_clock(), process_container, type, val);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get("suspend", type);
+ new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
}
}
char str[INSTR_DEFAULT_STR_SIZE];
container_t process_container = PJ_container_get (instr_process_id(process, str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- new PopStateEvent (MSG_get_clock(), process_container, type);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type);
+ new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
}
}
char str[INSTR_DEFAULT_STR_SIZE];
container_t process_container = PJ_container_get (instr_process_id(process, str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- Value* val = Value::get("sleep", type);
- new PushStateEvent(MSG_get_clock(), process_container, type, val);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get("sleep", type);
+ new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
}
}
char str[INSTR_DEFAULT_STR_SIZE];
container_t process_container = PJ_container_get (instr_process_id(process, str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- new PopStateEvent (MSG_get_clock(), process_container, type);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type);
+ new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
}
}
char str[INSTR_DEFAULT_STR_SIZE];
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- Value* val = Value::get("task_execute", type);
- new PushStateEvent(MSG_get_clock(), process_container, type, val);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get("task_execute", type);
+ new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
}
}
char str[INSTR_DEFAULT_STR_SIZE];
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- new PopStateEvent (MSG_get_clock(), process_container, type);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type);
+ new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
}
}
char str[INSTR_DEFAULT_STR_SIZE];
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- Value* val = Value::get("receive", type);
- new PushStateEvent(MSG_get_clock(), process_container, type, val);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get("receive", type);
+ new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
}
}
char str[INSTR_DEFAULT_STR_SIZE];
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- new PopStateEvent (MSG_get_clock(), process_container, type);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type);
+ new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
char key[INSTR_DEFAULT_STR_SIZE];
snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
type = PJ_type_get ("MSG_PROCESS_TASK_LINK", PJ_type_get_root());
- new EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
+ new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
}
}
char str[INSTR_DEFAULT_STR_SIZE];
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- Value* val = Value::get("send", type);
- new PushStateEvent(MSG_get_clock(), process_container, type, val);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get("send", type);
+ new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
char key[INSTR_DEFAULT_STR_SIZE];
snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
type = PJ_type_get ("MSG_PROCESS_TASK_LINK", PJ_type_get_root());
- new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
+ new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
}
return 1;
char str[INSTR_DEFAULT_STR_SIZE];
container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
- Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
- new PopStateEvent (MSG_get_clock(), process_container, type);
+ simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type);
+ new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
}
}
vm->start();
if (TRACE_msg_vm_is_enabled()) {
container_t vm_container = PJ_container_get(vm->getCname());
- Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type);
- Value* val = Value::get_or_new("start", "0 0 1", type); // start is blue
- new PushStateEvent(MSG_get_clock(), vm_container, type, val);
+ simgrid::instr::Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("start", "0 0 1", type); // start is blue
+ new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, type, val);
}
}
// start link
container_t msg = PJ_container_get(vm->getCname());
- Type* type = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
- new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ simgrid::instr::Type* type = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
+ new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
// destroy existing container of this vm
container_t existing_container = PJ_container_get(vm->getCname());
PJ_container_free(existing_container);
// create new container on the new_host location
- PJ_container_new(vm->getCname(), INSTR_MSG_VM, PJ_container_get(ms->dst_pm->getCname()));
+ PJ_container_new(vm->getCname(), simgrid::instr::INSTR_MSG_VM, PJ_container_get(ms->dst_pm->getCname()));
// end link
msg = PJ_container_get(vm->getCname());
type = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
- new EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
}
// Inform the SRC that the migration has been correctly performed
if (TRACE_msg_vm_is_enabled()) {
container_t vm_container = PJ_container_get(vm->getCname());
- Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type);
- Value* val = Value::get_or_new("suspend", "1 0 0", type); // suspend is red
- new PushStateEvent(MSG_get_clock(), vm_container, type, val);
+ simgrid::instr::Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("suspend", "1 0 0", type); // suspend is red
+ new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, type, val);
}
}
if (TRACE_msg_vm_is_enabled()) {
container_t vm_container = PJ_container_get(vm->getCname());
- Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type);
- new PopStateEvent(MSG_get_clock(), vm_container, type);
+ simgrid::instr::Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type);
+ new simgrid::instr::PopStateEvent(MSG_get_clock(), vm_container, type);
}
}
if (TRACE_msg_vm_is_enabled()) {
container_t host_container = PJ_container_get(pm->getCname());
- PJ_container_new(name, INSTR_MSG_VM, host_container);
+ PJ_container_new(name, simgrid::instr::INSTR_MSG_VM, host_container);
}
}
#define TRACE_AUTO_COLL(cat) \
if (TRACE_is_enabled()) { \
- Type* type = Type::getOrNull(#cat, PJ_type_get_root()); \
+ simgrid::instr::Type* type = simgrid::instr::Type::getOrNull(#cat, PJ_type_get_root()); \
if (not type) { \
- type = Type::eventNew(#cat, PJ_type_get_root()); \
+ type = simgrid::instr::Type::eventNew(#cat, PJ_type_get_root()); \
} \
char cont_name[25]; \
snprintf(cont_name, 25, "rank-%d", smpi_process()->index()); \
- Value* val = Value::get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type); \
- new NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, val); \
+ simgrid::instr::Value* val = \
+ simgrid::instr::Value::get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type); \
+ new simgrid::instr::NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, val); \
}
#define AUTOMATIC_COLL_BENCH(cat, ret, args, args2) \
#if HAVE_PAPI
container_t container =
#endif
- PJ_container_new(str, INSTR_SMPI, father);
+ PJ_container_new(str, simgrid::instr::INSTR_SMPI, father);
#if HAVE_PAPI
papi_counter_t counters = smpi_process()->papi_counters();
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
const char *color = instr_find_color (operation);
- Value* val = Value::get_or_new(operation, color, type);
- new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
+ simgrid::instr::Value* val = simgrid::instr::Value::get_or_new(operation, color, type);
+ new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
}
void TRACE_smpi_collective_out(int rank, const char *operation)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
- new PopStateEvent (SIMIX_get_clock(), container, type);
+ new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
}
void TRACE_smpi_computing_init(int rank)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get(str);
- Type* type = PJ_type_get("MPI_STATE", container->type);
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
const char* color = instr_find_color("computing");
- new PushStateEvent(SIMIX_get_clock(), container, type, Value::get_or_new("computing", color, type));
+ new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type,
+ simgrid::instr::Value::get_or_new("computing", color, type));
}
void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
- Value* val = Value::get_or_new("computing", nullptr, type);
- new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("computing", nullptr, type);
+ new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
}
void TRACE_smpi_computing_out(int rank)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
- new PopStateEvent (SIMIX_get_clock(), container, type);
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
+ new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
}
void TRACE_smpi_sleeping_init(int rank)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
const char *color = instr_find_color ("sleeping");
- Value* val = Value::get_or_new("sleeping", color, type);
- new PushStateEvent(SIMIX_get_clock(), container, type, val);
+ simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("sleeping", color, type);
+ new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val);
}
void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
- Value* val = Value::get_or_new("sleeping", nullptr, type);
- new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("sleeping", nullptr, type);
+ new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
}
void TRACE_smpi_sleeping_out(int rank)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
- new PopStateEvent (SIMIX_get_clock(), container, type);
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
+ new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
}
void TRACE_smpi_testing_in(int rank, instr_extra_data extra)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
- Value* val = Value::get_or_new("test", nullptr, type);
- new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
+ simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("test", nullptr, type);
+ new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
}
void TRACE_smpi_testing_out(int rank)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
- new PopStateEvent (SIMIX_get_clock(), container, type);
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
+ new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
}
void TRACE_smpi_ptp_in(int rank, const char *operation, instr_extra_data extra)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
const char *color = instr_find_color (operation);
- Value* val = Value::get_or_new(operation, color, type);
- new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
+ simgrid::instr::Value* val = simgrid::instr::Value::get_or_new(operation, color, type);
+ new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
}
void TRACE_smpi_ptp_out(int rank, int dst, const char *operation)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_STATE", container->type);
+ simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type);
- new PopStateEvent (SIMIX_get_clock(), container, type);
+ new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
}
void TRACE_smpi_send(int rank, int src, int dst, int tag, int size)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(src, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
+ simgrid::instr::Type* type = PJ_type_get("MPI_LINK", PJ_type_get_root());
XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
- new StartLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
+ new simgrid::instr::StartLinkEvent(SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
}
void TRACE_smpi_recv(int src, int dst, int tag)
char str[INSTR_DEFAULT_STR_SIZE];
smpi_container(dst, str, INSTR_DEFAULT_STR_SIZE);
container_t container = PJ_container_get (str);
- Type* type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
+ simgrid::instr::Type* type = PJ_type_get("MPI_LINK", PJ_type_get_root());
XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
- new EndLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
+ new simgrid::instr::EndLinkEvent(SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
}
smaller = action->getLastUpdate();
}
if (smaller > 0) {
- TRACE_last_timestamp_to_dump = smaller;
+ simgrid::instr::TRACE_last_timestamp_to_dump = smaller;
}
}
}
TRACE_surf_host_set_utilization(cpu->cname(), action->getCategory(), lmm_variable_getvalue(action->getVariable()),
now - delta, delta);
- TRACE_last_timestamp_to_dump = now - delta;
+ simgrid::instr::TRACE_last_timestamp_to_dump = now - delta;
}
action->updateRemains(lmm_variable_getvalue(action->getVariable()) * delta);
father->type->name,
src->type->name, src->type->id,
dst->type->name, dst->type->id);
- Type* link_type = Type::getOrNull (link_typename, father->type);
+ simgrid::instr::Type* link_type = simgrid::instr::Type::getOrNull(link_typename, father->type);
if (link_type == nullptr){
- link_type = Type::linkNew (link_typename, father->type, src->type, dst->type);
+ link_type = simgrid::instr::Type::linkNew(link_typename, father->type, src->type, dst->type);
}
//register EDGE types for triva configuration
snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter);
counter++;
- new StartLinkEvent(SIMIX_get_clock(), father, link_type, src, "topology", key);
- new EndLinkEvent(SIMIX_get_clock(), father, link_type, dst, "topology", key);
+ new simgrid::instr::StartLinkEvent(SIMIX_get_clock(), father, link_type, src, "topology", key);
+ new simgrid::instr::EndLinkEvent(SIMIX_get_clock(), father, link_type, dst, "topology", key);
XBT_DEBUG (" linkContainers %s <-> %s", src->name, dst->name);
}
if (PJ_container_get_root() == nullptr){
PJ_container_alloc ();
- container_t root = PJ_container_new (id, INSTR_AS, nullptr);
+ container_t root = PJ_container_new(id, simgrid::instr::INSTR_AS, nullptr);
PJ_container_set_root (root);
if (TRACE_smpi_is_enabled()) {
- Type* mpi = Type::getOrNull ("MPI", root->type);
+ simgrid::instr::Type* mpi = simgrid::instr::Type::getOrNull("MPI", root->type);
if (mpi == nullptr){
- mpi = Type::containerNew("MPI", root->type);
+ mpi = simgrid::instr::Type::containerNew("MPI", root->type);
if (not TRACE_smpi_is_grouped())
- Type::stateNew ("MPI_STATE", mpi);
- Type::linkNew ("MPI_LINK", PJ_type_get_root(), mpi, mpi);
+ simgrid::instr::Type::stateNew("MPI_STATE", mpi);
+ simgrid::instr::Type::linkNew("MPI_LINK", PJ_type_get_root(), mpi, mpi);
}
}
if (TRACE_needs_platform()){
container_t father = currentContainer.back();
- container_t container = PJ_container_new (id, INSTR_AS, father);
+ container_t container = PJ_container_new(id, simgrid::instr::INSTR_AS, father);
currentContainer.push_back(container);
}
}
double bandwidth_value = link.bandwidth();
double latency_value = link.latency();
- container_t container = PJ_container_new(link.name(), INSTR_LINK, father);
+ container_t container = PJ_container_new(link.name(), simgrid::instr::INSTR_LINK, father);
if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) {
- Type* bandwidth = Type::getOrNull("bandwidth", container->type);
+ simgrid::instr::Type* bandwidth = simgrid::instr::Type::getOrNull("bandwidth", container->type);
if (bandwidth == nullptr) {
- bandwidth = Type::variableNew("bandwidth", nullptr, container->type);
+ bandwidth = simgrid::instr::Type::variableNew("bandwidth", nullptr, container->type);
}
- Type* latency = Type::getOrNull("latency", container->type);
+ simgrid::instr::Type* latency = simgrid::instr::Type::getOrNull("latency", container->type);
if (latency == nullptr) {
- latency = Type::variableNew("latency", nullptr, container->type);
+ latency = simgrid::instr::Type::variableNew("latency", nullptr, container->type);
}
- new SetVariableEvent(0, container, bandwidth, bandwidth_value);
- new SetVariableEvent(0, container, latency, latency_value);
+ new simgrid::instr::SetVariableEvent(0, container, bandwidth, bandwidth_value);
+ new simgrid::instr::SetVariableEvent(0, container, latency, latency_value);
}
if (TRACE_uncategorized()) {
- Type* bandwidth_used = Type::getOrNull("bandwidth_used", container->type);
+ simgrid::instr::Type* bandwidth_used = simgrid::instr::Type::getOrNull("bandwidth_used", container->type);
if (bandwidth_used == nullptr) {
- Type::variableNew("bandwidth_used", "0.5 0.5 0.5", container->type);
+ simgrid::instr::Type::variableNew("bandwidth_used", "0.5 0.5 0.5", container->type);
}
}
}
static void sg_instr_new_host(simgrid::s4u::Host& host)
{
container_t father = currentContainer.back();
- container_t container = PJ_container_new(host.getCname(), INSTR_HOST, father);
+ container_t container = PJ_container_new(host.getCname(), simgrid::instr::INSTR_HOST, father);
if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) {
- Type* speed = Type::getOrNull ("power", container->type);
+ simgrid::instr::Type* speed = simgrid::instr::Type::getOrNull("power", container->type);
if (speed == nullptr){
- speed = Type::variableNew ("power", nullptr, container->type);
+ speed = simgrid::instr::Type::variableNew("power", nullptr, container->type);
}
double current_speed_state = host.getSpeed();
- new SetVariableEvent (0, container, speed, current_speed_state);
+ new simgrid::instr::SetVariableEvent(0, container, speed, current_speed_state);
}
if (TRACE_uncategorized()){
- Type* speed_used = Type::getOrNull ("power_used", container->type);
+ simgrid::instr::Type* speed_used = simgrid::instr::Type::getOrNull("power_used", container->type);
if (speed_used == nullptr){
- Type::variableNew ("power_used", "0.5 0.5 0.5", container->type);
+ simgrid::instr::Type::variableNew("power_used", "0.5 0.5 0.5", container->type);
}
}
if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()){
- Type* mpi = Type::getOrNull ("MPI", container->type);
+ simgrid::instr::Type* mpi = simgrid::instr::Type::getOrNull("MPI", container->type);
if (mpi == nullptr){
- mpi = Type::containerNew("MPI", container->type);
- Type::stateNew ("MPI_STATE", mpi);
+ mpi = simgrid::instr::Type::containerNew("MPI", container->type);
+ simgrid::instr::Type::stateNew("MPI_STATE", mpi);
}
}
if (TRACE_msg_process_is_enabled()) {
- Type* msg_process = Type::getOrNull ("MSG_PROCESS", container->type);
+ simgrid::instr::Type* msg_process = simgrid::instr::Type::getOrNull("MSG_PROCESS", container->type);
if (msg_process == nullptr){
- msg_process = Type::containerNew("MSG_PROCESS", container->type);
- Type* state = Type::stateNew ("MSG_PROCESS_STATE", msg_process);
- Value PJ_value("suspend", "1 0 1", state);
- Value::get_or_new("sleep", "1 1 0", state);
- Value::get_or_new("receive", "1 0 0", state);
- Value::get_or_new("send", "0 0 1", state);
- Value::get_or_new("task_execute", "0 1 1", state);
- Type::linkNew ("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
- Type::linkNew ("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
+ msg_process = simgrid::instr::Type::containerNew("MSG_PROCESS", container->type);
+ simgrid::instr::Type* state = simgrid::instr::Type::stateNew("MSG_PROCESS_STATE", msg_process);
+ simgrid::instr::Value PJ_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::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 (TRACE_msg_vm_is_enabled()) {
- Type* msg_vm = Type::getOrNull ("MSG_VM", container->type);
+ simgrid::instr::Type* msg_vm = simgrid::instr::Type::getOrNull("MSG_VM", container->type);
if (msg_vm == nullptr){
- msg_vm = Type::containerNew("MSG_VM", container->type);
- Type* state = Type::stateNew ("MSG_VM_STATE", msg_vm);
- Value PJ_value("suspend", "1 0 1", state);
- Value::get_or_new("sleep", "1 1 0", state);
- Value::get_or_new("receive", "1 0 0", state);
- Value::get_or_new("send", "0 0 1", state);
- Value::get_or_new("task_execute", "0 1 1", state);
- Type::linkNew ("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
- Type::linkNew ("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm);
+ msg_vm = simgrid::instr::Type::containerNew("MSG_VM", container->type);
+ simgrid::instr::Type* state = simgrid::instr::Type::stateNew("MSG_VM_STATE", msg_vm);
+ simgrid::instr::Value PJ_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::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);
}
}
return;
if (TRACE_is_enabled() && TRACE_needs_platform()) {
container_t father = currentContainer.back();
- PJ_container_new(netpoint->cname(), INSTR_ROUTER, father);
+ PJ_container_new(netpoint->cname(), simgrid::instr::INSTR_ROUTER, father);
}
}
/*
* user categories support
*/
-static void recursiveNewVariableType (const char *new_typename, const char *color, Type* root)
+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);
- Type::variableNew (tnstr, color, root);
+ simgrid::instr::Type::variableNew(tnstr, 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);
- Type::variableNew (tnstr, color, root);
+ simgrid::instr::Type::variableNew(tnstr, color, root);
}
if (not strcmp(root->name, "LINK")) {
char tnstr[INSTR_DEFAULT_STR_SIZE];
snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "b%s", new_typename);
- Type::variableNew (tnstr, color, root);
+ simgrid::instr::Type::variableNew(tnstr, color, root);
}
xbt_dict_cursor_t cursor = nullptr;
- Type* child_type;
+ 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, PJ_type_get_root());
}
-static void recursiveNewUserVariableType (const char *father_type, const char *new_typename, const char *color, Type* root)
+static void recursiveNewUserVariableType(const char* father_type, const char* new_typename, const char* color,
+ simgrid::instr::Type* root)
{
if (not strcmp(root->name, father_type)) {
- Type::variableNew (new_typename, color, root);
+ simgrid::instr::Type::variableNew(new_typename, color, root);
}
xbt_dict_cursor_t cursor = nullptr;
- Type* child_type;
+ simgrid::instr::Type* child_type;
char *name;
xbt_dict_foreach(root->children, cursor, name, child_type) {
recursiveNewUserVariableType (father_type, new_typename, color, child_type);
recursiveNewUserVariableType (father_type, new_typename, color, PJ_type_get_root());
}
-static void recursiveNewUserStateType (const char *father_type, const char *new_typename, Type* root)
+static void recursiveNewUserStateType(const char* father_type, const char* new_typename, simgrid::instr::Type* root)
{
if (not strcmp(root->name, father_type)) {
- Type::stateNew (new_typename, root);
+ simgrid::instr::Type::stateNew(new_typename, root);
}
xbt_dict_cursor_t cursor = nullptr;
- Type* child_type;
+ simgrid::instr::Type* child_type;
char *name;
xbt_dict_foreach(root->children, cursor, name, child_type) {
recursiveNewUserStateType (father_type, new_typename, child_type);
recursiveNewUserStateType (father_type, new_typename, PJ_type_get_root());
}
-static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color, Type* root)
+static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color,
+ simgrid::instr::Type* root)
{
if (not strcmp(root->name, type_name)) {
- Value PJ_value(val, color, root);
+ simgrid::instr::Value PJ_value(val, color, root);
}
xbt_dict_cursor_t cursor = nullptr;
- Type* child_type;
+ simgrid::instr::Type* child_type;
char *name;
xbt_dict_foreach(root->children, cursor, name, child_type) {
recursiveNewValueForUserStateType(type_name, val, color, child_type);
{
if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
container_t container = PJ_container_get(resource);
- Type* type = PJ_type_get ("power", container->type);
- new SetVariableEvent(date, container, type, speed);
+ simgrid::instr::Type* type = PJ_type_get("power", container->type);
+ new simgrid::instr::SetVariableEvent(date, container, type, speed);
}
}
{
if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
container_t container = PJ_container_get(resource);
- Type* type = PJ_type_get ("bandwidth", container->type);
- new SetVariableEvent(date, container, type, bandwidth);
+ simgrid::instr::Type* type = PJ_type_get("bandwidth", container->type);
+ new simgrid::instr::SetVariableEvent(date, container, type, bandwidth);
}
}