TRACE_paje_dump_buffer(true);
/* destroy all data structures of tracing (and free) */
- delete PJ_container_get_root();
+ delete simgrid::instr::Container::getRootContainer();
delete simgrid::instr::Type::getRootType();
rootType = nullptr;
THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
} else {
XBT_DEBUG("MARK %s %s", mark_type, mark_value);
- new simgrid::instr::NewEvent(MSG_get_clock(), PJ_container_get_root(), type, type->getEntityValue(mark_value));
+ new simgrid::instr::NewEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type,
+ type->getEntityValue(mark_value));
}
}
return type_id++;
}
-container_t PJ_container_get_root()
-{
- return rootContainer;
-}
-
-void PJ_container_set_root (container_t root)
-{
- rootContainer = root;
-}
namespace simgrid {
namespace instr {
+container_t Container::getRootContainer()
+{
+ return rootContainer;
+}
+
NetZoneContainer::NetZoneContainer(std::string name, unsigned int level, NetZoneContainer* father)
: Container::Container(name, "", father)
{
logCreation();
} else {
type_ = Type::createRootType();
- PJ_container_set_root(this);
+ rootContainer = this;
}
}
TRACE_paje_dump_buffer(true);
// trace my destruction
- if (not TRACE_disable_destroy() && this != PJ_container_get_root()) {
+ if (not TRACE_disable_destroy() && this != Container::getRootContainer()) {
// do not trace the container destruction if user requests or if the container is root
logDestruction();
}
void removeFromParent();
void logCreation();
void logDestruction();
+
+ static Container* getRootContainer();
};
class NetZoneContainer : public Container {
extern XBT_PRIVATE std::set<std::string> trivaNodeTypes;
extern XBT_PRIVATE std::set<std::string> trivaEdgeTypes;
XBT_PRIVATE long long int instr_new_paje_id();
-XBT_PUBLIC(container_t) PJ_container_get_root ();
-XBT_PUBLIC(void) PJ_container_set_root (container_t root);
void instr_new_variable_type(std::string new_typename, std::string color);
void instr_new_user_variable_type(std::string father_type, std::string new_typename, std::string color);
void instr_new_user_state_type(std::string father_type, std::string new_typename);
//start link
container_t msg = simgrid::instr::Container::byName(instr_process_id(process));
simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_LINK");
- new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ new simgrid::instr::StartLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), 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 = simgrid::instr::Container::byName(instr_process_id(process));
type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_LINK");
- new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ new simgrid::instr::EndLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
+ key);
}
}
std::string key = std::string("p") + std::to_string(task->counter);
type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK");
- new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
+ new simgrid::instr::EndLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type,
+ process_container, "SR", key);
}
}
std::string key = std::string("p") + std::to_string(task->counter);
type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK");
- new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
+ new simgrid::instr::StartLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type,
+ process_container, "SR", key);
}
return 1;
// start link
container_t msg = simgrid::instr::Container::byName(vm->getName());
simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK");
- new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ new simgrid::instr::StartLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
+ key);
// destroy existing container of this vm
container_t existing_container = simgrid::instr::Container::byName(vm->getName());
// end link
msg = simgrid::instr::Container::byName(vm->getName());
type = simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK");
- new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+ new simgrid::instr::EndLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
+ key);
}
// Inform the SRC that the migration has been correctly performed
container_t father;
if (TRACE_smpi_is_grouped()){
- father = simgrid::instr::Container::byName(sg_host_self_get_name());
+ father = simgrid::instr::Container::byNameOrNull(sg_host_self_get_name());
}else{
- father = PJ_container_get_root ();
+ father = simgrid::instr::Container::getRootContainer();
}
xbt_assert(father != nullptr, "Could not find a parent for mpi rank %s at function %s", str.c_str(), __FUNCTION__);
#if HAVE_PAPI
container_t container = simgrid::instr::Container::byName(smpi_container(rank));
simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MPI_LINK");
XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key.c_str());
- new simgrid::instr::StartLinkEvent(SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
+ new simgrid::instr::StartLinkEvent(SIMIX_get_clock(), simgrid::instr::Container::getRootContainer(), type, container,
+ "PTP", key, size);
}
void TRACE_smpi_recv(int src, int dst, int tag)
container_t container = simgrid::instr::Container::byName(smpi_container(dst));
simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MPI_LINK");
XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key.c_str());
- new simgrid::instr::EndLinkEvent(SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
+ new simgrid::instr::EndLinkEvent(SIMIX_get_clock(), simgrid::instr::Container::getRootContainer(), type, container,
+ "PTP", key);
}
{
std::string id = netzone.getName();
- if (PJ_container_get_root() == nullptr){
+ if (simgrid::instr::Container::getRootContainer() == nullptr) {
simgrid::instr::NetZoneContainer* root = new simgrid::instr::NetZoneContainer(id, 0, nullptr);
if (TRACE_smpi_is_enabled()) {
currentContainer.clear();
std::set<std::string>* filter = new std::set<std::string>;
XBT_DEBUG ("Starting graph extraction.");
- recursiveGraphExtraction(simgrid::s4u::Engine::getInstance()->getNetRoot(), PJ_container_get_root(), filter);
+ recursiveGraphExtraction(simgrid::s4u::Engine::getInstance()->getNetRoot(),
+ simgrid::instr::Container::getRootContainer(), filter);
XBT_DEBUG ("Graph extraction finished.");
delete filter;
platform_created = 1;
std::map<std::string, xbt_node_t>* nodes = new std::map<std::string, xbt_node_t>;
std::map<std::string, xbt_edge_t>* edges = new std::map<std::string, xbt_edge_t>;
recursiveXBTGraphExtraction(ret, nodes, edges, simgrid::s4u::Engine::getInstance()->getNetRoot(),
- PJ_container_get_root());
+ simgrid::instr::Container::getRootContainer());
delete nodes;
delete edges;
return ret;