-/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2021. 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. */
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_api, instr, "API");
-std::set<std::string> created_categories;
-std::set<std::string> declared_marks;
-std::set<std::string> user_host_variables;
-std::set<std::string> user_vm_variables;
-std::set<std::string> user_link_variables;
+std::set<std::string, std::less<>> created_categories;
+std::set<std::string, std::less<>> declared_marks;
+std::set<std::string, std::less<>> user_host_variables;
+std::set<std::string, std::less<>> user_vm_variables;
+std::set<std::string, std::less<>> user_link_variables;
-static xbt_dynar_t instr_set_to_dynar(const std::set<std::string>& filter)
+static xbt_dynar_t instr_set_to_dynar(const std::set<std::string, std::less<>>& filter)
{
if (not TRACE_is_enabled() || not TRACE_needs_platform())
return nullptr;
//check if category is already created
if (created_categories.find(category) != created_categories.end())
return;
- else
- created_categories.insert(category);
+
+ created_categories.emplace(category);
//define final_color
std::string final_color;
XBT_DEBUG("MARK,declare %s", mark_type);
simgrid::instr::Container::get_root()->type_->by_name_or_create<simgrid::instr::EventType>(mark_type);
- declared_marks.insert(mark_type);
+ declared_marks.emplace(mark_type);
}
/** @ingroup TRACE_mark
}
static void instr_user_variable(double time, const char* resource, const char* variable_name, const char* father_type,
- double value, InstrUserVariable what, const char* color, std::set<std::string>* filter)
+ double value, InstrUserVariable what, const char* color,
+ std::set<std::string, std::less<>>* filter)
{
/* safe switches. tracing has to be activated and if platform is not traced, we don't allow user variables */
if (not TRACE_is_enabled() || not TRACE_needs_platform())
const char *father_type, double value, InstrUserVariable what)
{
simgrid::kernel::routing::NetPoint* src_elm = sg_netpoint_by_name_or_null(src);
- if (not src_elm)
- xbt_die("Element '%s' not found!",src);
+ xbt_assert(src_elm, "Element '%s' not found!", src);
simgrid::kernel::routing::NetPoint* dst_elm = sg_netpoint_by_name_or_null(dst);
- if (not dst_elm)
- xbt_die("Element '%s' not found!",dst);
+ xbt_assert(dst_elm, "Element '%s' not found!", dst);
std::vector<simgrid::kernel::resource::LinkImpl*> route;
simgrid::kernel::routing::NetZoneImpl::get_global_route(src_elm, dst_elm, route, nullptr);