From ce9fe8ed764878bee5d61a7720f124245cea072e Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Mon, 30 Oct 2017 15:35:47 +0100 Subject: [PATCH] a few more simplifications --- src/instr/instr_paje_types.cpp | 15 ++++++--------- src/instr/instr_paje_types.hpp | 10 ++++------ src/instr/instr_paje_values.cpp | 8 +++----- src/msg/instr_msg_process.cpp | 4 ++-- src/msg/instr_msg_task.cpp | 4 ++-- src/msg/msg_vm.cpp | 4 ++-- src/smpi/internals/instr_smpi.cpp | 4 ++-- src/surf/instr_routing.cpp | 4 ++-- 8 files changed, 23 insertions(+), 30 deletions(-) diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index e9bd24f378..03995c7aa1 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -111,22 +111,19 @@ void VariableType::subEvent(double timestamp, Container* container, double value LinkType::LinkType(std::string name, std::string alias, Type* father) : ValueType(name, alias, father) { } -void LinkType::startEvent(double timestamp, Container* container, container_t endpoint, std::string value, - std::string key) +void LinkType::startEvent(Container* container, container_t endpoint, std::string value, std::string key) { - startEvent(timestamp, container, endpoint, value, key, -1); + startEvent(container, endpoint, value, key, -1); } -void LinkType::startEvent(double timestamp, Container* container, container_t endpoint, std::string value, - std::string key, int size) +void LinkType::startEvent(Container* container, container_t endpoint, std::string value, std::string key, int size) { - new LinkEvent(timestamp, container, this, PAJE_StartLink, endpoint, value, key, size); + new LinkEvent(SIMIX_get_clock(), container, this, PAJE_StartLink, endpoint, value, key, size); } -void LinkType::endEvent(double timestamp, Container* container, container_t endpoint, std::string value, - std::string key) +void LinkType::endEvent(Container* container, container_t endpoint, std::string value, std::string key) { - new LinkEvent(timestamp, container, this, PAJE_EndLink, endpoint, value, key); + new LinkEvent(SIMIX_get_clock(), container, this, PAJE_EndLink, endpoint, value, key); } void Type::logDefinition(e_event_type event_type) diff --git a/src/instr/instr_paje_types.hpp b/src/instr/instr_paje_types.hpp index 10916d912a..6d9a9bffcb 100644 --- a/src/instr/instr_paje_types.hpp +++ b/src/instr/instr_paje_types.hpp @@ -87,12 +87,10 @@ public: class LinkType : public ValueType { public: LinkType(std::string name, std::string alias, Type* father); - void startEvent(double timestamp, Container* source_container, Container* sourceContainer, std::string value, - std::string key); - void startEvent(double timestamp, Container* source_container, Container* sourceContainer, std::string value, - std::string key, int size); - void endEvent(double timestamp, Container* source_container, Container* destContainer, std::string value, - std::string key); + void startEvent(Container* source_container, Container* sourceContainer, std::string value, std::string key); + void startEvent(Container* source_container, Container* sourceContainer, std::string value, std::string key, + int size); + void endEvent(Container* source_container, Container* destContainer, std::string value, std::string key); }; class EventType : public ValueType { diff --git a/src/instr/instr_paje_values.cpp b/src/instr/instr_paje_values.cpp index 5f5045596a..d0bdb9db5b 100644 --- a/src/instr/instr_paje_values.cpp +++ b/src/instr/instr_paje_values.cpp @@ -20,15 +20,13 @@ void EntityValue::print() if (instr_fmt_type != instr_fmt_paje) return; std::stringstream stream; - XBT_DEBUG("%s: event_type=%u", __FUNCTION__, simgrid::instr::PAJE_DefineEntityValue); - stream << std::fixed << std::setprecision(TRACE_precision()); - stream << simgrid::instr::PAJE_DefineEntityValue; + XBT_DEBUG("%s: event_type=%u", __FUNCTION__, PAJE_DefineEntityValue); + stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineEntityValue; stream << " " << id_ << " " << father_->getId() << " " << name_; if (not color_.empty()) stream << " \"" << color_ << "\""; XBT_DEBUG("Dump %s", stream.str().c_str()); - stream << std::endl; - fprintf(tracing_file, "%s", stream.str().c_str()); + fprintf(tracing_file, "%s\n", stream.str().c_str()); } } diff --git a/src/msg/instr_msg_process.cpp b/src/msg/instr_msg_process.cpp index 6966e90502..1d4201b9be 100644 --- a/src/msg/instr_msg_process.cpp +++ b/src/msg/instr_msg_process.cpp @@ -26,7 +26,7 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host) container_t msg = simgrid::instr::Container::byName(instr_pid(process)); simgrid::instr::LinkType* link = static_cast(simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_LINK")); - link->startEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), msg, "M", key); + link->startEvent(simgrid::instr::Container::getRootContainer(), msg, "M", key); //destroy existing container of this process TRACE_msg_process_destroy (MSG_process_get_name (process), MSG_process_get_PID (process)); @@ -36,7 +36,7 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host) //end link msg = simgrid::instr::Container::byName(instr_pid(process)); - link->endEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), msg, "M", key); + link->endEvent(simgrid::instr::Container::getRootContainer(), msg, "M", key); } } diff --git a/src/msg/instr_msg_task.cpp b/src/msg/instr_msg_task.cpp index 4ed862918e..eabb37562a 100644 --- a/src/msg/instr_msg_task.cpp +++ b/src/msg/instr_msg_task.cpp @@ -94,7 +94,7 @@ void TRACE_msg_task_get_end(double start_time, msg_task_t task) std::string key = std::string("p") + std::to_string(task->counter); simgrid::instr::LinkType* link = static_cast(simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK")); - link->endEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), process_container, "SR", key); + link->endEvent(simgrid::instr::Container::getRootContainer(), process_container, "SR", key); } } @@ -110,7 +110,7 @@ int TRACE_msg_task_put_start(msg_task_t task) std::string key = std::string("p") + std::to_string(task->counter); simgrid::instr::LinkType* link = static_cast(simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK")); - link->startEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), process_container, "SR", key); + link->startEvent(simgrid::instr::Container::getRootContainer(), process_container, "SR", key); } return 1; diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index 2e067afd0d..ef8219c5ee 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -295,7 +295,7 @@ static int migration_rx_fun(int argc, char *argv[]) container_t msg = simgrid::instr::Container::byName(vm->getName()); simgrid::instr::LinkType* link = static_cast(simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK")); - link->startEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), msg, "M", key); + link->startEvent(simgrid::instr::Container::getRootContainer(), msg, "M", key); // destroy existing container of this vm container_t existing_container = simgrid::instr::Container::byName(vm->getName()); @@ -307,7 +307,7 @@ static int migration_rx_fun(int argc, char *argv[]) // end link msg = simgrid::instr::Container::byName(vm->getName()); - link->endEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), msg, "M", key); + link->endEvent(simgrid::instr::Container::getRootContainer(), msg, "M", key); } // Inform the SRC that the migration has been correctly performed diff --git a/src/smpi/internals/instr_smpi.cpp b/src/smpi/internals/instr_smpi.cpp index dfe1b8b217..d934f1a78e 100644 --- a/src/smpi/internals/instr_smpi.cpp +++ b/src/smpi/internals/instr_smpi.cpp @@ -321,7 +321,7 @@ void TRACE_smpi_send(int rank, int src, int dst, int tag, int size) simgrid::instr::LinkType* link = static_cast(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()); - link->startEvent(SIMIX_get_clock(), simgrid::instr::Container::getRootContainer(), container, "PTP", key, size); + link->startEvent(simgrid::instr::Container::getRootContainer(), container, "PTP", key, size); } void TRACE_smpi_recv(int src, int dst, int tag) @@ -335,5 +335,5 @@ void TRACE_smpi_recv(int src, int dst, int tag) simgrid::instr::LinkType* link = static_cast(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()); - link->endEvent(SIMIX_get_clock(), simgrid::instr::Container::getRootContainer(), container, "PTP", key); + link->endEvent(simgrid::instr::Container::getRootContainer(), container, "PTP", key); } diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index e9c886b823..f2c5ecf239 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -110,8 +110,8 @@ static void linkContainers(container_t src, container_t dst, std::setstartEvent(SIMIX_get_clock(), father, src, "topology", key); - link->endEvent(SIMIX_get_clock(), father, dst, "topology", key); + link->startEvent(father, src, "topology", key); + link->endEvent(father, dst, "topology", key); XBT_DEBUG(" linkContainers %s <-> %s", src->getCname(), dst->getCname()); } -- 2.20.1