}
/* output one line comment */
- dump_comment(TRACE_get_comment());
+ dump_comment(simgrid::config::get_value<std::string>(OPT_TRACING_COMMENT));
/* output comment file */
- dump_comment_file(TRACE_get_comment_file());
+ dump_comment_file(simgrid::config::get_value<std::string>(OPT_TRACING_COMMENT_FILE));
if (format == "Paje") {
/* output Pajé header */
return trace_display_sizes && trace_smpi_enabled && trace_enabled;
}
-std::string TRACE_get_comment()
-{
- return simgrid::config::get_value<std::string>(OPT_TRACING_COMMENT);
-}
-
-std::string TRACE_get_comment_file()
-{
- return simgrid::config::get_value<std::string>(OPT_TRACING_COMMENT_FILE);
-}
-
int TRACE_precision ()
{
return simgrid::config::get_value<int>(OPT_TRACING_PRECISION);
if (trace_format != simgrid::instr::TraceFormat::Paje)
return;
- stream_ << " " << value;
+ stream_ << " " << value_;
XBT_DEBUG("Dump %s", stream_.str().c_str());
tracing_file << stream_.str() << std::endl;
};
class VariableEvent : public PajeEvent {
- double value;
+ double value_;
public:
VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value)
- : PajeEvent::PajeEvent(container, type, timestamp, event_type), value(value)
+ : PajeEvent::PajeEvent(container, type, timestamp, event_type), value_(value)
{
}
void print() override;
#include "simgrid/sg_config.hpp"
#include "src/instr/instr_private.hpp"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_header, instr, "Paje tracing event system (header)");
-
extern std::ofstream tracing_file;
static void TRACE_header_PajeDefineContainerType(bool basic)
void TRACE_header(bool basic, int size)
{
- XBT_DEBUG ("Define paje header");
TRACE_header_PajeDefineContainerType(basic);
TRACE_header_PajeDefineVariableType(basic);
TRACE_header_PajeDefineStateType(basic);
{
if (filename.empty())
return;
- std::ifstream* fs = new std::ifstream();
- fs->open(filename.c_str(), std::ifstream::in);
+ std::ifstream fs(filename.c_str(), std::ifstream::in);
- if (fs->fail()) {
+ if (fs.fail())
THROWF(system_error, 1, "Comment file %s could not be opened for reading.", filename.c_str());
- }
- while (not fs->eof()) {
+
+ while (not fs.eof()) {
std::string line;
- tracing_file << "# ";
- std::getline(*fs, line);
- tracing_file << line;
+ std::getline(fs, line);
+ tracing_file << "# " << line;
}
- fs->close();
+ fs.close();
}
double TRACE_last_timestamp_to_dump = 0;
delete event;
}
buffer.clear();
- }else{
+ } else {
std::vector<simgrid::instr::PajeEvent*>::iterator i = buffer.begin();
for (auto const& event : buffer) {
double head_timestamp = event->timestamp_;
XBT_PUBLIC bool TRACE_smpi_is_sleeping();
XBT_PUBLIC bool TRACE_smpi_view_internals();
-/* from resource_utilization.c */
XBT_PRIVATE void TRACE_surf_resource_set_utilization(const char* type, const char* name, const char* resource,
const char* category, double value, double now, double delta);
-XBT_PRIVATE void TRACE_surf_link_set_utilization(const char* resource, const char* category, double value, double now,
- double delta);
/* instr_paje.c */
extern XBT_PRIVATE std::set<std::string> trivaNodeTypes;
XBT_PRIVATE void dump_comment_file(std::string filename);
XBT_PRIVATE void dump_comment(std::string comment);
-XBT_PRIVATE std::string TRACE_get_comment();
-XBT_PRIVATE std::string TRACE_get_comment_file();
XBT_PRIVATE std::string TRACE_get_filename();
#endif
container->get_variable(name)->instr_event(now, delta, resource, value);
}
}
-
-/* TRACE_surf_link_set_utilization: entry point from SimGrid */
-void TRACE_surf_link_set_utilization(const char* resource, const char* category, double value, double now, double delta)
-{
- TRACE_surf_resource_set_utilization("LINK", "bandwidth_used", resource, category, value, now, delta);
-}
action->src_->routeTo(action->dst_, route, nullptr);
for (auto const& link : route)
- TRACE_surf_link_set_utilization(link->get_cname(), action->get_category(), (data_delta_sent) / delta,
- now - delta, delta);
+ TRACE_surf_resource_set_utilization("LINK", "bandwidth_used", link->get_cname(), action->get_category(),
+ (data_delta_sent) / delta, now - delta, delta);
action->lastSent_ = sgFlow->sentBytes_;
}