#include "src/surf/surf_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_events, instr, "Paje tracing event system (events)");
#include "src/surf/surf_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_events, instr, "Paje tracing event system (events)");
-extern FILE* tracing_file;
-std::map<container_t, FILE*> tracing_files; // TI specific
+extern std::ofstream tracing_file;
+extern std::map<container_t, std::ofstream*> tracing_files; // TI specific
: container_(container), type_(type), timestamp_(timestamp), eventType_(eventType)
{
XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
: container_(container), type_(type), timestamp_(timestamp), eventType_(eventType)
{
XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
stream_ << std::fixed << std::setprecision(TRACE_precision());
stream_ << eventType_ << " " << timestamp_ << " " << type_->get_id() << " " << container_->get_id();
}
stream_ << std::fixed << std::setprecision(TRACE_precision());
stream_ << eventType_ << " " << timestamp_ << " " << type_->get_id() << " " << container_->get_id();
}
StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value, TIData* extra)
: PajeEvent::PajeEvent(container, type, SIMIX_get_clock(), event_type), value(value), extra_(extra)
{
#if HAVE_SMPI
StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value, TIData* extra)
: PajeEvent::PajeEvent(container, type, SIMIX_get_clock(), event_type), value(value), extra_(extra)
{
#if HAVE_SMPI
smpi_trace_call_location_t* loc = smpi_trace_get_call_location();
filename = loc->filename;
linenumber = loc->linenumber;
smpi_trace_call_location_t* loc = smpi_trace_get_call_location();
filename = loc->filename;
linenumber = loc->linenumber;
stream_ << " \"" << filename << "\" " << linenumber;
}
#endif
XBT_DEBUG("Dump %s", stream_.str().c_str());
stream_ << " \"" << filename << "\" " << linenumber;
}
#endif
XBT_DEBUG("Dump %s", stream_.str().c_str());
- fprintf(tracing_file, "%s\n", stream_.str().c_str());
- } else if (instr_fmt_type == instr_fmt_TI) {
+ tracing_file << stream_.str() << std::endl;
+ } else if (trace_format == simgrid::instr::TraceFormat::Ti) {
if (extra_ == nullptr)
return;
/* Unimplemented calls are: WAITANY, SENDRECV, SCAN, EXSCAN, SSEND, and ISSEND. */
// FIXME: dirty extract "rank-" from the name, as we want the bare process id here
if (extra_ == nullptr)
return;
/* Unimplemented calls are: WAITANY, SENDRECV, SCAN, EXSCAN, SSEND, and ISSEND. */
// FIXME: dirty extract "rank-" from the name, as we want the bare process id here
- if (getContainer()->get_name().find("rank-") != 0)
- stream_ << getContainer()->get_name() << " " << extra_->print();
+ if (get_container()->get_name().find("rank-") != 0)
+ stream_ << get_container()->get_name() << " " << extra_->print();