mark_color = "1.0 1.0 1.0" /*white*/;
XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color);
- type->addEntityValue(mark_value, mark_color);
+ static_cast<simgrid::instr::EventType*>(type)->addEntityValue(mark_value, mark_color);
}
}
THROWF (tracing_error, 1, "mark_value is nullptr");
//check if mark_type is already declared
- simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName(mark_type);
+ simgrid::instr::EventType* type =
+ static_cast<simgrid::instr::EventType*>(simgrid::instr::Type::getRootType()->byName(mark_type));
if (not type) {
THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
} else {
void TRACE_host_set_state(const char* host, const char* state_name, const char* value_name)
{
container_t container = simgrid::instr::Container::byName(host);
- simgrid::instr::Type* state = container->type_->byName(state_name);
+ simgrid::instr::StateType* state = static_cast<simgrid::instr::StateType*>(container->type_->byName(state_name));
state->addEntityValue(value_name);
new simgrid::instr::SetStateEvent(MSG_get_clock(), container, state, state->getEntityValue(value_name));
}
void TRACE_host_push_state(const char* host, const char* state_name, const char* value_name)
{
container_t container = simgrid::instr::Container::byName(host);
- simgrid::instr::Type* state = container->type_->byName(state_name);
+ simgrid::instr::StateType* state = static_cast<simgrid::instr::StateType*>(container->type_->byName(state_name));
state->addEntityValue(value_name);
new simgrid::instr::PushStateEvent(MSG_get_clock(), container, state, state->getEntityValue(value_name));
}
XBT_DEBUG("Filename %s is closed", filename);
}
-void simgrid::instr::Type::logContainerTypeDefinition()
-{
- 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__, simgrid::instr::PAJE_DefineContainerType,
- TRACE_precision(), 0.);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << simgrid::instr::PAJE_DefineContainerType;
- stream << " " << id_ << " " << father_->getId() << " " << name_;
- print_row();
- } else if (instr_fmt_type == instr_fmt_TI) {
- /* Nothing to do */
- } else {
- THROW_IMPOSSIBLE;
- }
-}
-
-void simgrid::instr::Type::logVariableTypeDefinition()
-{
- 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__, simgrid::instr::PAJE_DefineVariableType,
- TRACE_precision(), 0.);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << simgrid::instr::PAJE_DefineVariableType;
- stream << " " << id_ << " " << father_->getId() << " " << name_;
- if (isColored())
- stream << " \"" << color_ << "\"";
- print_row();
- } else if (instr_fmt_type == instr_fmt_TI) {
- /* Nothing to do */
- } else {
- THROW_IMPOSSIBLE;
- }
-}
-
-void simgrid::instr::Type::logStateTypeDefinition()
-{
- //print it
- if (instr_fmt_type == instr_fmt_paje) {
- 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 << " " << id_ << " " << father_->getId() << " " << name_;
- print_row();
- } else if (instr_fmt_type == instr_fmt_TI) {
- /* Nothing to do */
- } else {
- THROW_IMPOSSIBLE;
- }
-}
-
-void simgrid::instr::Type::logDefineEventType()
-{
- //print it
- if (instr_fmt_type == instr_fmt_paje) {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineEventType,
- TRACE_precision(), 0.);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << simgrid::instr::PAJE_DefineEventType;
- stream << " " << id_ << " " << father_->getId() << " " << name_;
- print_row();
- } else if (instr_fmt_type == instr_fmt_TI) {
- /* Nothing to do */
- } else {
- THROW_IMPOSSIBLE;
- }
-}
-
-void simgrid::instr::Type::logLinkTypeDefinition(simgrid::instr::Type* source, simgrid::instr::Type* dest)
-{
- 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__, simgrid::instr::PAJE_DefineLinkType, TRACE_precision(),
- 0.);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << simgrid::instr::PAJE_DefineLinkType;
- stream << " " << id_ << " " << father_->getId() << " " << source->getId() << " " << dest->getId() << " " << name_;
- print_row();
- } else if (instr_fmt_type == instr_fmt_TI) {
- /* Nothing to do */
- } else {
- THROW_IMPOSSIBLE;
- }
-}
-
void simgrid::instr::Value::print()
{
XBT_DEBUG("%s: event_type=%d", __FUNCTION__, simgrid::instr::PAJE_DefineEntityValue);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_types, instr, "Paje tracing event system (types)");
-static simgrid::instr::Type* rootType = nullptr; /* the root type */
+static simgrid::instr::ContainerType* rootType = nullptr; /* the root type */
+extern FILE* tracing_file;
namespace simgrid {
namespace instr {
-Type::Type(std::string name, std::string alias, std::string color, e_entity_types kind, Type* father)
- : name_(name), color_(color), kind_(kind), father_(father)
+Type::Type(std::string name, std::string alias, std::string color, Type* father)
+ : id_(instr_new_paje_id()), name_(name), color_(color), father_(father)
{
- if (name.empty() || alias.empty()) {
+ if (name.empty() || alias.empty())
THROWF(tracing_error, 0, "can't create a new type with no name or alias");
- }
-
- id_ = std::to_string(instr_new_paje_id());
if (father != nullptr){
father->children_.insert({alias, this});
Type::~Type()
{
- for (auto elm : values_)
- delete elm.second;
for (auto elm : children_)
delete elm.second;
}
+ValueType::~ValueType()
+{
+ for (auto elm : values_)
+ delete elm.second;
+}
+
+ContainerType::ContainerType(std::string name, Type* father) : Type(name, name, "", father)
+{
+ XBT_DEBUG("ContainerType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+ logDefinition(PAJE_DefineContainerType);
+}
+
+EventType::EventType(std::string name, Type* father) : ValueType(name, father)
+{
+ XBT_DEBUG("EventType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+ logDefinition(PAJE_DefineEventType);
+}
+
+StateType::StateType(std::string name, Type* father) : ValueType(name, father)
+{
+ XBT_DEBUG("StateType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+ logDefinition(PAJE_DefineStateType);
+}
+
+VariableType::VariableType(std::string name, std::string color, Type* father) : Type(name, name, color, father)
+{
+ XBT_DEBUG("VariableType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+ logDefinition(PAJE_DefineVariableType);
+}
+
+LinkType::LinkType(std::string name, std::string alias, Type* father) : ValueType(name, alias, father)
+{
+}
+
+void Type::logDefinition(e_event_type event_type)
+{
+ if (instr_fmt_type != instr_fmt_paje)
+ return;
+ std::stringstream stream;
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, event_type, TRACE_precision(), 0.);
+ stream << std::fixed << std::setprecision(TRACE_precision()) << event_type << " " << getId();
+ stream << " " << father_->getId() << " " << getName();
+ if (isColored())
+ stream << " \"" << color_ << "\"";
+ XBT_DEBUG("Dump %s", stream.str().c_str());
+ stream << std::endl;
+ fprintf(tracing_file, "%s", stream.str().c_str());
+}
+
+void Type::logDefinition(simgrid::instr::Type* source, simgrid::instr::Type* dest)
+{
+ if (instr_fmt_type != instr_fmt_paje)
+ return;
+ std::stringstream stream;
+ XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineLinkType, TRACE_precision(), 0.);
+ stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineLinkType << " " << getId();
+ stream << " " << father_->getId() << " " << source->getId() << " " << dest->getId() << " " << getName();
+ XBT_DEBUG("Dump %s", stream.str().c_str());
+ stream << std::endl;
+ fprintf(tracing_file, "%s", stream.str().c_str());
+}
+
Type* Type::byName(std::string name)
{
Type* ret = nullptr;
return ret;
}
-void Type::addEntityValue(std::string name)
+void ValueType::addEntityValue(std::string name)
{
addEntityValue(name, "");
}
-void Type::addEntityValue(std::string name, std::string color)
+void ValueType::addEntityValue(std::string name, std::string color)
{
- if (name.empty()) {
+ if (name.empty())
THROWF(tracing_error, 0, "can't get a value with no name");
- }
- if (kind_ == TYPE_VARIABLE)
- THROWF(tracing_error, 0, "variables can't have different values (%s)", getCname());
auto it = values_.find(name);
if (it == values_.end()) {
Value* new_val = new Value(name, color, this);
values_.insert({name, new_val});
- XBT_DEBUG("new value %s, child of %s", name_.c_str(), getCname());
+ XBT_DEBUG("new value %s, child of %s", name.c_str(), getCname());
new_val->print();
}
}
-Value* Type::getEntityValue(std::string name)
+Value* ValueType::getEntityValue(std::string name)
{
auto ret = values_.find(name);
if (ret == values_.end()) {
return ret->second;
}
-Type* Type::createRootType()
+ContainerType* Type::createRootType()
{
- simgrid::instr::Type* ret = new simgrid::instr::Type("0", "0", "", TYPE_CONTAINER, nullptr);
- rootType = ret;
- return ret;
+ rootType = static_cast<ContainerType*>(new simgrid::instr::Type("0", "0", "", nullptr));
+ return rootType;
}
-Type* Type::getRootType()
+ContainerType* Type::getRootType()
{
return rootType;
}
-Type* Type::getOrCreateContainerType(std::string name)
+ContainerType* Type::getOrCreateContainerType(std::string name)
{
- auto it = children_.find(name);
- if (it == children_.end()) {
- Type* ret = new simgrid::instr::Type(name, name, "", TYPE_CONTAINER, this);
- XBT_DEBUG("ContainerType %s(%s), child of %s(%s)", ret->getCname(), ret->getId(), getCname(), getId());
- ret->logContainerTypeDefinition();
- return ret;
- } else
- return it->second;
+ auto cont = children_.find(name);
+ return cont == children_.end() ? new ContainerType(name, this) : static_cast<ContainerType*>(cont->second);
}
-Type* Type::getOrCreateEventType(std::string name)
+EventType* Type::getOrCreateEventType(std::string name)
{
- auto it = children_.find(name);
- if (it == children_.end()) {
- Type* ret = new Type(name, name, "", TYPE_EVENT, this);
- XBT_DEBUG("EventType %s(%s), child of %s(%s)", ret->getCname(), ret->getId(), getCname(), getId());
- ret->logDefineEventType();
- return ret;
- } else {
- return it->second;
- }
+ auto cont = children_.find(name);
+ return cont == children_.end() ? new EventType(name, this) : static_cast<EventType*>(cont->second);
}
-Type* Type::getOrCreateVariableType(std::string name, std::string color)
+StateType* Type::getOrCreateStateType(std::string name)
{
- auto it = children_.find(name);
- if (it == children_.end()) {
- Type* ret = new Type(name, name, color.empty() ? "1 1 1" : color, TYPE_VARIABLE, this);
-
- XBT_DEBUG("VariableType %s(%s), child of %s(%s)", ret->getCname(), ret->getId(), getCname(), getId());
- ret->logVariableTypeDefinition();
-
- return ret;
- } else
- return it->second;
+ auto cont = children_.find(name);
+ return cont == children_.end() ? new StateType(name, this) : static_cast<StateType*>(cont->second);
}
-Type* Type::getOrCreateLinkType(std::string name, Type* source, Type* dest)
+VariableType* Type::getOrCreateVariableType(std::string name, std::string color)
{
- std::string alias = name + "-" + source->id_ + "-" + dest->id_;
- auto it = children_.find(alias);
- if (it == children_.end()) {
- Type* ret = new Type(name, alias, "", TYPE_LINK, this);
- XBT_DEBUG("LinkType %s(%s), child of %s(%s) %s(%s)->%s(%s)", ret->getCname(), ret->getId(), getCname(), getId(),
- source->getCname(), source->getId(), dest->getCname(), dest->getId());
- ret->logLinkTypeDefinition(source, dest);
- return ret;
- } else
- return it->second;
+ auto cont = children_.find(name);
+ return cont == children_.end() ? new VariableType(name, color.empty() ? "1 1 1" : color, this)
+ : static_cast<VariableType*>(cont->second);
}
-Type* Type::getOrCreateStateType(std::string name)
+LinkType* Type::getOrCreateLinkType(std::string name, Type* source, Type* dest)
{
- auto it = children_.find(name);
+ std::string alias = name + "-" + std::to_string(source->id_) + "-" + std::to_string(dest->id_);
+ auto it = children_.find(alias);
if (it == children_.end()) {
- Type* ret = new Type(name, name, "", TYPE_STATE, this);
- XBT_DEBUG("StateType %s(%s), child of %s(%s)", ret->getCname(), ret->getId(), getCname(), getId());
- ret->logStateTypeDefinition();
+ LinkType* ret = new LinkType(name, alias, this);
+ XBT_DEBUG("LinkType %s(%lld), child of %s(%lld) %s(%lld)->%s(%lld)", ret->getCname(), ret->getId(), getCname(),
+ getId(), source->getCname(), source->getId(), dest->getCname(), dest->getId());
+ ret->logDefinition(source, dest);
return ret;
} else
- return it->second;
+ return static_cast<LinkType*>(it->second);
}
}
}
namespace instr {
class Value;
+class ContainerType;
+class EventType;
+class LinkType;
+class StateType;
+class VariableType;
enum e_event_type {
PAJE_DefineContainerType,
PAJE_NewEvent
};
-//--------------------------------------------------
-enum e_entity_types { TYPE_VARIABLE, TYPE_LINK, TYPE_CONTAINER, TYPE_STATE, TYPE_EVENT };
-
class Type {
- std::string id_;
+ long long int id_;
std::string name_;
std::string color_;
- e_entity_types kind_;
+
+protected:
Type* father_;
public:
std::map<std::string, Type*> children_;
- std::map<std::string, Value*> values_; // valid for all types except variable and container
- Type(std::string name, std::string alias, std::string color, e_entity_types kind, Type* father);
+ Type(std::string name, std::string alias, std::string color, Type* father);
~Type();
std::string getName() { return name_; }
const char* getCname() { return name_.c_str(); }
- const char* getId() { return id_.c_str(); }
- e_entity_types getKind() { return kind_; }
+ long long int getId() { return id_; }
bool isColored() { return not color_.empty(); }
Type* byName(std::string name);
- Type* getOrCreateContainerType(std::string name);
- Type* getOrCreateEventType(std::string name);
- Type* getOrCreateLinkType(std::string name, Type* source, Type* dest);
- Type* getOrCreateStateType(std::string name);
- Type* getOrCreateVariableType(std::string name, std::string color);
+ ContainerType* getOrCreateContainerType(std::string name);
+ EventType* getOrCreateEventType(std::string name);
+ LinkType* getOrCreateLinkType(std::string name, Type* source, Type* dest);
+ StateType* getOrCreateStateType(std::string name);
+ VariableType* getOrCreateVariableType(std::string name, std::string color);
+
+ void logDefinition(e_event_type event_type);
+ void logDefinition(Type* source, Type* dest);
+
+ static ContainerType* createRootType();
+ static ContainerType* getRootType();
+};
+class ContainerType : public Type {
+public:
+ ContainerType(std::string name, Type* father);
+};
+
+class VariableType : public Type {
+public:
+ VariableType(std::string name, std::string color, Type* father);
+};
+
+class ValueType : public Type {
+public:
+ std::map<std::string, Value*> values_;
+ ValueType(std::string name, std::string alias, Type* father) : Type(name, alias, "", father){};
+ ValueType(std::string name, Type* father) : Type(name, name, "", father){};
+ ~ValueType();
void addEntityValue(std::string name, std::string color);
void addEntityValue(std::string name);
Value* getEntityValue(std::string name);
+};
- void logContainerTypeDefinition();
- void logVariableTypeDefinition();
- void logStateTypeDefinition();
- void logLinkTypeDefinition(simgrid::instr::Type* source, simgrid::instr::Type* dest);
- void logDefineEventType();
+class LinkType : public ValueType {
+public:
+ LinkType(std::string name, std::string alias, Type* father);
+};
+
+class EventType : public ValueType {
+public:
+ EventType(std::string name, Type* father);
+};
- static Type* createRootType();
- static Type* getRootType();
+class StateType : public ValueType {
+public:
+ StateType(std::string name, Type* father);
};
class Value {
{
if (TRACE_msg_process_is_enabled()){
container_t process_container = simgrid::instr::Container::byName(instr_process_id(process));
- simgrid::instr::Type* state = process_container->type_->byName("MSG_PROCESS_STATE");
- simgrid::instr::Value* val = state->getEntityValue("suspend");
+ simgrid::instr::StateType* state =
+ static_cast<simgrid::instr::StateType*>(process_container->type_->byName("MSG_PROCESS_STATE"));
+ simgrid::instr::Value* val = state->getEntityValue("suspend");
new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, state, val);
}
}
{
if (TRACE_msg_process_is_enabled()){
container_t process_container = simgrid::instr::Container::byName(instr_process_id(process));
- simgrid::instr::Type* state = process_container->type_->byName("MSG_PROCESS_STATE");
+ simgrid::instr::StateType* state =
+ static_cast<simgrid::instr::StateType*>(process_container->type_->byName("MSG_PROCESS_STATE"));
simgrid::instr::Value* val = state->getEntityValue("sleep");
new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, state, val);
}
if (TRACE_msg_process_is_enabled()){
container_t process_container = simgrid::instr::Container::byName(instr_process_id(MSG_process_self()));
- simgrid::instr::Type* state = process_container->type_->byName("MSG_PROCESS_STATE");
- simgrid::instr::Value* val = state->getEntityValue("task_execute");
+ simgrid::instr::StateType* state =
+ static_cast<simgrid::instr::StateType*>(process_container->type_->byName("MSG_PROCESS_STATE"));
+ simgrid::instr::Value* val = state->getEntityValue("task_execute");
new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, state, val);
}
}
if (TRACE_msg_process_is_enabled()){
container_t process_container = simgrid::instr::Container::byName(instr_process_id(MSG_process_self()));
- simgrid::instr::Type* state = process_container->type_->byName("MSG_PROCESS_STATE");
+ simgrid::instr::StateType* state =
+ static_cast<simgrid::instr::StateType*>(process_container->type_->byName("MSG_PROCESS_STATE"));
simgrid::instr::Value* val = state->getEntityValue("receive");
new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, state, val);
}
if (TRACE_msg_process_is_enabled()){
container_t process_container = simgrid::instr::Container::byName(instr_process_id(MSG_process_self()));
- simgrid::instr::Type* type = process_container->type_->byName("MSG_PROCESS_STATE");
- simgrid::instr::Value* val = type->getEntityValue("send");
- new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
+ simgrid::instr::StateType* state =
+ static_cast<simgrid::instr::StateType*>(process_container->type_->byName("MSG_PROCESS_STATE"));
+ simgrid::instr::Value* val = state->getEntityValue("send");
+ new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, state, val);
std::string key = std::string("p") + std::to_string(task->counter);
- type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK");
+ simgrid::instr::LinkType* type =
+ static_cast<simgrid::instr::LinkType*>(simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK"));
new simgrid::instr::StartLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type,
process_container, "SR", key);
}
vm->start();
if (TRACE_msg_vm_is_enabled()) {
container_t vm_container = simgrid::instr::Container::byName(vm->getName());
- simgrid::instr::Type* state = vm_container->type_->byName("MSG_VM_STATE");
+ simgrid::instr::StateType* state =
+ static_cast<simgrid::instr::StateType*>(vm_container->type_->byName("MSG_VM_STATE"));
state->addEntityValue("start", "0 0 1"); // start is blue
new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, state, state->getEntityValue("start"));
}
if (TRACE_msg_vm_is_enabled()) {
container_t vm_container = simgrid::instr::Container::byName(vm->getName());
- simgrid::instr::Type* state = vm_container->type_->byName("MSG_VM_STATE");
+ simgrid::instr::StateType* state =
+ static_cast<simgrid::instr::StateType*>(vm_container->type_->byName("MSG_VM_STATE"));
state->addEntityValue("suspend", "1 0 0"); // suspend is red
new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, state, state->getEntityValue("suspend"));
}
#define TRACE_AUTO_COLL(cat) \
if (TRACE_is_enabled()) { \
- simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->getOrCreateEventType(#cat); \
+ simgrid::instr::EventType* type = \
+ static_cast<simgrid::instr::EventType*>(simgrid::instr::Type::getRootType()->getOrCreateEventType(#cat)); \
\
char cont_name[25]; \
snprintf(cont_name, 25, "rank-%d", smpi_process()->index()); \
}
container_t container = simgrid::instr::Container::byName(smpi_container(rank));
- simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
+ simgrid::instr::StateType* state = static_cast<simgrid::instr::StateType*>(container->type_->byName("MPI_STATE"));
const char *color = instr_find_color (operation);
- type->addEntityValue(operation, color);
- new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, type->getEntityValue(operation),
+ state->addEntityValue(operation, color);
+ new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, state, state->getEntityValue(operation),
static_cast<void*>(extra));
}
return;
container_t container = simgrid::instr::Container::byName(smpi_container(rank));
- simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
- type->addEntityValue("computing", instr_find_color("computing"));
- new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, type->getEntityValue("computing"));
+ simgrid::instr::StateType* state = static_cast<simgrid::instr::StateType*>(container->type_->byName("MPI_STATE"));
+ state->addEntityValue("computing", instr_find_color("computing"));
+ new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, state, state->getEntityValue("computing"));
}
void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
}
container_t container = simgrid::instr::Container::byName(smpi_container(rank));
- simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
- type->addEntityValue("computing");
- new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, type->getEntityValue("computing"),
+ simgrid::instr::StateType* state = static_cast<simgrid::instr::StateType*>(container->type_->byName("MPI_STATE"));
+ state->addEntityValue("computing");
+ new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, state, state->getEntityValue("computing"),
static_cast<void*>(extra));
}
return;
container_t container = simgrid::instr::Container::byName(smpi_container(rank));
- simgrid::instr::Type* state = container->type_->byName("MPI_STATE");
+ simgrid::instr::StateType* state = static_cast<simgrid::instr::StateType*>(container->type_->byName("MPI_STATE"));
state->addEntityValue("sleeping", instr_find_color("sleeping"));
new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, state, state->getEntityValue("sleeping"));
}
}
container_t container = simgrid::instr::Container::byName(smpi_container(rank));
- simgrid::instr::Type* state = container->type_->byName("MPI_STATE");
+ simgrid::instr::StateType* state = static_cast<simgrid::instr::StateType*>(container->type_->byName("MPI_STATE"));
state->addEntityValue("sleeping");
new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, state, state->getEntityValue("sleeping"),
static_cast<void*>(extra));
}
container_t container = simgrid::instr::Container::byName(smpi_container(rank));
- simgrid::instr::Type* state = container->type_->byName("MPI_STATE");
+ simgrid::instr::StateType* state = static_cast<simgrid::instr::StateType*>(container->type_->byName("MPI_STATE"));
state->addEntityValue("test");
new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, state, state->getEntityValue("test"),
static_cast<void*>(extra));
}
container_t container = simgrid::instr::Container::byName(smpi_container(rank));
- simgrid::instr::Type* state = container->type_->byName("MPI_STATE");
+ simgrid::instr::StateType* state = static_cast<simgrid::instr::StateType*>(container->type_->byName("MPI_STATE"));
state->addEntityValue(operation, instr_find_color(operation));
new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, state, state->getEntityValue(operation),
static_cast<void*>(extra));
filter->insert(aux2);
//declare type
- std::string link_typename = father->type_->getName() + "-" + src->type_->getName() + src->type_->getId() + "-" +
- dst->type_->getName() + dst->type_->getId();
+ std::string link_typename = father->type_->getName() + "-" + src->type_->getName() +
+ std::to_string(src->type_->getId()) + "-" + dst->type_->getName() +
+ std::to_string(dst->type_->getId());
simgrid::instr::Type* link_type = father->type_->getOrCreateLinkType(link_typename, src->type_, dst->type_);
//register EDGE types for triva configuration
container->type_->getOrCreateContainerType("MPI")->getOrCreateStateType("MPI_STATE");
if (TRACE_msg_process_is_enabled()) {
- simgrid::instr::Type* msg_process = container->type_->getOrCreateContainerType("MSG_PROCESS");
- simgrid::instr::Type* state = msg_process->getOrCreateStateType("MSG_PROCESS_STATE");
+ simgrid::instr::ContainerType* msg_process = container->type_->getOrCreateContainerType("MSG_PROCESS");
+ simgrid::instr::StateType* state = msg_process->getOrCreateStateType("MSG_PROCESS_STATE");
state->addEntityValue("suspend", "1 0 1");
state->addEntityValue("sleep", "1 1 0");
state->addEntityValue("receive", "1 0 0");
}
if (TRACE_msg_vm_is_enabled()) {
- simgrid::instr::Type* msg_vm = container->type_->getOrCreateContainerType("MSG_VM");
- simgrid::instr::Type* state = msg_vm->getOrCreateStateType("MSG_VM_STATE");
+ simgrid::instr::ContainerType* msg_vm = container->type_->getOrCreateContainerType("MSG_VM");
+ simgrid::instr::StateType* state = msg_vm->getOrCreateStateType("MSG_VM_STATE");
state->addEntityValue("suspend", "1 0 1");
state->addEntityValue("sleep", "1 1 0");
state->addEntityValue("receive", "1 0 0");
simgrid::instr::Type* root)
{
if (root->getName() == type_name)
- root->addEntityValue(val, color);
+ static_cast<simgrid::instr::StateType*>(root)->addEntityValue(val, color);
for (auto elm : root->children_)
recursiveNewValueForUserStateType(type_name, val, color, elm.second);