- double timestamp = SIMIX_get_clock();
- std::stringstream stream;
-
- XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, PAJE_CreateContainer, timestamp);
-
- if (instr_fmt_type == instr_fmt_paje) {
- stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_CreateContainer << " ";
- /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
- if (timestamp < 1e-12)
- stream << 0;
- else
- stream << timestamp;
- stream << " " << id_ << " " << type_->getId() << " " << father_->id_ << " \"" << name_ << "\"";
- 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) {
- // if we are in the mode with only one file
- static FILE* ti_unique_file = nullptr;
-
- if (tracing_files.empty()) {
- // generate unique run id with time
- prefix = xbt_os_time();
- }
-
- if (not xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || ti_unique_file == nullptr) {
- std::string folder_name = TRACE_get_filename() + "_files";
- std::string filename = folder_name + "/" + std::to_string(prefix) + "_" + name_ + ".txt";
-#ifdef WIN32
- _mkdir(folder_name.c_str());
-#else
- mkdir(folder_name.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
-#endif
- ti_unique_file = fopen(filename.c_str(), "w");
- xbt_assert(ti_unique_file, "Tracefile %s could not be opened for writing: %s", filename.c_str(), strerror(errno));
- fprintf(tracing_file, "%s\n", filename.c_str());
- }
- tracing_files.insert({this, ti_unique_file});
- } else {
- THROW_IMPOSSIBLE;
- }