Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Linux and FreeBSD don't agree on the type name, bummers
[simgrid.git] / src / instr / instr_paje_containers.cpp
index 52994b4..edf7c37 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -129,8 +129,7 @@ Container* Container::by_name_or_null(std::string name)
 Container* Container::by_name(std::string name)
 {
   Container* ret = Container::by_name_or_null(name);
-  if (ret == nullptr)
-    THROWF(tracing_error, 1, "container with name %s not found", name.c_str());
+  xbt_assert(ret != nullptr, "container with name %s not found", name.c_str());
 
   return ret;
 }
@@ -153,7 +152,13 @@ void Container::log_creation()
 
   if (trace_format == simgrid::instr::TraceFormat::Paje) {
     stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_CreateContainer << " ";
-    stream << timestamp << " " << id_ << " " << type_->get_id() << " " << father_->id_ << " \"" << name_ << "\"";
+    stream << timestamp << " " << id_ << " " << type_->get_id() << " " << father_->id_ << " \"";
+    if (name_.find("rank-") != 0)
+      stream << name_ << "\"";
+    else
+      /* Subtract -1 because this is the process id and we transform it to the rank id */
+      stream << "rank-" << stoi(name_.substr(5)) - 1 << "\"";
+
     XBT_DEBUG("Dump %s", stream.str().c_str());
     tracing_file << stream.str() << std::endl;
   } else if (trace_format == simgrid::instr::TraceFormat::Ti) {