From: Arnaud Giersch Date: Tue, 10 May 2022 08:48:52 +0000 (+0200) Subject: Concatenate nested namespaces (sonar). X-Git-Tag: v3.32~257 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/72d32c4e88a57f4786f62fec48a1bfa454adbff9 Concatenate nested namespaces (sonar). --- diff --git a/src/bindings/java/JavaContext.cpp b/src/bindings/java/JavaContext.cpp index 8013b2cc2e..a9ea0728ed 100644 --- a/src/bindings/java/JavaContext.cpp +++ b/src/bindings/java/JavaContext.cpp @@ -17,9 +17,7 @@ extern JavaVM* __java_vm; XBT_LOG_NEW_DEFAULT_CATEGORY(java, "MSG for Java(TM)"); -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { JavaContextFactory::JavaContextFactory() : ContextFactory() { @@ -77,4 +75,4 @@ void JavaContext::stop() simgrid::ForcefulKillException::do_throw(); // clean RAII variables with the dedicated exception } -}}} // namespace simgrid::kernel::context +} // namespace simgrid::kernel::context diff --git a/src/bindings/java/JavaContext.hpp b/src/bindings/java/JavaContext.hpp index 30c7badfed..52598c626d 100644 --- a/src/bindings/java/JavaContext.hpp +++ b/src/bindings/java/JavaContext.hpp @@ -15,9 +15,7 @@ #include "jmsg.hpp" -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { class JavaContext; class JavacontextFactory; @@ -47,8 +45,6 @@ public: XBT_PRIVATE ContextFactory* java_factory(); XBT_PRIVATE void java_main_jprocess(jobject process); -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context #endif /* SIMGRID_JAVA_JAVA_CONTEXT_HPP */ diff --git a/src/bindings/java/jmsg.cpp b/src/bindings/java/jmsg.cpp index 29de9265ff..bcf7c86635 100644 --- a/src/bindings/java/jmsg.cpp +++ b/src/bindings/java/jmsg.cpp @@ -294,9 +294,7 @@ static void java_main(int argc, char* argv[]) run_jprocess(env, context->jprocess_); } -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { /** Run the Java org.simgrid.msg.Process */ void java_main_jprocess(jobject jprocess) @@ -308,6 +306,4 @@ void java_main_jprocess(jobject jprocess) run_jprocess(env, context->jprocess_); } -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context diff --git a/src/dag/loaders.cpp b/src/dag/loaders.cpp index 29999ff202..5cd632f773 100644 --- a/src/dag/loaders.cpp +++ b/src/dag/loaders.cpp @@ -72,8 +72,7 @@ static bool check_for_cycle(const std::vector& dag) static YY_BUFFER_STATE input_buffer; -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { static std::vector result; static std::map> jobs; @@ -291,8 +290,7 @@ std::vector create_DAG_from_dot(const std::string& filename) "Please install graphviz, graphviz-dev, and libgraphviz-dev (and erase CMakeCache.txt) before recompiling."); } #endif -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u void STag_dax__adag() { diff --git a/src/include/xbt/parmap.hpp b/src/include/xbt/parmap.hpp index be13332983..f782f59a7c 100644 --- a/src/include/xbt/parmap.hpp +++ b/src/include/xbt/parmap.hpp @@ -29,8 +29,7 @@ XBT_LOG_EXTERNAL_CATEGORY(xbt_parmap); -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { /** @addtogroup XBT_parmap * @ingroup XBT_misc @@ -419,7 +418,6 @@ template void Parmap::BusyWaitSynchro::worker_wait(unsigned roun } /** @} */ -} -} +} // namespace simgrid::xbt #endif diff --git a/src/instr/instr_config.cpp b/src/instr/instr_config.cpp index 22ad0fe78f..5a6075f4d7 100644 --- a/src/instr/instr_config.cpp +++ b/src/instr/instr_config.cpp @@ -206,8 +206,7 @@ void TRACE_help() " within the same Autonomous System (AS)."); } -namespace simgrid { -namespace instr { +namespace simgrid::instr { static bool trace_active = false; TraceFormat trace_format = TraceFormat::Paje; int trace_precision; @@ -468,5 +467,4 @@ void init() s4u::Engine::on_deadlock_cb(on_simulation_end); s4u::Engine::on_simulation_end_cb(on_simulation_end); } -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index 20a9c897a0..73de1d2b71 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -75,8 +75,7 @@ static void instr_user_srcdst_variable(double time, const std::string& src, cons instr_user_variable(time, link->get_cname(), variable, "LINK", value, what, "", &user_link_variables); } -namespace simgrid { -namespace instr { +namespace simgrid::instr { /* for host variables */ /** @brief Declare a new user variable associated to hosts. * @@ -331,8 +330,7 @@ const std::set>& get_tracing_categories() return created_categories; } -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr static xbt_dynar_t instr_set_to_dynar(const std::set>& filter) // XBT_ATTRIB_DEPRECATED_v334 { diff --git a/src/instr/instr_paje_containers.cpp b/src/instr/instr_paje_containers.cpp index 647857d342..f53a60866c 100644 --- a/src/instr/instr_paje_containers.cpp +++ b/src/instr/instr_paje_containers.cpp @@ -10,8 +10,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_containers, instr, "Paje tracing event system (containers)"); -namespace simgrid { -namespace instr { +namespace simgrid::instr { Container* Container::root_container_ = nullptr; /* the root container */ std::map> Container::all_containers_; /* all created containers indexed by name */ @@ -136,5 +135,4 @@ EntityValue::EntityValue(const std::string& name, const std::string& color, Type on_creation(*this); } -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr diff --git a/src/instr/instr_paje_containers.hpp b/src/instr/instr_paje_containers.hpp index 06e6219cc2..a4a4fe088a 100644 --- a/src/instr/instr_paje_containers.hpp +++ b/src/instr/instr_paje_containers.hpp @@ -9,8 +9,7 @@ #include "src/instr/instr_private.hpp" #include -namespace simgrid { -namespace instr { +namespace simgrid::instr { class Type; class LinkType; class StateType; @@ -75,6 +74,5 @@ class HostContainer : public Container { public: HostContainer(s4u::Host const& host, NetZoneContainer* parent); }; -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr #endif diff --git a/src/instr/instr_paje_events.cpp b/src/instr/instr_paje_events.cpp index a9b59644f3..c66ef1edbe 100644 --- a/src/instr/instr_paje_events.cpp +++ b/src/instr/instr_paje_events.cpp @@ -11,8 +11,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_events, instr, "Paje tracing event system (events)"); -namespace simgrid { -namespace instr { +namespace simgrid::instr { PajeEvent::PajeEvent(Container* container, Type* type, double timestamp, PajeEventType eventType) : container_(container), type_(type), timestamp_(timestamp), eventType_(eventType) @@ -84,5 +83,4 @@ void StateEvent::print() THROW_IMPOSSIBLE; } } -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr diff --git a/src/instr/instr_paje_events.hpp b/src/instr/instr_paje_events.hpp index c5cfb8a103..d182088913 100644 --- a/src/instr/instr_paje_events.hpp +++ b/src/instr/instr_paje_events.hpp @@ -12,8 +12,7 @@ #include #include -namespace simgrid { -namespace instr { +namespace simgrid::instr { class EntityValue; class TIData; @@ -125,6 +124,5 @@ public: } void print() override; }; -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr #endif diff --git a/src/instr/instr_paje_header.cpp b/src/instr/instr_paje_header.cpp index 055c409c13..725117b58c 100644 --- a/src/instr/instr_paje_header.cpp +++ b/src/instr/instr_paje_header.cpp @@ -11,9 +11,7 @@ #include "xbt/virtu.h" /* xbt::cmdline */ extern std::ofstream tracing_file; -namespace simgrid { -namespace instr { -namespace paje { +namespace simgrid::instr::paje { void dump_generator_version() { @@ -196,6 +194,4 @@ void dump_header(bool basic, bool display_sizes) tracing_file << "% Value string" << std::endl; tracing_file << "%EndEventDef" << std::endl; } -} // namespace paje -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr::paje diff --git a/src/instr/instr_paje_trace.cpp b/src/instr/instr_paje_trace.cpp index c2b75b1650..46431388a3 100644 --- a/src/instr/instr_paje_trace.cpp +++ b/src/instr/instr_paje_trace.cpp @@ -13,8 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_trace, instr, "tracing event system"); -namespace simgrid { -namespace instr { +namespace simgrid::instr { static std::vector buffer; double last_timestamp_to_dump = 0; @@ -65,5 +64,4 @@ void PajeEvent::insert_into_buffer() buffer.insert(i.base(), this); } -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 2d7a70f14e..d5658efb7d 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -9,8 +9,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_types, instr, "Paje tracing event system (types)"); -namespace simgrid { -namespace instr { +namespace simgrid::instr { long long int new_paje_id() { @@ -163,5 +162,4 @@ LinkType* Type::by_name_or_create(const std::string& name, const Type* source, c } else return static_cast(it->second.get()); } -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr diff --git a/src/instr/instr_paje_types.hpp b/src/instr/instr_paje_types.hpp index 0961d6e110..ac914dbcd5 100644 --- a/src/instr/instr_paje_types.hpp +++ b/src/instr/instr_paje_types.hpp @@ -11,8 +11,7 @@ #include #include -namespace simgrid { -namespace instr { +namespace simgrid::instr { class ContainerType; class EventType; @@ -131,6 +130,5 @@ public: void pop_event(); void pop_event(TIData* extra); }; -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr #endif diff --git a/src/instr/instr_paje_values.hpp b/src/instr/instr_paje_values.hpp index ce7dcc3289..045a829615 100644 --- a/src/instr/instr_paje_values.hpp +++ b/src/instr/instr_paje_values.hpp @@ -9,8 +9,7 @@ #include "src/instr/instr_private.hpp" #include -namespace simgrid { -namespace instr { +namespace simgrid::instr { class EntityValue { long long int id_ = new_paje_id(); @@ -30,7 +29,6 @@ public: std::string get_color() const { return color_; } Type* get_parent() const { return parent_; } }; -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr #endif diff --git a/src/instr/instr_platform.cpp b/src/instr/instr_platform.cpp index 83cd96603d..5594252798 100644 --- a/src/instr/instr_platform.cpp +++ b/src/instr/instr_platform.cpp @@ -203,8 +203,7 @@ void instr_new_value_for_user_state_type(const std::string& type_name, const cha recursiveNewValueForUserStateType(type_name, value, color, simgrid::instr::Container::get_root()->get_type()); } -namespace simgrid { -namespace instr { +namespace simgrid::instr { /** @brief Creates a file with the topology of the platform file used for the simulator. * @@ -505,5 +504,4 @@ void define_callbacks() [](s4u::Host const& host) { Container::by_name(host.get_name())->remove_from_parent(); }); } } -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr diff --git a/src/instr/instr_private.hpp b/src/instr/instr_private.hpp index f289b78b09..e3116555c8 100644 --- a/src/instr/instr_private.hpp +++ b/src/instr/instr_private.hpp @@ -24,8 +24,7 @@ #include #include -namespace simgrid { -namespace instr { +namespace simgrid::instr { namespace paje { void dump_generator_version(); @@ -230,8 +229,7 @@ public: } std::string display_size() override { return "NA"; } }; -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr XBT_PRIVATE std::string instr_pid(simgrid::s4u::Actor const& proc); diff --git a/src/instr/instr_resource_utilization.cpp b/src/instr/instr_resource_utilization.cpp index a2f48064a0..3b8a2f97ab 100644 --- a/src/instr/instr_resource_utilization.cpp +++ b/src/instr/instr_resource_utilization.cpp @@ -10,8 +10,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_resource, instr, "tracing (un)-categorized resource utilization"); -namespace simgrid { -namespace instr { +namespace simgrid::instr { void resource_set_utilization(const char* type, const char* name, const char* resource, const std::string& category, double value, double now, double delta) { @@ -33,5 +32,4 @@ void resource_set_utilization(const char* type, const char* name, const char* re container->get_variable(name)->instr_event(now, delta, resource, value); } } -} // namespace instr -} // namespace simgrid +} // namespace simgrid::instr diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp index 874c980254..81a0bf7018 100644 --- a/src/kernel/EngineImpl.cpp +++ b/src/kernel/EngineImpl.cpp @@ -32,8 +32,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(ker_engine, "Logging specific to Engine (kernel)"); -namespace simgrid { -namespace kernel { +namespace simgrid::kernel { double EngineImpl::now_ = 0.0; EngineImpl* EngineImpl::instance_ = nullptr; /* That singleton is awful too. */ @@ -72,8 +71,7 @@ static config::Flag context_factory_name("contexts/factory", (std::string("Possible values: ") + contexts_list()).c_str(), context_factories.begin()->first); -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel XBT_ATTRIB_NORETURN static void inthandler(int) { @@ -160,8 +158,7 @@ static void install_segvhandler() #endif /* _WIN32 */ -namespace simgrid { -namespace kernel { +namespace simgrid::kernel { EngineImpl::~EngineImpl() { @@ -743,5 +740,4 @@ double EngineImpl::get_clock() { return now_; } -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel diff --git a/src/kernel/EngineImpl.hpp b/src/kernel/EngineImpl.hpp index 8a8f973a11..6ea9106128 100644 --- a/src/kernel/EngineImpl.hpp +++ b/src/kernel/EngineImpl.hpp @@ -29,8 +29,7 @@ #include #include -namespace simgrid { -namespace kernel { +namespace simgrid::kernel { class EngineImpl { std::unordered_map netpoints_; @@ -178,7 +177,6 @@ public: static double get_clock(); }; -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel #endif diff --git a/src/kernel/activity/ActivityImpl.cpp b/src/kernel/activity/ActivityImpl.cpp index 3c47e41553..1c569d273d 100644 --- a/src/kernel/activity/ActivityImpl.cpp +++ b/src/kernel/activity/ActivityImpl.cpp @@ -20,9 +20,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_activity, kernel, "Kernel activity-related synchronization"); -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { ActivityImpl::~ActivityImpl() { @@ -237,6 +235,4 @@ void intrusive_ptr_release(ActivityImpl* activity) delete activity; } } -} -} -} // namespace simgrid::kernel::activity:: +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/ActivityImpl.hpp b/src/kernel/activity/ActivityImpl.hpp index 327c3007b8..68defdbbb9 100644 --- a/src/kernel/activity/ActivityImpl.hpp +++ b/src/kernel/activity/ActivityImpl.hpp @@ -17,9 +17,7 @@ #include #include -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { XBT_DECLARE_ENUM_CLASS(State, WAITING, READY, RUNNING, DONE, CANCELED, FAILED, SRC_HOST_FAILURE, DST_HOST_FAILURE, TIMEOUT, SRC_TIMEOUT, DST_TIMEOUT, LINK_FAILURE); @@ -115,8 +113,6 @@ public: const std::string& get_tracing_category() const { return tracing_category_; } }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif /* SIMGRID_KERNEL_ACTIVITY_ACTIVITYIMPL_HPP */ diff --git a/src/kernel/activity/BarrierImpl.cpp b/src/kernel/activity/BarrierImpl.cpp index 98ccd34b5b..b048eb8de6 100644 --- a/src/kernel/activity/BarrierImpl.cpp +++ b/src/kernel/activity/BarrierImpl.cpp @@ -8,9 +8,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_barrier, ker_synchro, "Barrier kernel-space implementation"); -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { /* -------- Acquisition -------- */ bool BarrierAcquisitionImpl::test(actor::ActorImpl*) @@ -66,6 +64,4 @@ BarrierAcquisitionImplPtr BarrierImpl::acquire_async(actor::ActorImpl* issuer) return res; } -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/BarrierImpl.hpp b/src/kernel/activity/BarrierImpl.hpp index 083b874dc7..7d72f6b6f7 100644 --- a/src/kernel/activity/BarrierImpl.hpp +++ b/src/kernel/activity/BarrierImpl.hpp @@ -11,9 +11,7 @@ #include "src/kernel/actor/ActorImpl.hpp" #include "src/kernel/actor/SynchroObserver.hpp" -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { /** Barrier Acquisition: the act / process of acquiring the barrier. * * This is the asynchronous activity associated to Barriers. See the doc of MutexImpl for more details on the rationnal. @@ -80,7 +78,5 @@ public: return xbt::string_printf("Barrier %u: %zu of %u", id_, ongoing_acquisitions_.size(), expected_actors_); } }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index b73d706425..4c4db3a7d6 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -42,9 +42,7 @@ void SIMIX_comm_copy_pointer_callback(simgrid::kernel::activity::CommImpl* comm, simgrid::s4u::Comm::copy_pointer_callback(comm, buff, buff_size); } -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { xbt::signal CommImpl::on_start; xbt::signal CommImpl::on_completion; @@ -573,6 +571,4 @@ void CommImpl::finish() } } -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/CommImpl.hpp b/src/kernel/activity/CommImpl.hpp index 3912d23728..e9d2d7ca74 100644 --- a/src/kernel/activity/CommImpl.hpp +++ b/src/kernel/activity/CommImpl.hpp @@ -10,9 +10,7 @@ #include "src/kernel/actor/ActorImpl.hpp" #include "src/kernel/actor/CommObserver.hpp" -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { enum class CommImplType { SEND, RECEIVE }; @@ -98,8 +96,6 @@ expectations of the other side, too. See */ static xbt::signal on_start; static xbt::signal on_completion; }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/ConditionVariableImpl.cpp b/src/kernel/activity/ConditionVariableImpl.cpp index 6343aca218..f059db3b4f 100644 --- a/src/kernel/activity/ConditionVariableImpl.cpp +++ b/src/kernel/activity/ConditionVariableImpl.cpp @@ -13,9 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_condition, ker_synchro, "Condition variables /********************************* Condition **********************************/ -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { /** * @brief Signalizes a condition. @@ -98,6 +96,4 @@ void intrusive_ptr_release(ConditionVariableImpl* cond) delete cond; } } -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/ConditionVariableImpl.hpp b/src/kernel/activity/ConditionVariableImpl.hpp index 42707f42fe..6dac7e0fd1 100644 --- a/src/kernel/activity/ConditionVariableImpl.hpp +++ b/src/kernel/activity/ConditionVariableImpl.hpp @@ -10,9 +10,7 @@ #include "src/kernel/actor/ActorImpl.hpp" #include -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { class XBT_PUBLIC ConditionVariableImpl { MutexImpl* mutex_ = nullptr; @@ -33,8 +31,6 @@ public: void signal(); void wait(MutexImpl* mutex, double timeout, actor::ActorImpl* issuer); }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/ExecImpl.cpp b/src/kernel/activity/ExecImpl.cpp index b33dac4abd..4b2ad5c7e4 100644 --- a/src/kernel/activity/ExecImpl.cpp +++ b/src/kernel/activity/ExecImpl.cpp @@ -17,9 +17,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_cpu, kernel, "Kernel cpu-related synchronization"); -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { ExecImpl::ExecImpl() { @@ -256,6 +254,4 @@ ActivityImpl* ExecImpl::migrate(s4u::Host* to) *************/ xbt::signal ExecImpl::on_migration; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/ExecImpl.hpp b/src/kernel/activity/ExecImpl.hpp index 71331543e5..079402b30f 100644 --- a/src/kernel/activity/ExecImpl.hpp +++ b/src/kernel/activity/ExecImpl.hpp @@ -11,9 +11,7 @@ #include "src/kernel/activity/ActivityImpl.hpp" #include "src/kernel/context/Context.hpp" -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { class XBT_PUBLIC ExecImpl : public ActivityImpl_T { std::unique_ptr> timeout_detector_{ @@ -61,7 +59,5 @@ public: static xbt::signal on_migration; }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/IoImpl.cpp b/src/kernel/activity/IoImpl.cpp index cdd593d202..c30b1a93aa 100644 --- a/src/kernel/activity/IoImpl.cpp +++ b/src/kernel/activity/IoImpl.cpp @@ -18,9 +18,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_io, kernel, "Kernel io-related synchronization"); -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { IoImpl::IoImpl() { @@ -156,6 +154,4 @@ void IoImpl::finish() } } -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/IoImpl.hpp b/src/kernel/activity/IoImpl.hpp index 1c9dbd5a17..399775bfca 100644 --- a/src/kernel/activity/IoImpl.hpp +++ b/src/kernel/activity/IoImpl.hpp @@ -9,9 +9,7 @@ #include "src/kernel/activity/ActivityImpl.hpp" #include -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { class XBT_PUBLIC IoImpl : public ActivityImpl_T { resource::DiskImpl* disk_ = nullptr; @@ -40,8 +38,6 @@ public: void set_exception(actor::ActorImpl* issuer) override; void finish() override; }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/MailboxImpl.cpp b/src/kernel/activity/MailboxImpl.cpp index a2620a33d9..c9d8c45004 100644 --- a/src/kernel/activity/MailboxImpl.cpp +++ b/src/kernel/activity/MailboxImpl.cpp @@ -14,9 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_mailbox, kernel, "Mailbox implementation"); /* Rendez-Vous Points */ /******************************************************************************/ -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { unsigned MailboxImpl::next_id_ = 0; @@ -149,6 +147,4 @@ CommImplPtr MailboxImpl::find_matching_comm(CommImplType type, comm_queue.erase(iter); return comm_cpy; } -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/MailboxImpl.hpp b/src/kernel/activity/MailboxImpl.hpp index 6421973c77..1c7b3117c2 100644 --- a/src/kernel/activity/MailboxImpl.hpp +++ b/src/kernel/activity/MailboxImpl.hpp @@ -14,9 +14,7 @@ #include "src/kernel/activity/CommImpl.hpp" #include "src/kernel/actor/ActorImpl.hpp" -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { /** @brief Implementation of the s4u::Mailbox */ @@ -68,8 +66,6 @@ public: bool has_some_done_comm() const { return not done_comm_queue_.empty(); } CommImplPtr done_front() const { return done_comm_queue_.front(); } }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/MutexImpl.cpp b/src/kernel/activity/MutexImpl.cpp index ca13b38c0b..e6053e1610 100644 --- a/src/kernel/activity/MutexImpl.cpp +++ b/src/kernel/activity/MutexImpl.cpp @@ -8,9 +8,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_mutex, ker_synchro, "Mutex kernel-space implementation"); -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { /* -------- Acquisition -------- */ @@ -106,6 +104,4 @@ void MutexImpl::unlock(actor::ActorImpl* issuer) XBT_OUT(); } -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/MutexImpl.hpp b/src/kernel/activity/MutexImpl.hpp index 6e1075e82a..3f80092cb8 100644 --- a/src/kernel/activity/MutexImpl.hpp +++ b/src/kernel/activity/MutexImpl.hpp @@ -11,9 +11,7 @@ #include "src/kernel/actor/ActorImpl.hpp" #include -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { /** Mutex Acquisition: the act / process of acquiring the mutex. * @@ -98,7 +96,5 @@ public: s4u::Mutex& mutex() { return piface_; } }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/SemaphoreImpl.cpp b/src/kernel/activity/SemaphoreImpl.cpp index 914ef4ca71..c53825f872 100644 --- a/src/kernel/activity/SemaphoreImpl.cpp +++ b/src/kernel/activity/SemaphoreImpl.cpp @@ -15,9 +15,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_semaphore, ker_synchro, "Semaphore kernel-space implementation"); -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { /* -------- Acquisition -------- */ @@ -119,6 +117,4 @@ void SemaphoreImpl::release() } } -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/SemaphoreImpl.hpp b/src/kernel/activity/SemaphoreImpl.hpp index b817599bb2..d715a650a5 100644 --- a/src/kernel/activity/SemaphoreImpl.hpp +++ b/src/kernel/activity/SemaphoreImpl.hpp @@ -13,9 +13,7 @@ #include "src/kernel/actor/ActorImpl.hpp" #include "src/kernel/actor/SynchroObserver.hpp" -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { /** Semaphore Acquisition: the act / process of acquiring the semaphore. * @@ -85,8 +83,6 @@ public: unsigned get_id() const { return id_; } s4u::Semaphore& sem() { return piface_; } }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif /* SIMGRID_KERNEL_ACTIVITY_SEMAPHOREIMPL_HPP */ diff --git a/src/kernel/activity/SleepImpl.cpp b/src/kernel/activity/SleepImpl.cpp index 78813f718b..0288909a25 100644 --- a/src/kernel/activity/SleepImpl.cpp +++ b/src/kernel/activity/SleepImpl.cpp @@ -11,9 +11,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_actor); -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { SleepImpl& SleepImpl::set_host(s4u::Host* host) { @@ -71,6 +69,4 @@ void SleepImpl::finish() } } } -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/SleepImpl.hpp b/src/kernel/activity/SleepImpl.hpp index f50ca54b28..5e22c49644 100644 --- a/src/kernel/activity/SleepImpl.hpp +++ b/src/kernel/activity/SleepImpl.hpp @@ -8,9 +8,7 @@ #include "src/kernel/activity/ActivityImpl.hpp" -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { class XBT_PUBLIC SleepImpl : public ActivityImpl_T { sg_host_t host_ = nullptr; @@ -24,8 +22,6 @@ public: void finish() override; SleepImpl* start(); }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/activity/Synchro.cpp b/src/kernel/activity/Synchro.cpp index ea5e660218..438a8f4b30 100644 --- a/src/kernel/activity/Synchro.cpp +++ b/src/kernel/activity/Synchro.cpp @@ -13,9 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_synchro, kernel, "Kernel synchronization activity (lock/acquire on a mutex, semaphore or condition)"); -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { SynchroImpl& SynchroImpl::set_host(s4u::Host* host) { @@ -87,6 +85,4 @@ void SynchroImpl::finish() simcall->issuer_->simcall_answer(); } -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity diff --git a/src/kernel/activity/Synchro.hpp b/src/kernel/activity/Synchro.hpp index 0d80d3bc13..fe73b3b3e3 100644 --- a/src/kernel/activity/Synchro.hpp +++ b/src/kernel/activity/Synchro.hpp @@ -10,9 +10,7 @@ #include -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { /** Used to implement mutexes, semaphores and conditions */ class XBT_PUBLIC SynchroImpl : public ActivityImpl_T { @@ -33,8 +31,6 @@ public: void set_exception(actor::ActorImpl* issuer) override; void finish() override; }; -} // namespace activity -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::activity #endif diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index e679e0f027..bb502beb1c 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -34,9 +34,7 @@ simgrid::kernel::actor::ActorImpl* SIMIX_process_self() // XBT_ATTRIB_DEPRECATED return simgrid::kernel::actor::ActorImpl::self(); } -namespace simgrid { -namespace kernel { -namespace actor { +namespace simgrid::kernel::actor { /*------------------------- [ ActorIDTrait ] -------------------------*/ unsigned long ActorIDTrait::maxpid_ = 0; @@ -522,9 +520,7 @@ void create_maestro(const std::function& code) engine->set_maestro(maestro); } -} // namespace actor -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::actor /* needs to be public and without simcall because it is called by exceptions and logging events */ const char* SIMIX_process_self_get_name() // XBT_ATTRIB_DEPRECATED_v333 diff --git a/src/kernel/actor/ActorImpl.hpp b/src/kernel/actor/ActorImpl.hpp index f27b624aed..8f6f640aee 100644 --- a/src/kernel/actor/ActorImpl.hpp +++ b/src/kernel/actor/ActorImpl.hpp @@ -16,9 +16,7 @@ #include #include -namespace simgrid { -namespace kernel { -namespace actor { +namespace simgrid::kernel::actor { class ProcessArg; /*------------------------- [ ActorIDTrait ] -------------------------*/ @@ -235,8 +233,6 @@ using SynchroList = XBT_PUBLIC void create_maestro(const std::function& code); -} // namespace actor -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::actor #endif diff --git a/src/kernel/actor/CommObserver.cpp b/src/kernel/actor/CommObserver.cpp index fbf4d980b8..f44571e5bc 100644 --- a/src/kernel/actor/CommObserver.cpp +++ b/src/kernel/actor/CommObserver.cpp @@ -14,9 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(obs_comm, mc_observer, "Logging specific to the Communication simcalls observation"); -namespace simgrid { -namespace kernel { -namespace actor { +namespace simgrid::kernel::actor { ActivityTestanySimcall::ActivityTestanySimcall(ActorImpl* actor, const std::vector& activities) : ResultingSimcall(actor, -1), activities_(activities) @@ -160,6 +158,4 @@ void CommIrecvSimcall::serialize(std::stringstream& stream) const XBT_DEBUG("RecvObserver comm:%p mbox:%u buff:%p tag:%d", comm_, mbox_->get_id(), dst_buff_, tag_); } -} // namespace actor -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::actor diff --git a/src/kernel/actor/CommObserver.hpp b/src/kernel/actor/CommObserver.hpp index 2358e5a08e..9cba17d454 100644 --- a/src/kernel/actor/CommObserver.hpp +++ b/src/kernel/actor/CommObserver.hpp @@ -13,9 +13,7 @@ #include -namespace simgrid { -namespace kernel { -namespace actor { +namespace simgrid::kernel::actor { class ActivityTestSimcall final : public ResultingSimcall { activity::ActivityImpl* const activity_; @@ -175,8 +173,6 @@ public: auto const& get_copy_data_fun() const { return copy_data_fun_; } }; -} // namespace actor -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::actor #endif diff --git a/src/kernel/actor/Simcall.cpp b/src/kernel/actor/Simcall.cpp index b379c9f80d..156636dbc6 100644 --- a/src/kernel/actor/Simcall.cpp +++ b/src/kernel/actor/Simcall.cpp @@ -12,9 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_simcall, kernel, "transmuting from user request into kernel handlers"); -namespace simgrid { -namespace kernel { -namespace actor { +namespace simgrid::kernel::actor { /** @private * @brief (in kernel mode) unpack the simcall and activate the handler @@ -51,6 +49,4 @@ const char* Simcall::get_cname() const } } -} // namespace actor -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::actor diff --git a/src/kernel/actor/Simcall.hpp b/src/kernel/actor/Simcall.hpp index c50dbfd7f0..b98ee1e4fb 100644 --- a/src/kernel/actor/Simcall.hpp +++ b/src/kernel/actor/Simcall.hpp @@ -11,9 +11,7 @@ #include "xbt/utility.hpp" /********************************* Simcalls *********************************/ -namespace simgrid { -namespace kernel { -namespace actor { +namespace simgrid::kernel::actor { /** * @brief Represents a simcall to the kernel. @@ -34,8 +32,6 @@ public: const char* get_cname() const; }; -} // namespace actor -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::actor #endif diff --git a/src/kernel/actor/SimcallObserver.cpp b/src/kernel/actor/SimcallObserver.cpp index b4422d5506..e4ffca22ff 100644 --- a/src/kernel/actor/SimcallObserver.cpp +++ b/src/kernel/actor/SimcallObserver.cpp @@ -14,9 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_observer, mc, "Logging specific to MC simcall observation"); -namespace simgrid { -namespace kernel { -namespace actor { +namespace simgrid::kernel::actor { void SimcallObserver::serialize(std::stringstream& stream) const { @@ -47,6 +45,4 @@ bool ConditionWaitSimcall::is_enabled() } return true; } -} // namespace actor -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::actor diff --git a/src/kernel/actor/SimcallObserver.hpp b/src/kernel/actor/SimcallObserver.hpp index 56adb66920..1c30486465 100644 --- a/src/kernel/actor/SimcallObserver.hpp +++ b/src/kernel/actor/SimcallObserver.hpp @@ -12,9 +12,7 @@ #include -namespace simgrid { -namespace kernel { -namespace actor { +namespace simgrid::kernel::actor { class SimcallObserver { ActorImpl* const issuer_; @@ -109,8 +107,6 @@ public: double get_timeout() const { return timeout_; } }; -} // namespace actor -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::actor #endif diff --git a/src/kernel/actor/SynchroObserver.cpp b/src/kernel/actor/SynchroObserver.cpp index 6a7dedaf66..5e5ca9d6b6 100644 --- a/src/kernel/actor/SynchroObserver.cpp +++ b/src/kernel/actor/SynchroObserver.cpp @@ -15,9 +15,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(obs_mutex, mc_observer, "Logging specific to mutex simcalls observation"); -namespace simgrid { -namespace kernel { -namespace actor { +namespace simgrid::kernel::actor { MutexObserver::MutexObserver(ActorImpl* actor, mc::Transition::Type type, activity::MutexImpl* mutex) : SimcallObserver(actor), type_(type), mutex_(mutex) @@ -84,6 +82,4 @@ bool BarrierObserver::is_enabled() (type_ == mc::Transition::Type::BARRIER_WAIT && acquisition_ != nullptr && acquisition_->granted_); } -} // namespace actor -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::actor diff --git a/src/kernel/actor/SynchroObserver.hpp b/src/kernel/actor/SynchroObserver.hpp index 15549bd0c7..c953c5d20d 100644 --- a/src/kernel/actor/SynchroObserver.hpp +++ b/src/kernel/actor/SynchroObserver.hpp @@ -13,9 +13,7 @@ #include -namespace simgrid { -namespace kernel { -namespace actor { +namespace simgrid::kernel::actor { /* All the observers of Mutex transitions are very similar, so implement them all together in this class */ class MutexObserver final : public SimcallObserver { @@ -78,8 +76,6 @@ public: double get_timeout() const { return timeout_; } }; -} // namespace actor -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::actor #endif diff --git a/src/kernel/context/Context.cpp b/src/kernel/context/Context.cpp index 875f78d45b..66a895bf79 100644 --- a/src/kernel/context/Context.cpp +++ b/src/kernel/context/Context.cpp @@ -15,9 +15,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_context, kernel, "Context switching mechanism"); -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { std::function ContextFactory::initializer; @@ -145,6 +143,4 @@ void Context::stop() } AttachContext::~AttachContext() = default; -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context diff --git a/src/kernel/context/Context.hpp b/src/kernel/context/Context.hpp index d710750937..c8aba566f3 100644 --- a/src/kernel/context/Context.hpp +++ b/src/kernel/context/Context.hpp @@ -14,9 +14,7 @@ #include #include -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { extern unsigned stack_size; extern unsigned guard_size; @@ -110,8 +108,6 @@ XBT_PUBLIC int get_nthreads(); XBT_PUBLIC void set_nthreads(int nb_threads); XBT_PUBLIC void set_parallel_mode(e_xbt_parmap_mode_t mode); XBT_PUBLIC e_xbt_parmap_mode_t get_parallel_mode(); -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context #endif diff --git a/src/kernel/context/ContextBoost.cpp b/src/kernel/context/ContextBoost.cpp index 7da149c6a1..0041debea6 100644 --- a/src/kernel/context/ContextBoost.cpp +++ b/src/kernel/context/ContextBoost.cpp @@ -9,9 +9,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_context); -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { // BoostContextFactory BoostContext* BoostContextFactory::create_context(std::function&& code, actor::ActorImpl* actor) @@ -66,6 +64,4 @@ XBT_PRIVATE ContextFactory* boost_factory() XBT_VERB("Using Boost contexts. Welcome to the 21th century."); return new BoostContextFactory(); } -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context diff --git a/src/kernel/context/ContextBoost.hpp b/src/kernel/context/ContextBoost.hpp index 5a877c4ee4..94682e2352 100644 --- a/src/kernel/context/ContextBoost.hpp +++ b/src/kernel/context/ContextBoost.hpp @@ -24,9 +24,7 @@ #include "src/internal_config.h" #include "src/kernel/context/ContextSwapped.hpp" -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { /** @brief Userspace context switching implementation based on Boost.Context */ class BoostContext : public SwappedContext { @@ -51,8 +49,6 @@ class BoostContextFactory : public SwappedContextFactory { public: BoostContext* create_context(std::function&& code, actor::ActorImpl* actor) override; }; -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context #endif diff --git a/src/kernel/context/ContextRaw.cpp b/src/kernel/context/ContextRaw.cpp index 6c3613382d..85e81698f7 100644 --- a/src/kernel/context/ContextRaw.cpp +++ b/src/kernel/context/ContextRaw.cpp @@ -185,9 +185,7 @@ void raw_swapcontext(raw_stack_t* old, raw_stack_t new_context) // ***** Method definitions -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { // RawContextFactory @@ -221,6 +219,4 @@ ContextFactory* raw_factory() XBT_VERB("Using raw contexts. Because the glibc is just not good enough for us."); return new RawContextFactory(); } -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context diff --git a/src/kernel/context/ContextRaw.hpp b/src/kernel/context/ContextRaw.hpp index d6b670cd53..8362aeafbf 100644 --- a/src/kernel/context/ContextRaw.hpp +++ b/src/kernel/context/ContextRaw.hpp @@ -15,9 +15,7 @@ #include "src/kernel/context/ContextSwapped.hpp" -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { /** @brief Fast context switching inspired from SystemV ucontexts. * @@ -39,8 +37,6 @@ class RawContextFactory : public SwappedContextFactory { public: RawContext* create_context(std::function&& code, actor::ActorImpl* actor) override; }; -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context #endif diff --git a/src/kernel/context/ContextSwapped.cpp b/src/kernel/context/ContextSwapped.cpp index a4ab5b3558..c6812f4bce 100644 --- a/src/kernel/context/ContextSwapped.cpp +++ b/src/kernel/context/ContextSwapped.cpp @@ -63,9 +63,7 @@ void smx_ctx_wrapper(simgrid::kernel::context::SwappedContext* context) THROW_IMPOSSIBLE; } -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { /* thread-specific storage for the worker's context */ thread_local SwappedContext* SwappedContext::worker_context_ = nullptr; @@ -298,6 +296,4 @@ void SwappedContext::suspend() this->swap_into(next_context); } -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context diff --git a/src/kernel/context/ContextSwapped.hpp b/src/kernel/context/ContextSwapped.hpp index 29063ec9fb..d687827cf7 100644 --- a/src/kernel/context/ContextSwapped.hpp +++ b/src/kernel/context/ContextSwapped.hpp @@ -11,20 +11,14 @@ #include -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { class SwappedContext; -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context /* Use extern "C" to make sure that this symbol is easy to recognize by name, even on exotic platforms */ extern "C" XBT_ATTRIB_NORETURN void smx_ctx_wrapper(simgrid::kernel::context::SwappedContext* context); -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { class SwappedContextFactory : public ContextFactory { friend SwappedContext; // Reads whether we are in parallel mode @@ -94,7 +88,5 @@ inline void SwappedContext::verify_previous_context(XBT_ATTRIB_UNUSED const Swap #endif } -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context #endif diff --git a/src/kernel/context/ContextThread.cpp b/src/kernel/context/ContextThread.cpp index 0a5dc3ec83..54319b2bb5 100644 --- a/src/kernel/context/ContextThread.cpp +++ b/src/kernel/context/ContextThread.cpp @@ -18,9 +18,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_context); -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { // ThreadContextFactory @@ -215,6 +213,4 @@ XBT_PRIVATE ContextFactory* thread_factory() XBT_VERB("Activating thread context factory"); return new ThreadContextFactory(); } -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context diff --git a/src/kernel/context/ContextThread.hpp b/src/kernel/context/ContextThread.hpp index 6602a1f2ec..5980d3ae56 100644 --- a/src/kernel/context/ContextThread.hpp +++ b/src/kernel/context/ContextThread.hpp @@ -14,9 +14,7 @@ #include -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { class XBT_PUBLIC ThreadContext : public AttachContext { public: @@ -101,8 +99,6 @@ public: private: ThreadContext* create_context(std::function&& code, actor::ActorImpl* actor, bool maestro); }; -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context #endif diff --git a/src/kernel/context/ContextUnix.cpp b/src/kernel/context/ContextUnix.cpp index e38df56c39..24b2b1f34d 100644 --- a/src/kernel/context/ContextUnix.cpp +++ b/src/kernel/context/ContextUnix.cpp @@ -32,9 +32,7 @@ XBT_ATTRIB_NORETURN static void sysv_ctx_wrapper(int i1, int i2) } } -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { // UContextFactory UContext* UContextFactory::create_context(std::function&& code, actor::ActorImpl* actor) @@ -83,6 +81,4 @@ XBT_PRIVATE ContextFactory* sysv_factory() XBT_VERB("Activating SYSV context factory"); return new UContextFactory(); } -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context diff --git a/src/kernel/context/ContextUnix.hpp b/src/kernel/context/ContextUnix.hpp index 48f13251ab..69d6a5ca3f 100644 --- a/src/kernel/context/ContextUnix.hpp +++ b/src/kernel/context/ContextUnix.hpp @@ -19,9 +19,7 @@ #include "src/internal_config.h" #include "src/kernel/context/ContextSwapped.hpp" -namespace simgrid { -namespace kernel { -namespace context { +namespace simgrid::kernel::context { class UContext : public SwappedContext { public: @@ -37,8 +35,6 @@ class UContextFactory : public SwappedContextFactory { public: UContext* create_context(std::function&& code, actor::ActorImpl* actor) override; }; -} // namespace context -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::context #endif diff --git a/src/kernel/lmm/System.cpp b/src/kernel/lmm/System.cpp index 33dc9cf013..326b404928 100644 --- a/src/kernel/lmm/System.cpp +++ b/src/kernel/lmm/System.cpp @@ -17,9 +17,7 @@ double sg_maxmin_precision = 1E-5; /* Change this with --cfg=maxmin/precision:VA double sg_surf_precision = 1E-9; /* Change this with --cfg=surf/precision:VALUE */ int sg_concurrency_limit = -1; /* Change this with --cfg=maxmin/concurrency-limit:VALUE */ -namespace simgrid { -namespace kernel { -namespace lmm { +namespace simgrid::kernel::lmm { int Variable::next_rank_ = 1; int Constraint::next_rank_ = 1; @@ -762,6 +760,4 @@ void Constraint::set_sharing_policy(SharingPolicy policy, const s4u::NonLinearRe dyn_constraint_cb_ = cb; } -} // namespace lmm -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::lmm diff --git a/src/kernel/lmm/System.hpp b/src/kernel/lmm/System.hpp index 72938254de..173d0444be 100644 --- a/src/kernel/lmm/System.hpp +++ b/src/kernel/lmm/System.hpp @@ -20,9 +20,7 @@ #include #include -namespace simgrid { -namespace kernel { -namespace lmm { +namespace simgrid::kernel::lmm { /** @addtogroup SURF_lmm * @details @@ -605,8 +603,6 @@ private: }; /** @} */ -} // namespace lmm -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::lmm #endif diff --git a/src/kernel/lmm/bmf.cpp b/src/kernel/lmm/bmf.cpp index 816e5e4c40..b6647a6453 100644 --- a/src/kernel/lmm/bmf.cpp +++ b/src/kernel/lmm/bmf.cpp @@ -20,9 +20,7 @@ simgrid::config::Flag simgrid::config::Flag cfg_bmf_precision{"bmf/precision", "Numerical precision used when computing resource sharing", 1E-12}; -namespace simgrid { -namespace kernel { -namespace lmm { +namespace simgrid::kernel::lmm { AllocationGenerator::AllocationGenerator(Eigen::MatrixXd A) : A_(std::move(A)), alloc_(A_.cols(), 0) { @@ -514,6 +512,4 @@ template void BmfSystem::bmf_solve(const CnstList& cnst_list) } } -} // namespace lmm -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::lmm diff --git a/src/kernel/lmm/bmf.hpp b/src/kernel/lmm/bmf.hpp index 55ed10811b..dfc7ff98e2 100644 --- a/src/kernel/lmm/bmf.hpp +++ b/src/kernel/lmm/bmf.hpp @@ -20,9 +20,7 @@ #include -namespace simgrid { -namespace kernel { -namespace lmm { +namespace simgrid::kernel::lmm { /** @brief Generate all combinations of valid allocation */ class XBT_PUBLIC AllocationGenerator { @@ -279,8 +277,6 @@ private: std::unordered_map cnst2idx_; //!< Conversely map constraint to index }; -} // namespace lmm -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::lmm #endif diff --git a/src/kernel/lmm/fair_bottleneck.hpp b/src/kernel/lmm/fair_bottleneck.hpp index 7c55590777..eaa22deee0 100644 --- a/src/kernel/lmm/fair_bottleneck.hpp +++ b/src/kernel/lmm/fair_bottleneck.hpp @@ -8,9 +8,7 @@ #include "src/kernel/lmm/System.hpp" -namespace simgrid { -namespace kernel { -namespace lmm { +namespace simgrid::kernel::lmm { class XBT_PUBLIC FairBottleneck : public System { public: @@ -20,8 +18,6 @@ private: void do_solve() final; }; -} // namespace lmm -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::lmm #endif diff --git a/src/kernel/lmm/maxmin.cpp b/src/kernel/lmm/maxmin.cpp index c7611fa093..d12f588225 100644 --- a/src/kernel/lmm/maxmin.cpp +++ b/src/kernel/lmm/maxmin.cpp @@ -7,9 +7,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_lmm); -namespace simgrid { -namespace kernel { -namespace lmm { +namespace simgrid::kernel::lmm { using dyn_light_t = std::vector; @@ -229,6 +227,4 @@ template void MaxMin::maxmin_solve(CnstList& cnst_list) } while (cnst_light_num > 0); } -} // namespace lmm -} // namespace kernel -} // namespace simgrid \ No newline at end of file +} // namespace simgrid::kernel::lmm diff --git a/src/kernel/lmm/maxmin.hpp b/src/kernel/lmm/maxmin.hpp index 48c3156ea0..f5bd0ce2e0 100644 --- a/src/kernel/lmm/maxmin.hpp +++ b/src/kernel/lmm/maxmin.hpp @@ -8,9 +8,7 @@ #include "src/kernel/lmm/System.hpp" -namespace simgrid { -namespace kernel { -namespace lmm { +namespace simgrid::kernel::lmm { class XBT_PUBLIC MaxMin : public System { public: @@ -26,8 +24,6 @@ private: dyn_light_t saturated_constraints; }; -} // namespace lmm -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::lmm #endif diff --git a/src/kernel/resource/Action.cpp b/src/kernel/resource/Action.cpp index 757531ae41..6920fd7d86 100644 --- a/src/kernel/resource/Action.cpp +++ b/src/kernel/resource/Action.cpp @@ -12,9 +12,7 @@ XBT_LOG_NEW_CATEGORY(kernel, "SimGrid internals"); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_resource, kernel, "Resources, modeling the platform performance"); -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { Action::Action(Model* model, double cost, bool failed) : Action(model, cost, failed, nullptr) {} @@ -247,6 +245,4 @@ Action* ActionHeap::pop() return action; } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/kernel/resource/CpuImpl.cpp b/src/kernel/resource/CpuImpl.cpp index 0538f95dd3..6a6deb4b42 100644 --- a/src/kernel/resource/CpuImpl.cpp +++ b/src/kernel/resource/CpuImpl.cpp @@ -10,9 +10,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_cpu, ker_resource, "CPU resource, fueling execution activites"); -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /********* * Model * @@ -217,6 +215,4 @@ std::list CpuAction::cpus() const return retlist; } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/kernel/resource/CpuImpl.hpp b/src/kernel/resource/CpuImpl.hpp index e0ee3e6fc0..a7f094c263 100644 --- a/src/kernel/resource/CpuImpl.hpp +++ b/src/kernel/resource/CpuImpl.hpp @@ -13,9 +13,7 @@ #include -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /*********** * Classes * @@ -190,8 +188,6 @@ public: void suspend() override; void resume() override; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* CPU_IMPL_HPP_ */ diff --git a/src/kernel/resource/DiskImpl.cpp b/src/kernel/resource/DiskImpl.cpp index 8a45da6319..29198e10a3 100644 --- a/src/kernel/resource/DiskImpl.cpp +++ b/src/kernel/resource/DiskImpl.cpp @@ -19,9 +19,7 @@ static simgrid::config::Flag cfg_disk_solver("disk/solver", "Set linear equations solver used by disk model", "maxmin", &simgrid::kernel::lmm::System::validate_solver); -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { xbt::signal DiskAction::on_state_change; @@ -179,6 +177,4 @@ void DiskAction::set_state(Action::State new_state) on_state_change(*this, previous_state, new_state); } } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/kernel/resource/DiskImpl.hpp b/src/kernel/resource/DiskImpl.hpp index af027a7503..611234d1ae 100644 --- a/src/kernel/resource/DiskImpl.hpp +++ b/src/kernel/resource/DiskImpl.hpp @@ -20,9 +20,7 @@ * Model * *********/ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /*********** * Classes * ***********/ @@ -127,7 +125,5 @@ public: void set_state(simgrid::kernel::resource::Action::State state) override; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* DISK_IMPL_HPP_ */ diff --git a/src/kernel/resource/LinkImpl.hpp b/src/kernel/resource/LinkImpl.hpp index 0f2c36acdb..5575fcae5e 100644 --- a/src/kernel/resource/LinkImpl.hpp +++ b/src/kernel/resource/LinkImpl.hpp @@ -10,9 +10,7 @@ #include "src/kernel/resource/Resource.hpp" #include "xbt/PropertyHolder.hpp" -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /************ * Resource * @@ -44,8 +42,6 @@ public: virtual void set_concurrency_limit(int limit) const = 0; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* SIMGRID_KERNEL_RESOURCE_LINKIMPL_HPP */ diff --git a/src/kernel/resource/Model.cpp b/src/kernel/resource/Model.cpp index 84946da1a1..89cac54e7c 100644 --- a/src/kernel/resource/Model.cpp +++ b/src/kernel/resource/Model.cpp @@ -8,9 +8,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_resource); -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { Model::Model(const std::string& name) : name_(name) { @@ -181,6 +179,4 @@ void Model::update_actions_state_full(double /*now*/, double /*delta*/) THROW_UNIMPLEMENTED; } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/kernel/resource/NetworkModel.cpp b/src/kernel/resource/NetworkModel.cpp index 354489e754..01ded589b2 100644 --- a/src/kernel/resource/NetworkModel.cpp +++ b/src/kernel/resource/NetworkModel.cpp @@ -21,9 +21,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_network, ker_resource, "Network resources, t * Model * *********/ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /** @brief Command-line option 'network/TCP-gamma' -- see @ref options_model_network_gamma */ config::Flag NetworkModel::cfg_tcp_gamma( @@ -110,8 +108,6 @@ void insert_link_latency(std::vector& result, const std::vect add_latency(links, latency); } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* NETWORK_INTERFACE_CPP_ */ diff --git a/src/kernel/resource/NetworkModel.hpp b/src/kernel/resource/NetworkModel.hpp index bfe6aa3201..833cc1e8ec 100644 --- a/src/kernel/resource/NetworkModel.hpp +++ b/src/kernel/resource/NetworkModel.hpp @@ -12,9 +12,7 @@ #include -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /********* * Model * @@ -140,8 +138,6 @@ void add_link_latency(std::vector& result, const std::vector< void insert_link_latency(std::vector& result, const std::vector& links, double* latency); -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* SIMGRID_KERNEL_RESOURCE_NETWORKMODEL_HPP */ diff --git a/src/kernel/resource/Resource.hpp b/src/kernel/resource/Resource.hpp index 48f5a76691..ea32b925e2 100644 --- a/src/kernel/resource/Resource.hpp +++ b/src/kernel/resource/Resource.hpp @@ -17,9 +17,7 @@ #include -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /** @ingroup SURF_interface * @brief SURF resource interface class @@ -110,9 +108,7 @@ public: bool is_used() const override { return model_->get_maxmin_system()->constraint_used(constraint_); } }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource namespace std { template <> class hash { diff --git a/src/kernel/resource/SplitDuplexLinkImpl.cpp b/src/kernel/resource/SplitDuplexLinkImpl.cpp index a74c2d75af..cd4ec9fe97 100644 --- a/src/kernel/resource/SplitDuplexLinkImpl.cpp +++ b/src/kernel/resource/SplitDuplexLinkImpl.cpp @@ -11,9 +11,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network); * Model * *********/ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { SplitDuplexLinkImpl::SplitDuplexLinkImpl(const std::string& name, StandardLinkImpl* link_up, StandardLinkImpl* link_down) @@ -93,6 +91,4 @@ void SplitDuplexLinkImpl::set_concurrency_limit(int limit) const link_down_->set_concurrency_limit(limit); } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/kernel/resource/SplitDuplexLinkImpl.hpp b/src/kernel/resource/SplitDuplexLinkImpl.hpp index 077c971cc8..f1bdbe9dc3 100644 --- a/src/kernel/resource/SplitDuplexLinkImpl.hpp +++ b/src/kernel/resource/SplitDuplexLinkImpl.hpp @@ -9,9 +9,7 @@ #include "src/kernel/resource/LinkImpl.hpp" #include "src/kernel/resource/StandardLinkImpl.hpp" -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /************ * Resource * @@ -70,8 +68,6 @@ public: void set_concurrency_limit(int limit) const override; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* SIMGRID_KERNEL_RESOURCE_SDLINKIMPL_HPP */ diff --git a/src/kernel/resource/StandardLinkImpl.cpp b/src/kernel/resource/StandardLinkImpl.cpp index 92e4291cde..6648c23d45 100644 --- a/src/kernel/resource/StandardLinkImpl.cpp +++ b/src/kernel/resource/StandardLinkImpl.cpp @@ -15,9 +15,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network); * Model * *********/ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { StandardLinkImpl::StandardLinkImpl(const std::string& name) : LinkImpl(name), piface_(this) { @@ -141,6 +139,4 @@ void StandardLinkImpl::set_concurrency_limit(int limit) const get_constraint()->set_concurrency_limit(limit); } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/kernel/resource/StandardLinkImpl.hpp b/src/kernel/resource/StandardLinkImpl.hpp index 1b06a36973..d79e687526 100644 --- a/src/kernel/resource/StandardLinkImpl.hpp +++ b/src/kernel/resource/StandardLinkImpl.hpp @@ -12,9 +12,7 @@ * Classes * ***********/ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /************ * Resource * ************/ @@ -76,8 +74,6 @@ public: void set_concurrency_limit(int limit) const override; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* SIMGRID_KERNEL_RESOURCE_STANDARDLINKIMPL_HPP */ diff --git a/src/kernel/resource/VirtualMachineImpl.cpp b/src/kernel/resource/VirtualMachineImpl.cpp index e698ccbd96..48f2492f1e 100644 --- a/src/kernel/resource/VirtualMachineImpl.cpp +++ b/src/kernel/resource/VirtualMachineImpl.cpp @@ -39,8 +39,7 @@ void surf_vm_model_init_HL13(simgrid::kernel::resource::CpuModel* cpu_pm_model) namespace simgrid { template class xbt::Extendable; -namespace kernel { -namespace resource { +namespace kernel::resource { /********* * Model * @@ -414,6 +413,5 @@ void VirtualMachineImpl::seal() s4u::VirtualMachine::on_creation(*get_iface()); } -} // namespace resource -} // namespace kernel +} // namespace kernel::resource } // namespace simgrid diff --git a/src/kernel/resource/VirtualMachineImpl.hpp b/src/kernel/resource/VirtualMachineImpl.hpp index 3628c77f0c..81cd3d6942 100644 --- a/src/kernel/resource/VirtualMachineImpl.hpp +++ b/src/kernel/resource/VirtualMachineImpl.hpp @@ -14,8 +14,7 @@ namespace simgrid { extern template class XBT_PUBLIC xbt::Extendable; -namespace kernel { -namespace resource { +namespace kernel::resource { /************ * Resource * @@ -101,8 +100,7 @@ public: return nullptr; }; }; -} // namespace resource -} // namespace kernel +} // namespace kernel::resource } // namespace simgrid #endif /* VM_INTERFACE_HPP_ */ diff --git a/src/kernel/resource/WifiLinkImpl.cpp b/src/kernel/resource/WifiLinkImpl.cpp index 8de4c548f0..556a7ff7a9 100644 --- a/src/kernel/resource/WifiLinkImpl.cpp +++ b/src/kernel/resource/WifiLinkImpl.cpp @@ -10,9 +10,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network); -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /************ * Resource * @@ -94,6 +92,4 @@ void WifiLinkImpl::set_latency(double value) { xbt_assert(value == 0, "Latency cannot be set for WiFi Links."); } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/kernel/resource/WifiLinkImpl.hpp b/src/kernel/resource/WifiLinkImpl.hpp index 5486b33964..ea1e30a8bd 100644 --- a/src/kernel/resource/WifiLinkImpl.hpp +++ b/src/kernel/resource/WifiLinkImpl.hpp @@ -15,9 +15,7 @@ * Classes * ***********/ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { class XBT_PRIVATE WifiLinkAction; @@ -73,7 +71,5 @@ public: WifiLinkImpl* get_dst_link() const { return dst_wifi_link_; } }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif diff --git a/src/kernel/resource/profile/Event.hpp b/src/kernel/resource/profile/Event.hpp index 4ae08176c5..62111e95c5 100644 --- a/src/kernel/resource/profile/Event.hpp +++ b/src/kernel/resource/profile/Event.hpp @@ -8,9 +8,7 @@ #include "simgrid/forward.h" -namespace simgrid { -namespace kernel { -namespace profile { +namespace simgrid::kernel::profile { class Event { public: @@ -19,9 +17,7 @@ public: resource::Resource* resource; bool free_me; }; -} // namespace profile -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::profile /** * @brief Free a trace event structure * diff --git a/src/kernel/resource/profile/FutureEvtSet.cpp b/src/kernel/resource/profile/FutureEvtSet.cpp index d693df2ba5..dae5708840 100644 --- a/src/kernel/resource/profile/FutureEvtSet.cpp +++ b/src/kernel/resource/profile/FutureEvtSet.cpp @@ -7,9 +7,7 @@ #include "src/kernel/resource/profile/Event.hpp" #include "src/kernel/resource/profile/Profile.hpp" -namespace simgrid { -namespace kernel { -namespace profile { +namespace simgrid::kernel::profile { simgrid::kernel::profile::FutureEvtSet future_evt_set; // FIXME: singleton antipattern @@ -51,6 +49,4 @@ Event* FutureEvtSet::pop_leq(double date, double* value, resource::Resource** re return event; } -} // namespace profile -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::profile diff --git a/src/kernel/resource/profile/FutureEvtSet.hpp b/src/kernel/resource/profile/FutureEvtSet.hpp index 47eb652782..a26afc6119 100644 --- a/src/kernel/resource/profile/FutureEvtSet.hpp +++ b/src/kernel/resource/profile/FutureEvtSet.hpp @@ -9,9 +9,7 @@ #include "simgrid/forward.h" #include -namespace simgrid { -namespace kernel { -namespace profile { +namespace simgrid::kernel::profile { /** @brief Future Event Set (collection of iterators over the traces) * That's useful to quickly know which is the next occurring event in a set of traces. */ @@ -33,8 +31,6 @@ private: // FIXME: kill that singleton extern XBT_PRIVATE simgrid::kernel::profile::FutureEvtSet future_evt_set; -} // namespace profile -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::profile #endif diff --git a/src/kernel/resource/profile/Profile.cpp b/src/kernel/resource/profile/Profile.cpp index bc45ead1f3..28ec0c7d41 100644 --- a/src/kernel/resource/profile/Profile.cpp +++ b/src/kernel/resource/profile/Profile.cpp @@ -22,9 +22,7 @@ static std::unordered_map trace_list; -namespace simgrid { -namespace kernel { -namespace profile { +namespace simgrid::kernel::profile { /** @brief Register this profile for that resource onto that FES, * and get an iterator over the integrated trace */ @@ -75,9 +73,7 @@ Profile::Profile(const std::string& name, const std::function #include -namespace simgrid { -namespace kernel { -namespace profile { +namespace simgrid::kernel::profile { /** @brief A profile is a set of timed values, encoding the value that a variable takes at what time * @@ -63,9 +61,7 @@ private: } }; -} // namespace profile -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::profile /** Module finalizer: frees all profiles */ XBT_PUBLIC void tmgr_finalize(); diff --git a/src/kernel/resource/profile/ProfileBuilder.cpp b/src/kernel/resource/profile/ProfileBuilder.cpp index e2ac345676..1924d2d35f 100644 --- a/src/kernel/resource/profile/ProfileBuilder.cpp +++ b/src/kernel/resource/profile/ProfileBuilder.cpp @@ -16,9 +16,7 @@ #include #include -namespace simgrid { -namespace kernel { -namespace profile { +namespace simgrid::kernel::profile { bool DatedValue::operator==(DatedValue const& e2) const { @@ -245,7 +243,4 @@ Profile* ProfileBuilder::from_callback(const std::string& name, const std::funct return new Profile(name, cb, repeat_delay); } - -} // namespace profile -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::profile diff --git a/src/kernel/resource/profile/StochasticDatedValue.cpp b/src/kernel/resource/profile/StochasticDatedValue.cpp index 36d84b6734..e0579e1983 100644 --- a/src/kernel/resource/profile/StochasticDatedValue.cpp +++ b/src/kernel/resource/profile/StochasticDatedValue.cpp @@ -8,9 +8,7 @@ #include "xbt/random.hpp" #include -namespace simgrid { -namespace kernel { -namespace profile { +namespace simgrid::kernel::profile { double StochasticDatedValue::draw(Distribution law, std::vector params) { @@ -52,6 +50,4 @@ bool StochasticDatedValue::operator==(StochasticDatedValue const& e2) const (e2.date_params == date_params); } -} // namespace profile -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::profile diff --git a/src/kernel/resource/profile/StochasticDatedValue.hpp b/src/kernel/resource/profile/StochasticDatedValue.hpp index 74c4dfa2ed..2e0586fbca 100644 --- a/src/kernel/resource/profile/StochasticDatedValue.hpp +++ b/src/kernel/resource/profile/StochasticDatedValue.hpp @@ -10,9 +10,7 @@ #include "simgrid/kernel/ProfileBuilder.hpp" #include -namespace simgrid { -namespace kernel { -namespace profile { +namespace simgrid::kernel::profile { enum class Distribution { EXP, NORM, UNIF, DET }; @@ -38,8 +36,6 @@ private: static double draw(Distribution law, std::vector params); }; -} // namespace profile -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::profile #endif diff --git a/src/kernel/routing/ClusterZone.cpp b/src/kernel/routing/ClusterZone.cpp index 4f02317fd3..b3abab44f1 100644 --- a/src/kernel/routing/ClusterZone.cpp +++ b/src/kernel/routing/ClusterZone.cpp @@ -13,9 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_cluster, ker_routing, "Kernel Cluste /* This routing is specifically setup to represent clusters, aka homogeneous sets of machines * Note that a router is created, easing the interconnection with the rest of the world. */ -namespace simgrid { -namespace kernel { -namespace routing { +namespace simgrid::kernel::routing { void ClusterBase::set_loopback() { @@ -116,6 +114,4 @@ void ClusterBase::fill_leaf_from_cb(unsigned long position, const std::vectorgw_src_ = get_gateway(src->id()); route->gw_dst_ = get_gateway(dst->id()); } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing namespace s4u { DragonflyParams::DragonflyParams(const std::pair& groups, diff --git a/src/kernel/routing/EmptyZone.cpp b/src/kernel/routing/EmptyZone.cpp index 9489a8b881..cc4032fb56 100644 --- a/src/kernel/routing/EmptyZone.cpp +++ b/src/kernel/routing/EmptyZone.cpp @@ -12,16 +12,14 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_none, ker_routing, "Kernel No Routing"); namespace simgrid { -namespace kernel { -namespace routing { +namespace kernel::routing { void EmptyZone::get_graph(const s_xbt_graph_t* /*graph*/, std::map>* /*nodes*/, std::map>* /*edges*/) { xbt_die("No routing no graph"); } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing namespace s4u { NetZone* create_empty_zone(const std::string& name) diff --git a/src/kernel/routing/FatTreeZone.cpp b/src/kernel/routing/FatTreeZone.cpp index 7f7337d379..851b1407be 100644 --- a/src/kernel/routing/FatTreeZone.cpp +++ b/src/kernel/routing/FatTreeZone.cpp @@ -20,8 +20,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_fat_tree, ker_routing, "Kernel Fat-Tree Routing"); namespace simgrid { -namespace kernel { -namespace routing { +namespace kernel::routing { bool FatTreeZone::is_in_sub_tree(const FatTreeNode* root, const FatTreeNode* node) const { @@ -488,8 +487,7 @@ void FatTreeZone::generate_dot_file(const std::string& filename) const file << "}"; file.close(); } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing namespace s4u { FatTreeParams::FatTreeParams(unsigned int n_levels, const std::vector& down_links, diff --git a/src/kernel/routing/FloydZone.cpp b/src/kernel/routing/FloydZone.cpp index 867c140153..91fc424c0b 100644 --- a/src/kernel/routing/FloydZone.cpp +++ b/src/kernel/routing/FloydZone.cpp @@ -14,8 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_floyd, ker_routing, "Kernel Floyd Routing"); namespace simgrid { -namespace kernel { -namespace routing { +namespace kernel::routing { void FloydZone::init_tables(unsigned int table_size) { @@ -154,8 +153,7 @@ void FloydZone::do_seal() } } } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing namespace s4u { NetZone* create_floyd_zone(const std::string& name) diff --git a/src/kernel/routing/FullZone.cpp b/src/kernel/routing/FullZone.cpp index 8112081b19..96992f6e91 100644 --- a/src/kernel/routing/FullZone.cpp +++ b/src/kernel/routing/FullZone.cpp @@ -11,8 +11,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_full, ker_routing, "Kernel Full Routing"); namespace simgrid { -namespace kernel { -namespace routing { +namespace kernel::routing { void FullZone::check_routing_table() { @@ -95,8 +94,7 @@ void FullZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoin new_extended_route(get_hierarchy(), gw_src, gw_dst, get_link_list_impl(link_list, true), false)); } } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing namespace s4u { NetZone* create_full_zone(const std::string& name) diff --git a/src/kernel/routing/NetPoint.cpp b/src/kernel/routing/NetPoint.cpp index 003a87ff66..ff705288a3 100644 --- a/src/kernel/routing/NetPoint.cpp +++ b/src/kernel/routing/NetPoint.cpp @@ -15,8 +15,7 @@ namespace simgrid { template class xbt::Extendable; -namespace kernel { -namespace routing { +namespace kernel::routing { simgrid::xbt::signal NetPoint::on_creation; @@ -40,8 +39,7 @@ NetPoint* NetPoint::set_coordinates(const std::string& coords) new vivaldi::Coords(this, coords); return this; } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing } // namespace simgrid /** @brief Retrieve a netpoint from its name diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 6792cc782c..ef3f4e3684 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -21,9 +21,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing, kernel, "Kernel routing-related information"); -namespace simgrid { -namespace kernel { -namespace routing { +namespace simgrid::kernel::routing { /* Pick the right models for CPU, net and host, and call their model_init_preparse */ static void surf_config_models_setup() @@ -737,6 +735,4 @@ bool NetZoneImpl::is_component_recursive(const NetPoint* netpoint) const return std::any_of(begin(children_), end(children_), [netpoint](const auto* child) { return child->is_component_recursive(netpoint); }); } -} // namespace routing -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::routing diff --git a/src/kernel/routing/RoutedZone.cpp b/src/kernel/routing/RoutedZone.cpp index ebdeeee108..6d078d78cd 100644 --- a/src/kernel/routing/RoutedZone.cpp +++ b/src/kernel/routing/RoutedZone.cpp @@ -49,9 +49,7 @@ xbt_edge_t new_xbt_graph_edge(const s_xbt_graph_t* graph, xbt_node_t s, xbt_node return elm->second; } -namespace simgrid { -namespace kernel { -namespace routing { +namespace simgrid::kernel::routing { RoutedZone::RoutedZone(const std::string& name) : NetZoneImpl(name) {} @@ -198,6 +196,4 @@ void RoutedZone::add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* NetZoneImpl::on_route_creation(symmetrical, gw_src, gw_dst, gw_src, gw_dst, get_link_list_impl(link_list, false)); } } -} // namespace routing -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::routing diff --git a/src/kernel/routing/StarZone.cpp b/src/kernel/routing/StarZone.cpp index 2de8f5e842..c223e25597 100644 --- a/src/kernel/routing/StarZone.cpp +++ b/src/kernel/routing/StarZone.cpp @@ -12,8 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_star, ker_routing, "Kernel Star Routing"); namespace simgrid { -namespace kernel { -namespace routing { +namespace kernel::routing { StarZone::StarZone(const std::string& name) : ClusterZone(name) {} void StarZone::add_links_to_route(const std::vector& links, Route* route, double* latency, @@ -178,8 +177,7 @@ void StarZone::do_seal() } } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing namespace s4u { NetZone* create_star_zone(const std::string& name) diff --git a/src/kernel/routing/TorusZone.cpp b/src/kernel/routing/TorusZone.cpp index 33454a5f83..ab645a239d 100644 --- a/src/kernel/routing/TorusZone.cpp +++ b/src/kernel/routing/TorusZone.cpp @@ -17,8 +17,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_torus, ker_routing, "Kernel Torus Routing"); namespace simgrid { -namespace kernel { -namespace routing { +namespace kernel ::routing { void TorusZone::create_torus_links(unsigned long id, int rank, unsigned long position) { @@ -180,8 +179,7 @@ void TorusZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route* route->gw_dst_ = get_gateway(dst->id()); } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing namespace s4u { diff --git a/src/kernel/routing/VivaldiZone.cpp b/src/kernel/routing/VivaldiZone.cpp index e8b8117327..a96a9c6f2c 100644 --- a/src/kernel/routing/VivaldiZone.cpp +++ b/src/kernel/routing/VivaldiZone.cpp @@ -15,8 +15,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_vivaldi, ker_routing, "Kernel Vivaldi Routing"); namespace simgrid { -namespace kernel { -namespace routing { +namespace kernel::routing { namespace vivaldi { @@ -96,8 +95,7 @@ void VivaldiZone::get_local_route(const NetPoint* src, const NetPoint* dst, Rout } } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing namespace s4u { NetZone* create_vivaldi_zone(const std::string& name) diff --git a/src/kernel/routing/WifiZone.cpp b/src/kernel/routing/WifiZone.cpp index a9b941cf57..70af014c07 100644 --- a/src/kernel/routing/WifiZone.cpp +++ b/src/kernel/routing/WifiZone.cpp @@ -11,8 +11,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_wifi, ker_routing, "Kernel Wifi Routing"); namespace simgrid { -namespace kernel { -namespace routing { +namespace kernel::routing { void WifiZone::do_seal() { @@ -54,8 +53,7 @@ resource::StandardLinkImpl* WifiZone::do_create_link(const std::string& name, co wifi_link_->set_sharing_policy(s4u::Link::SharingPolicy::WIFI, {}); return wifi_link_; } -} // namespace routing -} // namespace kernel +} // namespace kernel::routing namespace s4u { NetZone* create_wifi_zone(const std::string& name) diff --git a/src/kernel/timer/Timer.cpp b/src/kernel/timer/Timer.cpp index 93862c6b70..d6bda284ba 100644 --- a/src/kernel/timer/Timer.cpp +++ b/src/kernel/timer/Timer.cpp @@ -6,9 +6,7 @@ #include #include -namespace simgrid { -namespace kernel { -namespace timer { +namespace simgrid::kernel::timer { Timer* Timer::set(double date, xbt::Task&& callback) { @@ -38,6 +36,4 @@ bool Timer::execute_all() return result; } -} // namespace timer -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::timer diff --git a/src/mc/AddressSpace.hpp b/src/mc/AddressSpace.hpp index b26860925a..2a2d78cc35 100644 --- a/src/mc/AddressSpace.hpp +++ b/src/mc/AddressSpace.hpp @@ -9,8 +9,7 @@ #include "src/mc/mc_forward.hpp" #include "src/mc/remote/RemotePtr.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** Options for read operations * @@ -135,7 +134,6 @@ public: } }; -} -} +} // namespace simgrid::mc #endif diff --git a/src/mc/ModelChecker.cpp b/src/mc/ModelChecker.cpp index 796aae407b..1e3c2be931 100644 --- a/src/mc/ModelChecker.cpp +++ b/src/mc/ModelChecker.cpp @@ -28,8 +28,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_ModelChecker, mc, "ModelChecker"); # define WAITPID_CHECKED_FLAGS 0 #endif -namespace simgrid { -namespace mc { +namespace simgrid::mc { ModelChecker::ModelChecker(std::unique_ptr remote_simulation, int sockfd) : checker_side_(sockfd), remote_process_(std::move(remote_simulation)) @@ -353,5 +352,4 @@ void ModelChecker::finalize_app(bool terminate_asap) xbt_assert(checker_side_.get_channel().receive(answer) != -1, "Could not receive answer to FINALIZE"); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/ModelChecker.hpp b/src/mc/ModelChecker.hpp index ecb376e46a..c4b189435e 100644 --- a/src/mc/ModelChecker.hpp +++ b/src/mc/ModelChecker.hpp @@ -15,8 +15,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** State of the model-checker (global variables for the model checker) */ @@ -73,7 +72,6 @@ private: void handle_waitpid(); }; -} -} +} // namespace simgrid::mc #endif diff --git a/src/mc/Session.cpp b/src/mc/Session.cpp index 3e0fb61293..7b4e357109 100644 --- a/src/mc/Session.cpp +++ b/src/mc/Session.cpp @@ -30,8 +30,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_Session, mc, "Model-checker session"); XBT_LOG_EXTERNAL_CATEGORY(mc_global); -namespace simgrid { -namespace mc { +namespace simgrid::mc { template void run_child_process(int socket, Code code) { @@ -176,5 +175,4 @@ void Session::check_deadlock() const throw DeadlockError(); } } -} -} +} // namespace simgrid::mc diff --git a/src/mc/Session.hpp b/src/mc/Session.hpp index 520cbbf1eb..b84e6fec73 100644 --- a/src/mc/Session.hpp +++ b/src/mc/Session.hpp @@ -12,8 +12,7 @@ #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** A model-checking session * @@ -55,7 +54,6 @@ public: bool actor_is_enabled(aid_t pid) const; }; -} -} +} // namespace simgrid::mc #endif diff --git a/src/mc/VisitedState.cpp b/src/mc/VisitedState.cpp index 16a667614d..6e46c3c3d0 100644 --- a/src/mc/VisitedState.cpp +++ b/src/mc/VisitedState.cpp @@ -14,8 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_VisitedState, mc, "Logging specific to state equality detection mechanisms"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** @brief Save the current state */ VisitedState::VisitedState(unsigned long state_number) : num(state_number) @@ -86,5 +85,4 @@ VisitedStates::addVisitedState(unsigned long state_number, simgrid::mc::State* g return nullptr; } -} -} +} // namespace simgrid::mc diff --git a/src/mc/VisitedState.hpp b/src/mc/VisitedState.hpp index e58bc089e5..33f3d1ae94 100644 --- a/src/mc/VisitedState.hpp +++ b/src/mc/VisitedState.hpp @@ -12,8 +12,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { class XBT_PRIVATE VisitedState { public: @@ -37,7 +36,6 @@ private: void prune(); }; -} -} +} // namespace simgrid::mc #endif diff --git a/src/mc/api.cpp b/src/mc/api.cpp index 48005729fa..840ffef2c4 100644 --- a/src/mc/api.cpp +++ b/src/mc/api.cpp @@ -28,8 +28,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(Api, mc, "Logging specific to MC Facade APIs "); XBT_LOG_EXTERNAL_CATEGORY(mc_global); -namespace simgrid { -namespace mc { +namespace simgrid::mc { simgrid::mc::Exploration* Api::initialize(char** argv, simgrid::mc::ExplorationAlgorithm algo) { @@ -183,5 +182,4 @@ xbt_automaton_state_t Api::get_automaton_transition_dst(xbt_dynar_t const& dynar return transition->dst; } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/api.hpp b/src/mc/api.hpp index 085f299cb8..88b2e0c802 100644 --- a/src/mc/api.hpp +++ b/src/mc/api.hpp @@ -17,8 +17,7 @@ #include "xbt/automaton.hpp" #include "xbt/base.h" -namespace simgrid { -namespace mc { +namespace simgrid::mc { XBT_DECLARE_ENUM_CLASS(ExplorationAlgorithm, Safety, UDPOR, Liveness, CommDeterminism); @@ -93,7 +92,6 @@ public: xbt_automaton_state_t get_automaton_transition_dst(xbt_dynar_t const& dynar, int index) const; }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/api/State.cpp b/src/mc/api/State.cpp index 68d7517f36..e3048b1419 100644 --- a/src/mc/api/State.cpp +++ b/src/mc/api/State.cpp @@ -11,8 +11,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_state, mc, "Logging specific to MC states"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { long State::expended_states_ = 0; @@ -73,5 +72,4 @@ void State::execute_next(int next) transition_.reset(mc_model_checker->handle_simcall(aid, times_considered, true)); mc_model_checker->wait_for_requests(); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/api/State.hpp b/src/mc/api/State.hpp index dd243f862a..84322067ad 100644 --- a/src/mc/api/State.hpp +++ b/src/mc/api/State.hpp @@ -10,8 +10,7 @@ #include "src/mc/sosp/Snapshot.hpp" #include "src/mc/transition/Transition.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /* A node in the exploration graph (kind-of) */ class XBT_PRIVATE State : public xbt::Extendable { @@ -51,7 +50,6 @@ public: /* Returns the total amount of states created so far (for statistics) */ static long get_expanded_states() { return expended_states_; } }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/compare.cpp b/src/mc/compare.cpp index 54190dbb02..6b7ffe1f45 100644 --- a/src/mc/compare.cpp +++ b/src/mc/compare.cpp @@ -13,8 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_compare, mc, "Logging specific to mc_compare in mc"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { /*********************************** Heap comparison ***********************************/ /***************************************************************************************/ @@ -125,8 +124,7 @@ public: void match_equals(const HeapLocationPairs* list); }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc /************************************************************************************/ @@ -153,8 +151,7 @@ static bool is_block_stack(const simgrid::mc::RemoteProcess& process, int block) [block](auto const& stack) { return stack.block == block; }); } -namespace simgrid { -namespace mc { +namespace simgrid::mc { void StateComparator::match_equals(const HeapLocationPairs* list) { @@ -984,8 +981,7 @@ static bool heap_area_differ(const RemoteProcess& process, StateComparator& stat state.match_equals(previous); return false; } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc /************************** Snapshot comparison *******************************/ /******************************************************************************/ @@ -1176,8 +1172,7 @@ static bool local_variables_differ(const simgrid::mc::RemoteProcess& process, si return false; } -namespace simgrid { -namespace mc { +namespace simgrid::mc { bool snapshot_equal(const Snapshot* s1, const Snapshot* s2) { @@ -1265,5 +1260,4 @@ bool snapshot_equal(const Snapshot* s1, const Snapshot* s2) return true; } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/explo/CommunicationDeterminismChecker.cpp b/src/mc/explo/CommunicationDeterminismChecker.cpp index bd4fa6ec5c..4464631415 100644 --- a/src/mc/explo/CommunicationDeterminismChecker.cpp +++ b/src/mc/explo/CommunicationDeterminismChecker.cpp @@ -16,8 +16,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_comm_determinism, mc, "Logging specific to MC communication determinism detection"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { enum class CallType { NONE, SEND, RECV, WAIT, WAITANY }; enum class CommPatternDifference { NONE, TYPE, MBOX, TAG, SRC_PROC, DST_PROC, DATA_SIZE }; @@ -370,5 +369,4 @@ Exploration* create_communication_determinism_checker(Session* session) return new DFSExplorer(session); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/explo/DFSExplorer.cpp b/src/mc/explo/DFSExplorer.cpp index 6025a31df5..b39b7fbe62 100644 --- a/src/mc/explo/DFSExplorer.cpp +++ b/src/mc/explo/DFSExplorer.cpp @@ -24,8 +24,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dfs, mc, "DFS exploration algorithm of the model-checker"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { xbt::signal DFSExplorer::on_exploration_start_signal; xbt::signal DFSExplorer::on_backtracking_signal; @@ -319,5 +318,4 @@ Exploration* create_dfs_exploration(Session* session) return new DFSExplorer(session); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/explo/DFSExplorer.hpp b/src/mc/explo/DFSExplorer.hpp index ceb2a7eb6e..8c59356b9b 100644 --- a/src/mc/explo/DFSExplorer.hpp +++ b/src/mc/explo/DFSExplorer.hpp @@ -15,8 +15,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { class XBT_PRIVATE DFSExplorer : public Exploration { ReductionMode reductionMode_ = ReductionMode::unset; @@ -79,7 +78,6 @@ private: std::unique_ptr visited_state_; }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/explo/Exploration.hpp b/src/mc/explo/Exploration.hpp index 0be71ab095..5b995f7ded 100644 --- a/src/mc/explo/Exploration.hpp +++ b/src/mc/explo/Exploration.hpp @@ -9,8 +9,7 @@ #include "src/mc/api.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** A model-checking exploration algorithm * @@ -64,7 +63,6 @@ XBT_PUBLIC Exploration* create_dfs_exploration(Session* session); XBT_PUBLIC Exploration* create_communication_determinism_checker(Session* session); XBT_PUBLIC Exploration* create_udpor_checker(Session* session); -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/explo/LivenessChecker.cpp b/src/mc/explo/LivenessChecker.cpp index 699d50616e..461ce8a29a 100644 --- a/src/mc/explo/LivenessChecker.cpp +++ b/src/mc/explo/LivenessChecker.cpp @@ -16,8 +16,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_liveness, mc, "Logging specific to algorithms /********* Static functions *********/ -namespace simgrid { -namespace mc { +namespace simgrid::mc { VisitedPair::VisitedPair(int pair_num, xbt_automaton_state_t automaton_state, std::shared_ptr> atomic_propositions, @@ -376,5 +375,4 @@ Exploration* create_liveness_checker(Session* session) return new LivenessChecker(session); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/explo/LivenessChecker.hpp b/src/mc/explo/LivenessChecker.hpp index ea7c0e6fe4..31aa65cca1 100644 --- a/src/mc/explo/LivenessChecker.hpp +++ b/src/mc/explo/LivenessChecker.hpp @@ -15,8 +15,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { class XBT_PRIVATE Pair { public: @@ -79,7 +78,6 @@ private: std::string previous_request_; }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/explo/UdporChecker.cpp b/src/mc/explo/UdporChecker.cpp index fd932b62a3..7f43c4e678 100644 --- a/src/mc/explo/UdporChecker.cpp +++ b/src/mc/explo/UdporChecker.cpp @@ -8,8 +8,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_udpor, mc, "Logging specific to MC safety verification "); -namespace simgrid { -namespace mc { +namespace simgrid::mc { UdporChecker::UdporChecker(Session* session) : Exploration(session) {} @@ -34,5 +33,4 @@ Exploration* create_udpor_checker(Session* session) return new UdporChecker(session); } -} // namespace mc -} // namespace simgrid \ No newline at end of file +} // namespace simgrid::mc diff --git a/src/mc/explo/UdporChecker.hpp b/src/mc/explo/UdporChecker.hpp index 069c515165..168a14a58c 100644 --- a/src/mc/explo/UdporChecker.hpp +++ b/src/mc/explo/UdporChecker.hpp @@ -10,8 +10,7 @@ #include "src/mc/explo/Exploration.hpp" #include "src/mc/mc_record.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { class XBT_PRIVATE UdporChecker : public Exploration { public: @@ -22,7 +21,6 @@ public: void log_state() override; }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/inspect/DwarfExpression.cpp b/src/mc/inspect/DwarfExpression.cpp index 6f765c4b61..45c7c89d22 100644 --- a/src/mc/inspect/DwarfExpression.cpp +++ b/src/mc/inspect/DwarfExpression.cpp @@ -15,8 +15,7 @@ #include "src/mc/inspect/mc_dwarf.hpp" #include "src/mc/mc_private.hpp" -namespace simgrid { -namespace dwarf { +namespace simgrid::dwarf { void execute(const Dwarf_Op* ops, std::size_t n, const ExpressionContext& context, ExpressionStack& stack) { @@ -210,5 +209,4 @@ void execute(const Dwarf_Op* ops, std::size_t n, const ExpressionContext& contex } } -} // namespace dwarf -} // namespace simgrid +} // namespace simgrid::dwarf diff --git a/src/mc/inspect/DwarfExpression.hpp b/src/mc/inspect/DwarfExpression.hpp index fd9be9f923..8e6cfd3b3d 100644 --- a/src/mc/inspect/DwarfExpression.hpp +++ b/src/mc/inspect/DwarfExpression.hpp @@ -25,8 +25,7 @@ * Evaluation of DWARF location expressions. */ -namespace simgrid { -namespace dwarf { +namespace simgrid::dwarf { /** A DWARF expression * @@ -143,7 +142,6 @@ inline void execute(simgrid::dwarf::DwarfExpression const& expression, Expressio execute(expression.data(), expression.size(), context, stack); } -} // namespace dwarf -} // namespace simgrid +} // namespace simgrid::dwarf #endif diff --git a/src/mc/inspect/Frame.cpp b/src/mc/inspect/Frame.cpp index cb8b14d6fd..5934de2a50 100644 --- a/src/mc/inspect/Frame.cpp +++ b/src/mc/inspect/Frame.cpp @@ -10,8 +10,7 @@ #include "src/mc/inspect/Frame.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { void* Frame::frame_base(unw_cursor_t& unw_cursor) const { @@ -32,5 +31,4 @@ void* Frame::frame_base(unw_cursor_t& unw_cursor) const xbt_die("Unexpected location type"); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/inspect/Frame.hpp b/src/mc/inspect/Frame.hpp index f23039ea32..1cc4d57915 100644 --- a/src/mc/inspect/Frame.hpp +++ b/src/mc/inspect/Frame.hpp @@ -17,8 +17,7 @@ #include "src/mc/inspect/Variable.hpp" #include "src/mc/mc_forward.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** Debug information about a given function or scope within a function */ class Frame { @@ -56,7 +55,6 @@ public: void* frame_base(unw_cursor_t& unw_cursor) const; void remove_variable(char* name); }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/inspect/LocationList.cpp b/src/mc/inspect/LocationList.cpp index c7f6013fbf..8cf649c021 100644 --- a/src/mc/inspect/LocationList.cpp +++ b/src/mc/inspect/LocationList.cpp @@ -18,8 +18,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(mc_dwarf); -namespace simgrid { -namespace dwarf { +namespace simgrid::dwarf { /** Resolve a location expression */ Location resolve(simgrid::dwarf::DwarfExpression const& expression, simgrid::mc::ObjectInformation* object_info, @@ -95,5 +94,4 @@ LocationList location_list(const simgrid::mc::ObjectInformation& info, Dwarf_Att return locations; } -} // namespace dwarf -} // namespace simgrid +} // namespace simgrid::dwarf diff --git a/src/mc/inspect/LocationList.hpp b/src/mc/inspect/LocationList.hpp index e0d15483a7..12c79f0716 100644 --- a/src/mc/inspect/LocationList.hpp +++ b/src/mc/inspect/LocationList.hpp @@ -16,8 +16,7 @@ #include #include -namespace simgrid { -namespace dwarf { +namespace simgrid::dwarf { /** A DWARF expression with optional validity constraints */ class LocationListEntry { @@ -74,7 +73,6 @@ Location resolve(simgrid::dwarf::LocationList const& locations, simgrid::mc::Obj XBT_PRIVATE simgrid::dwarf::LocationList location_list(const simgrid::mc::ObjectInformation& info, Dwarf_Attribute& attr); -} // namespace dwarf -} // namespace simgrid +} // namespace simgrid::dwarf #endif diff --git a/src/mc/inspect/ObjectInformation.cpp b/src/mc/inspect/ObjectInformation.cpp index 9f53d2dc99..968d3aab77 100644 --- a/src/mc/inspect/ObjectInformation.cpp +++ b/src/mc/inspect/ObjectInformation.cpp @@ -14,8 +14,7 @@ #include "src/mc/mc_private.hpp" #include "xbt/file.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /* For an executable object, addresses are virtual address (there is no offset) i.e. * \f$\text{virtual address} = \{dwarf address}\f$ @@ -195,5 +194,4 @@ void find_object_address(std::vector const& maps, ObjectInformation* xbt_assert(result->start_exec || result->start_rw || result->start_ro); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/inspect/ObjectInformation.hpp b/src/mc/inspect/ObjectInformation.hpp index 8d7b7b127e..0f3a61489b 100644 --- a/src/mc/inspect/ObjectInformation.hpp +++ b/src/mc/inspect/ObjectInformation.hpp @@ -18,8 +18,7 @@ #include "src/smpi/include/private.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** An entry in the functions index * @@ -166,7 +165,6 @@ XBT_PRIVATE std::shared_ptr createObjectInformation(std::vect /** Augment the current module with information about the other ones */ XBT_PRIVATE void postProcessObjectInformation(const simgrid::mc::RemoteProcess* process, simgrid::mc::ObjectInformation* info); -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/inspect/Type.hpp b/src/mc/inspect/Type.hpp index c6d165549b..6870ea8ddf 100644 --- a/src/mc/inspect/Type.hpp +++ b/src/mc/inspect/Type.hpp @@ -19,8 +19,7 @@ #include "src/mc/inspect/LocationList.hpp" #include "src/mc/mc_forward.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** A member of a structure, union * @@ -102,7 +101,6 @@ public: simgrid::mc::Type* full_type = nullptr; // The same (but more complete) type }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/inspect/Variable.hpp b/src/mc/inspect/Variable.hpp index c3b5395eed..2f837942d7 100644 --- a/src/mc/inspect/Variable.hpp +++ b/src/mc/inspect/Variable.hpp @@ -14,8 +14,7 @@ #include "src/mc/inspect/LocationList.hpp" #include "src/mc/mc_forward.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** A variable (global or local) in the model-checked program */ class Variable { @@ -43,7 +42,6 @@ public: simgrid::mc::ObjectInformation* object_info = nullptr; }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/inspect/mc_dwarf.cpp b/src/mc/inspect/mc_dwarf.cpp index 636d47e02c..553ec19cf6 100644 --- a/src/mc/inspect/mc_dwarf.cpp +++ b/src/mc/inspect/mc_dwarf.cpp @@ -103,8 +103,7 @@ static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, D */ static std::uint64_t MC_dwarf_at_type(Dwarf_Die* die); -namespace simgrid { -namespace dwarf { +namespace simgrid::dwarf { enum class TagClass { Unknown, Type, Subprogram, Variable, Scope, Namespace }; @@ -204,8 +203,7 @@ inline XBT_PRIVATE const char* tagname(Dwarf_Die* die) return tagname(dwarf_tag(die)); } -} // namespace dwarf -} // namespace simgrid +} // namespace simgrid::dwarf // ***** Attributes @@ -1124,8 +1122,7 @@ static void MC_post_process_types(simgrid::mc::ObjectInformation* info) } } -namespace simgrid { -namespace mc { +namespace simgrid::mc { void ObjectInformation::ensure_dwarf_loaded() { @@ -1178,11 +1175,9 @@ void postProcessObjectInformation(const RemoteProcess* process, ObjectInformatio } } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc -namespace simgrid { -namespace dwarf { +namespace simgrid::dwarf { /** Convert a DWARF register into a libunwind register * @@ -1211,5 +1206,4 @@ int dwarf_register_to_libunwind(int dwarf_register) #endif } -} // namespace dwarf -} // namespace simgrid +} // namespace simgrid::dwarf diff --git a/src/mc/inspect/mc_dwarf.hpp b/src/mc/inspect/mc_dwarf.hpp index 33e2e63229..b43ad14083 100644 --- a/src/mc/inspect/mc_dwarf.hpp +++ b/src/mc/inspect/mc_dwarf.hpp @@ -10,8 +10,7 @@ #include "src/mc/mc_forward.hpp" -namespace simgrid { -namespace dwarf { +namespace simgrid::dwarf { XBT_PRIVATE const char* attrname(int attr); XBT_PRIVATE const char* tagname(int tag); @@ -22,7 +21,6 @@ XBT_PRIVATE void* resolve_member(const void* base, const simgrid::mc::Type* type XBT_PRIVATE int dwarf_register_to_libunwind(int dwarf_register); -} // namespace dwarf -} // namespace simgrid +} // namespace simgrid::dwarf #endif diff --git a/src/mc/inspect/mc_dwarf_attrnames.cpp b/src/mc/inspect/mc_dwarf_attrnames.cpp index e684c5beea..b3eae0478a 100644 --- a/src/mc/inspect/mc_dwarf_attrnames.cpp +++ b/src/mc/inspect/mc_dwarf_attrnames.cpp @@ -154,8 +154,7 @@ const std::unordered_map attrname_map = { }; } -namespace simgrid { -namespace dwarf { +namespace simgrid::dwarf { /** @brief Get the name of an attribute (DW_AT_*) from its code * @@ -169,5 +168,4 @@ const char* attrname(int attr) return name == attrname_map.end() ? "DW_AT_unknown" : name->second; } -} // namespace dwarf -} // namespace simgrid +} // namespace simgrid::dwarf diff --git a/src/mc/inspect/mc_dwarf_tagnames.cpp b/src/mc/inspect/mc_dwarf_tagnames.cpp index 87fc3501ba..a75395b31f 100644 --- a/src/mc/inspect/mc_dwarf_tagnames.cpp +++ b/src/mc/inspect/mc_dwarf_tagnames.cpp @@ -90,8 +90,7 @@ const std::unordered_map tagname_map = { }; } -namespace simgrid { -namespace dwarf { +namespace simgrid::dwarf { /** @brief Get the name of a dwarf tag (DW_TAG_*) from its code * @@ -105,5 +104,4 @@ const char* tagname(int tag) return name == tagname_map.end() ? "DW_TAG_unknown" : name->second; } -} // namespace dwarf -} // namespace simgrid +} // namespace simgrid::dwarf diff --git a/src/mc/inspect/mc_member.cpp b/src/mc/inspect/mc_member.cpp index d9fba29ceb..1ab3a18e33 100644 --- a/src/mc/inspect/mc_member.cpp +++ b/src/mc/inspect/mc_member.cpp @@ -7,8 +7,7 @@ #include "src/mc/inspect/mc_dwarf.hpp" #include "src/mc/mc_private.hpp" -namespace simgrid { -namespace dwarf { +namespace simgrid::dwarf { /** Resolve snapshot in the process address space * @@ -30,5 +29,4 @@ void* resolve_member(const void* base, const simgrid::mc::Type* /*type*/, const return (void*)stack.top(); } -} // namespace dwarf -} // namespace simgrid +} // namespace simgrid::dwarf diff --git a/src/mc/inspect/mc_unw.cpp b/src/mc/inspect/mc_unw.cpp index 97e9a53aba..5806cacb08 100644 --- a/src/mc/inspect/mc_unw.cpp +++ b/src/mc/inspect/mc_unw.cpp @@ -25,8 +25,7 @@ typedef register_t greg_t; #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { // ***** Implementation @@ -250,5 +249,4 @@ unw_cursor_t UnwindContext::cursor() return cursor; } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/inspect/mc_unw.hpp b/src/mc/inspect/mc_unw.hpp index 49c91837d9..606dc63387 100644 --- a/src/mc/inspect/mc_unw.hpp +++ b/src/mc/inspect/mc_unw.hpp @@ -31,16 +31,13 @@ #include #include -namespace simgrid { -namespace unw { +namespace simgrid::unw { XBT_PRIVATE unw_addr_space_t create_addr_space(); XBT_PRIVATE void* create_context(unw_addr_space_t as, pid_t pid); -} // namespace unw -} // namespace simgrid +} // namespace simgrid::unw -namespace simgrid { -namespace mc { +namespace simgrid::mc { class UnwindContext { simgrid::mc::AddressSpace* address_space_ = nullptr; @@ -68,7 +65,6 @@ public: }; void dumpStack(FILE* file, unw_cursor_t* cursor); -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/inspect/mc_unw_vmread.cpp b/src/mc/inspect/mc_unw_vmread.cpp index 6588e36ef0..4515ea6ec5 100644 --- a/src/mc/inspect/mc_unw_vmread.cpp +++ b/src/mc/inspect/mc_unw_vmread.cpp @@ -90,8 +90,7 @@ static int access_mem(const unw_addr_space_t as, const unw_word_t addr, unw_word return 0; } -namespace simgrid { -namespace unw { +namespace simgrid::unw { unw_addr_space_t create_addr_space() { @@ -119,5 +118,4 @@ void* create_context(unw_addr_space_t /*as*/, pid_t pid) return _UPT_create(pid); } -} // namespace unw -} // namespace simgrid +} // namespace simgrid::unw diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index ad173e5558..fe612c92ad 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -35,8 +35,7 @@ int MC_random(int min, int max) return simgrid::kernel::actor::simcall_answered([&observer] { return observer.get_value(); }, &observer); } -namespace simgrid { -namespace mc { +namespace simgrid::mc { void execute_actors() { @@ -108,5 +107,4 @@ bool request_is_visible(const kernel::actor::Simcall* req) return false; } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/mc_base.hpp b/src/mc/mc_base.hpp index 84bf8be7d8..5d30ac9144 100644 --- a/src/mc/mc_base.hpp +++ b/src/mc/mc_base.hpp @@ -9,8 +9,7 @@ #include "simgrid/forward.h" #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** Execute everything which is invisible * @@ -38,7 +37,6 @@ XBT_PRIVATE bool actor_is_enabled(kernel::actor::ActorImpl* process); /** Check if the given simcall is visible */ XBT_PRIVATE bool request_is_visible(const kernel::actor::Simcall* req); -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/mc_config.cpp b/src/mc/mc_config.cpp index 1b758b4ed0..f33a8959a1 100644 --- a/src/mc/mc_config.cpp +++ b/src/mc/mc_config.cpp @@ -13,12 +13,10 @@ #endif #if SIMGRID_HAVE_MC -namespace simgrid { -namespace mc { +namespace simgrid::mc { /* Configuration support */ simgrid::mc::ReductionMode reduction_mode = simgrid::mc::ReductionMode::unset; -} -} +} // namespace simgrid::mc #else #define _sg_do_model_check 0 #endif diff --git a/src/mc/mc_exit.hpp b/src/mc/mc_exit.hpp index 806b4883c3..273384bd2c 100644 --- a/src/mc/mc_exit.hpp +++ b/src/mc/mc_exit.hpp @@ -18,15 +18,13 @@ constexpr int SIMGRID_MC_EXIT_PROGRAM_CRASH = 6; constexpr int SIMGRID_MC_EXIT_ERROR = 63; -namespace simgrid { -namespace mc { +namespace simgrid::mc { class XBT_PUBLIC DeadlockError : public std::exception { }; class XBT_PUBLIC TerminationError : public std::exception { }; class XBT_PUBLIC LivenessError : public std::exception { }; -} -} +} // namespace simgrid::mc #endif diff --git a/src/mc/mc_forward.hpp b/src/mc/mc_forward.hpp index 5972ec1ca9..df5257122f 100644 --- a/src/mc/mc_forward.hpp +++ b/src/mc/mc_forward.hpp @@ -11,8 +11,7 @@ #ifndef SIMGRID_MC_FORWARD_HPP #define SIMGRID_MC_FORWARD_HPP -namespace simgrid { -namespace mc { +namespace simgrid::mc { class PageStore; class ChunkedData; @@ -30,8 +29,7 @@ class ActorInformation; class Session; class Exploration; -} -} +} // namespace simgrid::mc // TODO, try to get rid of the global ModelChecker variable extern simgrid::mc::ModelChecker* mc_model_checker; diff --git a/src/mc/mc_global.cpp b/src/mc/mc_global.cpp index 24631fe7ee..ef212045bf 100644 --- a/src/mc/mc_global.cpp +++ b/src/mc/mc_global.cpp @@ -31,12 +31,10 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc, "Logging specific to MC (global)"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { std::vector processes_time; -} } #if SIMGRID_HAVE_MC @@ -53,9 +51,7 @@ void MC_init_dot_output() "digraph graphname{\n fixedsize=true; rankdir=TB; ranksep=.25; edge [fontsize=12]; node [fontsize=10, shape=circle,width=.5 ]; graph [resolution=20, fontsize=10];\n"); } - -namespace simgrid { -namespace mc { +namespace simgrid::mc { /* Liveness */ xbt_automaton_t property_automaton = nullptr; @@ -88,8 +84,7 @@ void dumpStack(FILE* file, unw_cursor_t* cursor) } while (unw_step(cursor)); } -} -} +} // namespace simgrid::mc #endif double MC_process_clock_get(const simgrid::kernel::actor::ActorImpl* process) diff --git a/src/mc/mc_hash.cpp b/src/mc/mc_hash.cpp index 3a9118aebb..8b667d00e2 100644 --- a/src/mc/mc_hash.cpp +++ b/src/mc/mc_hash.cpp @@ -16,8 +16,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_hash, mc, "Logging specific to mc_hash"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { namespace { @@ -49,5 +48,4 @@ hash_type hash(Snapshot const& snapshot) return hash.value(); } -} -} +} // namespace simgrid::mc diff --git a/src/mc/mc_hash.hpp b/src/mc/mc_hash.hpp index 9c9cbf150d..03110a7654 100644 --- a/src/mc/mc_hash.hpp +++ b/src/mc/mc_hash.hpp @@ -9,14 +9,12 @@ #include "xbt/base.h" #include "src/mc/mc_forward.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { using hash_type = std::uint64_t; XBT_PRIVATE hash_type hash(simgrid::mc::Snapshot const& snapshot); -} -} +} // namespace simgrid::mc #endif diff --git a/src/mc/mc_mmu.hpp b/src/mc/mc_mmu.hpp index 5d20836cca..d1c2e02bfd 100644 --- a/src/mc/mc_mmu.hpp +++ b/src/mc/mc_mmu.hpp @@ -18,10 +18,8 @@ extern "C" int xbt_pagesize; /** Number of bits of addresses inside a given page, log2(xbt_pagesize). */ extern "C" int xbt_pagebits; -namespace simgrid { -namespace mc { +namespace simgrid::mc::mmu { // TODO, do not depend on xbt_pagesize/xbt_pagebits but our own chunk size -namespace mmu { /** @brief How many memory pages are necessary to store size bytes? * @@ -57,8 +55,6 @@ static XBT_ALWAYS_INLINE bool same_chunk(std::uintptr_t a, std::uintptr_t b) { return (a >> xbt_pagebits) == (b >> xbt_pagebits); } -} -} -} +} // namespace simgrid::mc::mmu #endif diff --git a/src/mc/mc_pattern.hpp b/src/mc/mc_pattern.hpp index a901c14b2d..8702a24e64 100644 --- a/src/mc/mc_pattern.hpp +++ b/src/mc/mc_pattern.hpp @@ -9,8 +9,7 @@ #include "src/kernel/activity/CommImpl.hpp" #include "src/mc/remote/RemotePtr.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /* On every state, each actor has an entry of the following type. * This represents both the actor and its transition because @@ -51,7 +50,6 @@ public: void set_done() { this->state_ = InterleavingType::done; } }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/mc_private.hpp b/src/mc/mc_private.hpp index d026f59bfe..fc37957cce 100644 --- a/src/mc/mc_private.hpp +++ b/src/mc/mc_private.hpp @@ -19,8 +19,7 @@ XBT_PRIVATE void MC_init_dot_output(); XBT_PRIVATE extern FILE* dot_output; /********************************** Miscellaneous **********************************/ -namespace simgrid { -namespace mc { +namespace simgrid::mc { XBT_PRIVATE void find_object_address(std::vector const& maps, simgrid::mc::ObjectInformation* result); @@ -30,7 +29,6 @@ bool snapshot_equal(const Snapshot* s1, const Snapshot* s2); // Move is somewhere else (in the LivenessChecker class, in the Session class?): extern XBT_PRIVATE xbt_automaton_t property_automaton; -} -} +} // namespace simgrid::mc #endif diff --git a/src/mc/mc_record.cpp b/src/mc/mc_record.cpp index e074d8e536..72483fe420 100644 --- a/src/mc/mc_record.cpp +++ b/src/mc/mc_record.cpp @@ -18,8 +18,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_record, mc, "Logging specific to MC record/replay facility"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { void RecordTrace::replay() const { @@ -92,5 +91,4 @@ std::string simgrid::mc::RecordTrace::to_string() const #endif -} -} +} // namespace simgrid::mc diff --git a/src/mc/mc_record.hpp b/src/mc/mc_record.hpp index e63da6106a..d8cf3a346f 100644 --- a/src/mc/mc_record.hpp +++ b/src/mc/mc_record.hpp @@ -22,8 +22,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { class RecordTrace { std::vector transitions_; @@ -45,7 +44,6 @@ public: static void replay(const std::string& trace); }; -} -} +} // namespace simgrid::mc #endif diff --git a/src/mc/mc_safety.hpp b/src/mc/mc_safety.hpp index 077d7ed063..e16f12e025 100644 --- a/src/mc/mc_safety.hpp +++ b/src/mc/mc_safety.hpp @@ -8,8 +8,7 @@ #include "xbt/base.h" -namespace simgrid { -namespace mc { +namespace simgrid::mc { enum class ReductionMode { unset, @@ -18,7 +17,6 @@ enum class ReductionMode { }; extern XBT_PRIVATE simgrid::mc::ReductionMode reduction_mode; -} -} +} // namespace simgrid::mc #endif diff --git a/src/mc/mc_smx.cpp b/src/mc/mc_smx.cpp index 344212fdf0..7593fc29f7 100644 --- a/src/mc/mc_smx.cpp +++ b/src/mc/mc_smx.cpp @@ -53,8 +53,7 @@ static void MC_process_refresh_simix_actor_dynar(const simgrid::mc::RemoteProces } ::operator delete(data); } -namespace simgrid { -namespace mc { +namespace simgrid::mc { void RemoteProcess::refresh_simix() { @@ -66,5 +65,4 @@ void RemoteProcess::refresh_simix() this->cache_flags_ |= RemoteProcess::cache_simix_processes; } -} -} +} // namespace simgrid::mc diff --git a/src/mc/remote/AppSide.cpp b/src/mc/remote/AppSide.cpp index e222ab7865..8d612f150a 100644 --- a/src/mc/remote/AppSide.cpp +++ b/src/mc/remote/AppSide.cpp @@ -30,8 +30,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_client, mc, "MC client logic"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { std::unique_ptr AppSide::instance_; @@ -284,5 +283,4 @@ void AppSide::declare_stack(void* stack, size_t size, ucontext_t* context) const message.stack_region = region; xbt_assert(channel_.send(message) == 0, "Could not send STACK_REGION to model-checker"); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/remote/AppSide.hpp b/src/mc/remote/AppSide.hpp index beeb920097..393f1ea4d4 100644 --- a/src/mc/remote/AppSide.hpp +++ b/src/mc/remote/AppSide.hpp @@ -12,8 +12,7 @@ #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** Model-checked-side of the communication protocol * @@ -53,7 +52,6 @@ public: static AppSide* initialize(xbt_dynar_t actors_addr); static AppSide* get() { return instance_.get(); } }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/remote/Channel.cpp b/src/mc/remote/Channel.cpp index 43ace95034..8155d847ee 100644 --- a/src/mc/remote/Channel.cpp +++ b/src/mc/remote/Channel.cpp @@ -15,8 +15,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_Channel, mc, "MC interprocess communication"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { Channel::~Channel() { @@ -46,5 +45,4 @@ ssize_t Channel::receive(void* message, size_t size, bool block) const XBT_ERROR("Channel::receive failure: %s", strerror(errno)); return res; } -} -} +} // namespace simgrid::mc diff --git a/src/mc/remote/Channel.hpp b/src/mc/remote/Channel.hpp index 0da0a08237..8dfef7ee12 100644 --- a/src/mc/remote/Channel.hpp +++ b/src/mc/remote/Channel.hpp @@ -10,8 +10,7 @@ #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** A channel for exchanging messages between model-checker and model-checked app * @@ -52,7 +51,6 @@ public: int get_socket() const { return socket_; } }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/remote/CheckerSide.cpp b/src/mc/remote/CheckerSide.cpp index 353e0509c9..06c489a113 100644 --- a/src/mc/remote/CheckerSide.cpp +++ b/src/mc/remote/CheckerSide.cpp @@ -7,8 +7,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { void CheckerSide::start(void (*handler)(int, short, void*), ModelChecker* mc) { @@ -34,5 +33,4 @@ void CheckerSide::break_loop() const event_base_loopbreak(base_.get()); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/remote/CheckerSide.hpp b/src/mc/remote/CheckerSide.hpp index c45602a35a..c4355cea17 100644 --- a/src/mc/remote/CheckerSide.hpp +++ b/src/mc/remote/CheckerSide.hpp @@ -13,8 +13,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { class CheckerSide { std::unique_ptr base_{nullptr, &event_base_free}; @@ -39,7 +38,6 @@ public: void break_loop() const; }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/remote/RemoteProcess.cpp b/src/mc/remote/RemoteProcess.cpp index cb574a50fc..654717d3ff 100644 --- a/src/mc/remote/RemoteProcess.cpp +++ b/src/mc/remote/RemoteProcess.cpp @@ -25,8 +25,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_process, mc, "MC process information"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { // ***** Helper stuff @@ -445,5 +444,4 @@ void RemoteProcess::dump_stack() const _UPT_destroy(context); unw_destroy_addr_space(as); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/remote/RemoteProcess.hpp b/src/mc/remote/RemoteProcess.hpp index 1eec7fa8cc..47f6151fb0 100644 --- a/src/mc/remote/RemoteProcess.hpp +++ b/src/mc/remote/RemoteProcess.hpp @@ -18,8 +18,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { class ActorInformation { public: @@ -253,7 +252,6 @@ public: /** Open a FD to a remote process memory (`/dev/$pid/mem`) */ XBT_PRIVATE int open_vm(pid_t pid, int flags); -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/remote/RemotePtr.hpp b/src/mc/remote/RemotePtr.hpp index 90ad5c5d98..b8dc09a9d2 100644 --- a/src/mc/remote/RemotePtr.hpp +++ b/src/mc/remote/RemotePtr.hpp @@ -8,8 +8,7 @@ #include "src/kernel/actor/ActorImpl.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** HACK, A value from another process * @@ -135,7 +134,6 @@ template inline RemotePtr remote(uint64_t p) { return RemotePtr(p); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/remote/mc_protocol.h b/src/mc/remote/mc_protocol.h index 67716eba8c..e83a281459 100644 --- a/src/mc/remote/mc_protocol.h +++ b/src/mc/remote/mc_protocol.h @@ -27,15 +27,13 @@ #include // ***** Messages -namespace simgrid { -namespace mc { +namespace simgrid::mc { XBT_DECLARE_ENUM_CLASS(MessageType, NONE, INITIAL_ADDRESSES, CONTINUE, IGNORE_HEAP, UNIGNORE_HEAP, IGNORE_MEMORY, STACK_REGION, REGISTER_SYMBOL, DEADLOCK_CHECK, DEADLOCK_CHECK_REPLY, WAITING, SIMCALL_EXECUTE, SIMCALL_EXECUTE_ANSWER, ASSERTION_FAILED, ACTOR_ENABLED, ACTOR_ENABLED_REPLY, FINALIZE); -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc constexpr unsigned MC_MESSAGE_LENGTH = 512; constexpr unsigned SIMCALL_SERIALIZATION_BUFFER_SIZE = 2048; diff --git a/src/mc/sosp/ChunkedData.cpp b/src/mc/sosp/ChunkedData.cpp index d3fc11146a..b3c0cb83cc 100644 --- a/src/mc/sosp/ChunkedData.cpp +++ b/src/mc/sosp/ChunkedData.cpp @@ -6,8 +6,7 @@ #include "src/mc/AddressSpace.hpp" #include "src/mc/sosp/ChunkedData.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** Take a per-page snapshot of a region * @@ -39,5 +38,4 @@ ChunkedData::ChunkedData(PageStore& store, const AddressSpace& as, RemotePtr addr, std::size_t page_count); }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/sosp/PageStore.cpp b/src/mc/sosp/PageStore.cpp index f37ae0869d..5944652646 100644 --- a/src/mc/sosp/PageStore.cpp +++ b/src/mc/sosp/PageStore.cpp @@ -19,8 +19,7 @@ #include // memcpy, memcmp #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** @brief Compute a hash for the given memory page * @@ -156,5 +155,4 @@ std::size_t PageStore::store_page(const void* page) return pageno; } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/sosp/PageStore.hpp b/src/mc/sosp/PageStore.hpp index 1764483216..6079621601 100644 --- a/src/mc/sosp/PageStore.hpp +++ b/src/mc/sosp/PageStore.hpp @@ -17,8 +17,7 @@ #define XBT_ALWAYS_INLINE inline __attribute__((always_inline)) #endif -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** @brief Storage for snapshot memory pages * @@ -189,7 +188,6 @@ XBT_ALWAYS_INLINE std::size_t PageStore::capacity() const return this->capacity_; } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/sosp/Region.cpp b/src/mc/sosp/Region.cpp index e33d13c485..74b573f1ce 100644 --- a/src/mc/sosp/Region.cpp +++ b/src/mc/sosp/Region.cpp @@ -15,8 +15,7 @@ #define MAP_POPULATE MAP_PREFAULT_READ #endif -namespace simgrid { -namespace mc { +namespace simgrid::mc { Region::Region(RegionType region_type, void* start_addr, size_t size) : region_type_(region_type), start_addr_(start_addr), size_(size) @@ -89,8 +88,7 @@ void* Region::read(void* target, const void* addr, std::size_t size) const return target; } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc /** Compare memory between snapshots (with known regions) * diff --git a/src/mc/sosp/Region.hpp b/src/mc/sosp/Region.hpp index 9a20d47d61..e1685d1afa 100644 --- a/src/mc/sosp/Region.hpp +++ b/src/mc/sosp/Region.hpp @@ -12,8 +12,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { enum class RegionType { Heap = 1, Data = 2 }; @@ -71,8 +70,7 @@ public: void* read(void* target, const void* addr, std::size_t size) const; }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc int MC_snapshot_region_memcmp(const void* addr1, const simgrid::mc::Region* region1, const void* addr2, const simgrid::mc::Region* region2, std::size_t size); diff --git a/src/mc/sosp/Snapshot.cpp b/src/mc/sosp/Snapshot.cpp index cb495f0eef..6b07c1f544 100644 --- a/src/mc/sosp/Snapshot.cpp +++ b/src/mc/sosp/Snapshot.cpp @@ -10,8 +10,7 @@ #include /* std::size_t */ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_snapshot, mc, "Taking and restoring snapshots"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { /************************************* Take Snapshot ************************************/ /****************************************************************************************/ @@ -289,5 +288,4 @@ void Snapshot::restore(RemoteProcess* process) const process->clear_cache(); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/sosp/Snapshot.hpp b/src/mc/sosp/Snapshot.hpp index 3b2a40deac..412c7b998c 100644 --- a/src/mc/sosp/Snapshot.hpp +++ b/src/mc/sosp/Snapshot.hpp @@ -54,8 +54,7 @@ struct XBT_PRIVATE s_mc_snapshot_stack_t { using mc_snapshot_stack_t = s_mc_snapshot_stack_t*; using const_mc_snapshot_stack_t = const s_mc_snapshot_stack_t*; -namespace simgrid { -namespace mc { +namespace simgrid::mc { class XBT_PRIVATE Snapshot final : public AddressSpace { public: @@ -91,7 +90,6 @@ private: void snapshot_regions(RemoteProcess* process); void snapshot_stacks(RemoteProcess* process); }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/transition/Transition.cpp b/src/mc/transition/Transition.cpp index c01936c0de..9b41ff60a9 100644 --- a/src/mc/transition/Transition.cpp +++ b/src/mc/transition/Transition.cpp @@ -20,8 +20,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_transition, mc, "Logging specific to MC transitions"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { unsigned long Transition::executed_transitions_ = 0; unsigned long Transition::replayed_transitions_ = 0; @@ -103,5 +102,4 @@ Transition* deserialize_transition(aid_t issuer, int times_considered, std::stri #endif } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/transition/Transition.hpp b/src/mc/transition/Transition.hpp index e06a460aa0..19e30b9051 100644 --- a/src/mc/transition/Transition.hpp +++ b/src/mc/transition/Transition.hpp @@ -12,8 +12,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** An element in the recorded path * @@ -79,7 +78,6 @@ public: /** Make a new transition from serialized description */ Transition* deserialize_transition(aid_t issuer, int times_considered, std::stringstream& stream); -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/transition/TransitionAny.cpp b/src/mc/transition/TransitionAny.cpp index 74c84e080d..d590c5f5a1 100644 --- a/src/mc/transition/TransitionAny.cpp +++ b/src/mc/transition/TransitionAny.cpp @@ -16,8 +16,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_trans_any, mc_transition, "Logging specific to MC WaitAny / TestAny transitions"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { TestAnyTransition::TestAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream) : Transition(Type::TESTANY, issuer, times_considered) @@ -65,5 +64,4 @@ bool WaitAnyTransition::depends(const Transition* other) const return transitions_[times_considered_]->depends(other); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/transition/TransitionAny.hpp b/src/mc/transition/TransitionAny.hpp index 25f67dd0cc..2774d28327 100644 --- a/src/mc/transition/TransitionAny.hpp +++ b/src/mc/transition/TransitionAny.hpp @@ -12,8 +12,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { class TestAnyTransition : public Transition { std::vector transitions_; @@ -37,7 +36,6 @@ public: Transition* get_current_transition() const { return transitions_.at(times_considered_); } }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/transition/TransitionComm.cpp b/src/mc/transition/TransitionComm.cpp index 1ddabd158a..916dd8ba85 100644 --- a/src/mc/transition/TransitionComm.cpp +++ b/src/mc/transition/TransitionComm.cpp @@ -17,8 +17,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_trans_comm, mc_transition, "Logging specific to MC transitions about communications"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { CommWaitTransition::CommWaitTransition(aid_t issuer, int times_considered, std::stringstream& stream) : Transition(Type::COMM_WAIT, issuer, times_considered) @@ -210,5 +209,4 @@ bool CommSendTransition::depends(const Transition* other) const return false; // Comm transitions are INDEP with non-comm transitions } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/transition/TransitionComm.hpp b/src/mc/transition/TransitionComm.hpp index bca9fc202e..e5d0a7aa1f 100644 --- a/src/mc/transition/TransitionComm.hpp +++ b/src/mc/transition/TransitionComm.hpp @@ -12,8 +12,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { class CommRecvTransition; class CommSendTransition; @@ -133,7 +132,6 @@ public: /** Make a new transition from serialized description */ Transition* deserialize_transition(aid_t issuer, int times_considered, std::stringstream& stream); -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/transition/TransitionRandom.cpp b/src/mc/transition/TransitionRandom.cpp index 79f99323d0..aa01c70536 100644 --- a/src/mc/transition/TransitionRandom.cpp +++ b/src/mc/transition/TransitionRandom.cpp @@ -11,8 +11,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_trans_rand, mc_transition, "Logging specific to MC Random transitions"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { std::string RandomTransition::to_string(bool verbose) const { return xbt::string_printf("Random([%d;%d] ~> %d)", min_, max_, times_considered_); @@ -24,5 +23,4 @@ RandomTransition::RandomTransition(aid_t issuer, int times_considered, std::stri xbt_assert(stream >> min_ >> max_); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/transition/TransitionRandom.hpp b/src/mc/transition/TransitionRandom.hpp index a47a0977b9..8c53c3b0eb 100644 --- a/src/mc/transition/TransitionRandom.hpp +++ b/src/mc/transition/TransitionRandom.hpp @@ -8,8 +8,7 @@ #include "src/mc/transition/Transition.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { class RandomTransition : public Transition { int min_; @@ -21,7 +20,6 @@ public: bool depends(const Transition* other) const override { return false; } // Independent with any other transition }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/transition/TransitionSynchro.cpp b/src/mc/transition/TransitionSynchro.cpp index 2c6b916f8c..99aa4c2028 100644 --- a/src/mc/transition/TransitionSynchro.cpp +++ b/src/mc/transition/TransitionSynchro.cpp @@ -13,8 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_trans_synchro, mc_transition, "Logging specific to MC synchronization transitions"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { std::string BarrierTransition::to_string(bool verbose) const { @@ -148,5 +147,4 @@ bool SemaphoreTransition::depends(const Transition* o) const return false; // semaphores are INDEP with non-semaphore transitions } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/transition/TransitionSynchro.hpp b/src/mc/transition/TransitionSynchro.hpp index bea07f268f..9f53a3a767 100644 --- a/src/mc/transition/TransitionSynchro.hpp +++ b/src/mc/transition/TransitionSynchro.hpp @@ -8,8 +8,7 @@ #include "src/mc/transition/Transition.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { class BarrierTransition : public Transition { unsigned bar_; @@ -40,7 +39,6 @@ public: bool depends(const Transition* other) const override; }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/mc/udpor_global.cpp b/src/mc/udpor_global.cpp index 8241c229a5..b3815246cc 100644 --- a/src/mc/udpor_global.cpp +++ b/src/mc/udpor_global.cpp @@ -9,8 +9,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_udpor_global, mc, "udpor_global"); -namespace simgrid { -namespace mc { +namespace simgrid::mc { EventSet EvtSetTools::makeUnion(const EventSet& s1, const EventSet& s2) { @@ -31,5 +30,4 @@ bool EvtSetTools::contains(const EventSet& events, const UnfoldingEvent* e) return std::any_of(events.begin(), events.end(), [e](const UnfoldingEvent* evt) { return *evt == *e; }); } -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc diff --git a/src/mc/udpor_global.hpp b/src/mc/udpor_global.hpp index 72ea1794c1..60a6eb0947 100644 --- a/src/mc/udpor_global.hpp +++ b/src/mc/udpor_global.hpp @@ -10,8 +10,7 @@ #include #include -namespace simgrid { -namespace mc { +namespace simgrid::mc { class UnfoldingEvent; using EventSet = std::deque; @@ -94,6 +93,5 @@ private: bool transition_is_ISend(const UnfoldingEvent* testedEvt, const UnfoldingEvent* SdRcEvt) const; bool check_tr_concern_same_comm(bool& chk1, bool& chk2, UnfoldingEvent* evt1, UnfoldingEvent* evt2) const; }; -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif diff --git a/src/msg/msg_comm.cpp b/src/msg/msg_comm.cpp index 318d93c48f..049c669ff7 100644 --- a/src/msg/msg_comm.cpp +++ b/src/msg/msg_comm.cpp @@ -13,8 +13,7 @@ #include "src/instr/instr_private.hpp" #include "src/msg/msg_private.hpp" -namespace simgrid { -namespace msg { +namespace simgrid::msg { bool Comm::test() { @@ -60,8 +59,7 @@ msg_error_t Comm::wait_for(double timeout) return status_; } -} // namespace msg -} // namespace simgrid +} // namespace simgrid::msg /** * @brief Checks whether a communication is done, and if yes, finalizes it. diff --git a/src/plugins/ProducerConsumer.cpp b/src/plugins/ProducerConsumer.cpp index c7fc0902ad..521bf6652f 100644 --- a/src/plugins/ProducerConsumer.cpp +++ b/src/plugins/ProducerConsumer.cpp @@ -7,8 +7,6 @@ XBT_LOG_NEW_CATEGORY(producer_consumer, "Producer-Consumer plugin logging category"); -namespace simgrid { -namespace plugin { +namespace simgrid::plugin { unsigned long pc_id = 0; } -} diff --git a/src/plugins/host_dvfs.cpp b/src/plugins/host_dvfs.cpp index 763f33c65c..9245029d21 100644 --- a/src/plugins/host_dvfs.cpp +++ b/src/plugins/host_dvfs.cpp @@ -66,10 +66,7 @@ static simgrid::config::Flag XBT_LOG_NEW_DEFAULT_SUBCATEGORY(host_dvfs, kernel, "Logging specific to the HostDvfs plugin"); -namespace simgrid { -namespace plugin { - -namespace dvfs { +namespace simgrid::plugin::dvfs { /** * Add this to your host tag: @@ -361,9 +358,7 @@ public: void update() override {} }; #endif -} // namespace dvfs -} // namespace plugin -} // namespace simgrid +} // namespace simgrid::plugin::dvfs /* **************************** events callback *************************** */ static void on_host_added(simgrid::s4u::Host& host) diff --git a/src/plugins/host_energy.cpp b/src/plugins/host_energy.cpp index fa9578f3f1..6d9483d501 100644 --- a/src/plugins/host_energy.cpp +++ b/src/plugins/host_energy.cpp @@ -115,8 +115,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(host_energy, kernel, "Logging specific to the ho // Forwards declaration needed to make this function a friend (because friends have external linkage by default) static void on_simulation_end(); -namespace simgrid { -namespace plugin { +namespace simgrid::plugin { class PowerRange { public: @@ -391,8 +390,7 @@ void HostEnergy::init_watts_range_list() has_pstate_power_values_ = true; } -} // namespace plugin -} // namespace simgrid +} // namespace simgrid::plugin using simgrid::plugin::HostEnergy; diff --git a/src/plugins/host_load.cpp b/src/plugins/host_load.cpp index da3e76a946..0c1d0753cf 100644 --- a/src/plugins/host_load.cpp +++ b/src/plugins/host_load.cpp @@ -34,8 +34,7 @@ It attaches an extension to each host to store some data, and places callbacks i XBT_LOG_NEW_DEFAULT_SUBCATEGORY(host_load, kernel, "Logging specific to the HostLoad plugin"); -namespace simgrid { -namespace plugin { +namespace simgrid::plugin { static const double activity_uninitialized_remaining_cost = -1; @@ -190,8 +189,7 @@ void HostLoad::reset() current_flops_ = host_->get_load(); current_speed_ = host_->get_speed(); } -} // namespace plugin -} // namespace simgrid +} // namespace simgrid::plugin using simgrid::plugin::HostLoad; diff --git a/src/plugins/link_energy.cpp b/src/plugins/link_energy.cpp index 50464200d0..51bd89c211 100644 --- a/src/plugins/link_energy.cpp +++ b/src/plugins/link_energy.cpp @@ -41,8 +41,7 @@ SIMGRID_REGISTER_PLUGIN(link_energy, "Link energy consumption.", &sg_link_energy XBT_LOG_NEW_DEFAULT_SUBCATEGORY(link_energy, kernel, "Logging specific to the LinkEnergy plugin"); -namespace simgrid { -namespace plugin { +namespace simgrid::plugin { class LinkEnergy { s4u::Link* link_{}; @@ -141,8 +140,7 @@ double LinkEnergy::get_consumed_energy() kernel::actor::simcall_answered(std::bind(&LinkEnergy::update, this)); return this->total_energy_; } -} // namespace plugin -} // namespace simgrid +} // namespace simgrid::plugin using simgrid::plugin::LinkEnergy; diff --git a/src/plugins/link_energy_wifi.cpp b/src/plugins/link_energy_wifi.cpp index 954a54f782..5b46eb975f 100644 --- a/src/plugins/link_energy_wifi.cpp +++ b/src/plugins/link_energy_wifi.cpp @@ -22,8 +22,7 @@ SIMGRID_REGISTER_PLUGIN(link_energy_wifi, "Energy wifi test", &sg_wifi_energy_pl XBT_LOG_NEW_DEFAULT_SUBCATEGORY(link_energy_wifi, kernel, "Logging specific to the link energy wifi plugin"); -namespace simgrid { -namespace plugin { +namespace simgrid::plugin { class XBT_PRIVATE LinkEnergyWifi { // associative array keeping size of data already sent for a given flow (required for interleaved actions) @@ -261,8 +260,7 @@ void LinkEnergyWifi::init_watts_range_list() } } -} // namespace plugin -} // namespace simgrid +} // namespace simgrid::plugin using simgrid::plugin::LinkEnergyWifi; /* **************************** events callback *************************** */ diff --git a/src/plugins/link_load.cpp b/src/plugins/link_load.cpp index f6089c93fd..0ecac0cac9 100644 --- a/src/plugins/link_load.cpp +++ b/src/plugins/link_load.cpp @@ -34,8 +34,7 @@ SIMGRID_REGISTER_PLUGIN(link_load, "Link cumulated load.", &sg_link_load_plugin_ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(link_load, kernel, "Logging specific to the LinkLoad plugin"); -namespace simgrid { -namespace plugin { +namespace simgrid::plugin { class LinkLoad { s4u::Link* link_{}; /*< The link onto which this data is attached*/ @@ -156,8 +155,7 @@ double LinkLoad::get_average_bytes() return 0; } -} // namespace plugin -} // namespace simgrid +} // namespace simgrid::plugin using simgrid::plugin::LinkLoad; diff --git a/src/plugins/vm/VmLiveMigration.cpp b/src/plugins/vm/VmLiveMigration.cpp index 4ac6b365ce..192c4b29fa 100644 --- a/src/plugins/vm/VmLiveMigration.cpp +++ b/src/plugins/vm/VmLiveMigration.cpp @@ -12,9 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(vm_live_migration, s4u, "S4U virtual machines live migration"); -namespace simgrid { -namespace plugin { -namespace vm { +namespace simgrid::plugin::vm { xbt::Extension VmMigrationExt::EXTENSION_ID; void VmMigrationExt::ensureVmMigrationExtInstalled() @@ -269,9 +267,7 @@ void MigrationTx::operator()() // effectively the VM on the DST node. XBT_DEBUG("mig: tx_done"); } -} // namespace vm -} // namespace plugin -} // namespace simgrid +} // namespace simgrid::plugin::vm using simgrid::plugin::vm::VmMigrationExt; diff --git a/src/plugins/vm/VmLiveMigration.hpp b/src/plugins/vm/VmLiveMigration.hpp index a1cb867c20..26ed66c73a 100644 --- a/src/plugins/vm/VmLiveMigration.hpp +++ b/src/plugins/vm/VmLiveMigration.hpp @@ -10,9 +10,7 @@ #ifndef VM_LIVE_MIGRATION_HPP_ #define VM_LIVE_MIGRATION_HPP_ -namespace simgrid { -namespace plugin { -namespace vm { +namespace simgrid::plugin::vm { class VmMigrationExt { public: s4u::ActorPtr issuer_ = nullptr; @@ -65,7 +63,5 @@ public: void operator()(); sg_size_t sendMigrationData(sg_size_t size, int stage, int stage2_round, double mig_speed, double timeout); }; -} // namespace vm -} // namespace plugin -} // namespace simgrid +} // namespace simgrid::plugin::vm #endif diff --git a/src/plugins/vm/dirty_page_tracking.cpp b/src/plugins/vm/dirty_page_tracking.cpp index dc0b8d5f7f..bb83cae733 100644 --- a/src/plugins/vm/dirty_page_tracking.cpp +++ b/src/plugins/vm/dirty_page_tracking.cpp @@ -10,9 +10,7 @@ #include "src/kernel/activity/ExecImpl.hpp" #include "src/kernel/resource/VirtualMachineImpl.hpp" -namespace simgrid { -namespace plugin { -namespace vm { +namespace simgrid::plugin::vm { class DirtyPageTrackingExt { bool dp_tracking_ = false; std::map dp_objs_; @@ -67,9 +65,7 @@ double DirtyPageTrackingExt::computed_flops_lookup() return total; } -} // namespace vm -} // namespace plugin -} // namespace simgrid +} // namespace simgrid::plugin::vm using simgrid::plugin::vm::DirtyPageTrackingExt; diff --git a/src/s4u/s4u_Barrier.cpp b/src/s4u/s4u_Barrier.cpp index f22b711945..b7f0c99ef8 100644 --- a/src/s4u/s4u_Barrier.cpp +++ b/src/s4u/s4u_Barrier.cpp @@ -13,8 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_barrier, s4u, "S4U barrier"); -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { /** @brief Create a new barrier * @@ -67,8 +66,7 @@ void intrusive_ptr_release(Barrier* barrier) { intrusive_ptr_release(barrier->pimpl_); } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u /* **************************** Public C interface *************************** */ diff --git a/src/s4u/s4u_Comm.cpp b/src/s4u/s4u_Comm.cpp index 1020047993..d1fe6f65c0 100644 --- a/src/s4u/s4u_Comm.cpp +++ b/src/s4u/s4u_Comm.cpp @@ -18,8 +18,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_comm, s4u_activity, "S4U asynchronous communications"); -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { xbt::signal Comm::on_send; xbt::signal Comm::on_recv; @@ -472,8 +471,7 @@ size_t Comm::wait_all_for(const std::vector& comms, double timeout) } return comms.size(); } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u /* **************************** Public C interface *************************** */ void sg_comm_detach(sg_comm_t comm, void (*clean_function)(void*)) { diff --git a/src/s4u/s4u_ConditionVariable.cpp b/src/s4u/s4u_ConditionVariable.cpp index 2558b0478a..e7e772465a 100644 --- a/src/s4u/s4u_ConditionVariable.cpp +++ b/src/s4u/s4u_ConditionVariable.cpp @@ -12,8 +12,7 @@ #include -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { ConditionVariablePtr ConditionVariable::create() { @@ -95,8 +94,7 @@ void intrusive_ptr_release(const ConditionVariable* cond) intrusive_ptr_release(cond->pimpl_); } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u /* **************************** Public C interface *************************** */ sg_cond_t sg_cond_init() diff --git a/src/s4u/s4u_Engine.cpp b/src/s4u/s4u_Engine.cpp index d0160a00fe..b768ab40ef 100644 --- a/src/s4u/s4u_Engine.cpp +++ b/src/s4u/s4u_Engine.cpp @@ -30,8 +30,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_engine, s4u, "Logging specific to S4U (engin static simgrid::kernel::actor::ActorCode maestro_code; -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { xbt::signal Engine::on_platform_creation; xbt::signal Engine::on_platform_created; xbt::signal Engine::on_simulation_start; @@ -460,8 +459,7 @@ Engine* Engine::set_default_comm_data_copy_callback( return this; } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u /* **************************** Public C interface *************************** */ void simgrid_init(int* argc, char** argv) diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index 58b5abfc71..259ed33b3b 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -14,8 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_exec, s4u_activity, "S4U asynchronous executions"); -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { xbt::signal Exec::on_start; Exec::Exec(kernel::activity::ExecImplPtr pimpl) @@ -245,8 +244,7 @@ bool Exec::is_assigned() const { return not boost::static_pointer_cast(pimpl_)->get_hosts().empty(); } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u /* **************************** Public C interface *************************** */ void sg_exec_set_bound(sg_exec_t exec, double bound) diff --git a/src/s4u/s4u_Io.cpp b/src/s4u/s4u_Io.cpp index cd1cdbe352..71326434ad 100644 --- a/src/s4u/s4u_Io.cpp +++ b/src/s4u/s4u_Io.cpp @@ -11,8 +11,7 @@ #include "src/kernel/actor/ActorImpl.hpp" #include "src/kernel/actor/SimcallObserver.hpp" -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { xbt::signal Io::on_start; Io::Io(kernel::activity::IoImplPtr pimpl) @@ -113,5 +112,4 @@ bool Io::is_assigned() const return boost::static_pointer_cast(pimpl_)->get_disk() != nullptr; } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u diff --git a/src/s4u/s4u_Mailbox.cpp b/src/s4u/s4u_Mailbox.cpp index fb6de63332..7a266927cb 100644 --- a/src/s4u/s4u_Mailbox.cpp +++ b/src/s4u/s4u_Mailbox.cpp @@ -12,8 +12,7 @@ XBT_LOG_EXTERNAL_CATEGORY(s4u); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_channel, s4u, "S4U Communication Mailboxes"); -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { const xbt::string& Mailbox::get_name() const { @@ -140,8 +139,7 @@ void Mailbox::clear() kernel::actor::simcall_answered([this]() { this->pimpl_->clear(); }); } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u /* **************************** Public C interface *************************** */ sg_mailbox_t sg_mailbox_by_name(const char* alias) diff --git a/src/s4u/s4u_Mutex.cpp b/src/s4u/s4u_Mutex.cpp index 6542263566..0adc7f026c 100644 --- a/src/s4u/s4u_Mutex.cpp +++ b/src/s4u/s4u_Mutex.cpp @@ -11,8 +11,7 @@ #include "src/kernel/actor/SynchroObserver.hpp" #include "src/mc/mc_replay.hpp" -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { /** @brief Blocks the calling actor until the mutex can be obtained */ void Mutex::lock() @@ -72,8 +71,7 @@ void intrusive_ptr_release(const Mutex* mutex) intrusive_ptr_release(mutex->pimpl_); } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u /* **************************** Public C interface *************************** */ sg_mutex_t sg_mutex_init() diff --git a/src/s4u/s4u_Netzone.cpp b/src/s4u/s4u_Netzone.cpp index d2fb7b3fd4..bd00dc9e81 100644 --- a/src/s4u/s4u_Netzone.cpp +++ b/src/s4u/s4u_Netzone.cpp @@ -14,8 +14,7 @@ #include "src/kernel/resource/NetworkModel.hpp" -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { xbt::signal NetZone::on_creation; xbt::signal NetZone::on_seal; @@ -200,8 +199,7 @@ kernel::resource::NetworkModelIntf* NetZone::get_network_model() const kernel::resource::NetworkModelIntf* model = pimpl_->get_network_model().get(); return model; } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u /* **************************** Public C interface *************************** */ diff --git a/src/s4u/s4u_Semaphore.cpp b/src/s4u/s4u_Semaphore.cpp index 2b9bbdc0cc..c2021e5626 100644 --- a/src/s4u/s4u_Semaphore.cpp +++ b/src/s4u/s4u_Semaphore.cpp @@ -11,8 +11,7 @@ #include "src/kernel/actor/SynchroObserver.hpp" #include "src/mc/mc_replay.hpp" -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { SemaphorePtr Semaphore::create(unsigned int initial_capacity) { @@ -75,8 +74,7 @@ void intrusive_ptr_release(const Semaphore* sem) intrusive_ptr_release(sem->pimpl_); } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u /* **************************** Public C interface *************************** */ /** @brief creates a semaphore object of the given initial capacity */ diff --git a/src/s4u/s4u_VirtualMachine.cpp b/src/s4u/s4u_VirtualMachine.cpp index bcb7c1ed21..284e5eb8ea 100644 --- a/src/s4u/s4u_VirtualMachine.cpp +++ b/src/s4u/s4u_VirtualMachine.cpp @@ -12,8 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_vm, s4u, "S4U virtual machines"); -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { xbt::signal VirtualMachine::on_creation; xbt::signal VirtualMachine::on_start; xbt::signal VirtualMachine::on_started; @@ -158,8 +157,7 @@ void VirtualMachine::end_migration() const pimpl_vm_->end_migration(); } -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u /* **************************** Public C interface *************************** */ diff --git a/src/simgrid/util.hpp b/src/simgrid/util.hpp index bc28636575..c12a9a477c 100644 --- a/src/simgrid/util.hpp +++ b/src/simgrid/util.hpp @@ -9,8 +9,7 @@ #include -namespace simgrid { -namespace util { +namespace simgrid::util { /** Find a pointer to a value stores in a map (or nullptr) */ template @@ -35,7 +34,6 @@ typename C::mapped_type const* find_map_ptr(C const& c, K const& k) return &i->second; } -} // namespace util -} // namespace simgrid +} // namespace simgrid::util #endif diff --git a/src/smpi/colls/allgather/allgather-2dmesh.cpp b/src/smpi/colls/allgather/allgather-2dmesh.cpp index 1189a1d9bc..94d5507d73 100644 --- a/src/smpi/colls/allgather/allgather-2dmesh.cpp +++ b/src/smpi/colls/allgather/allgather-2dmesh.cpp @@ -106,9 +106,7 @@ static bool is_2dmesh(int num, int* i, int* j) * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { int allgather__2dmesh(const void *send_buff, int send_count, MPI_Datatype @@ -196,5 +194,4 @@ allgather__2dmesh(const void *send_buff, int send_count, MPI_Datatype return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-3dmesh.cpp b/src/smpi/colls/allgather/allgather-3dmesh.cpp index 40fd291335..c1c94d5a0d 100644 --- a/src/smpi/colls/allgather/allgather-3dmesh.cpp +++ b/src/smpi/colls/allgather/allgather-3dmesh.cpp @@ -92,9 +92,7 @@ static bool is_3dmesh(int num, int* i, int* j, int* k) * follows "simple" * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { int allgather__3dmesh(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, @@ -208,6 +206,4 @@ int allgather__3dmesh(const void *send_buff, int send_count, return MPI_SUCCESS; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-GB.cpp b/src/smpi/colls/allgather/allgather-GB.cpp index 8ad1bc16ae..b99d9dfdaa 100644 --- a/src/smpi/colls/allgather/allgather-GB.cpp +++ b/src/smpi/colls/allgather/allgather-GB.cpp @@ -6,8 +6,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { // Allgather - gather/bcast algorithm int allgather__GB(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, @@ -22,5 +21,4 @@ int allgather__GB(const void *send_buff, int send_count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-NTSLR-NB.cpp b/src/smpi/colls/allgather/allgather-NTSLR-NB.cpp index 764c7ac96e..dbf78e3bd5 100644 --- a/src/smpi/colls/allgather/allgather-NTSLR-NB.cpp +++ b/src/smpi/colls/allgather/allgather-NTSLR-NB.cpp @@ -6,8 +6,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { // Allgather-Non-Topology-Specific-Logical-Ring algorithm int @@ -69,5 +68,4 @@ allgather__NTSLR_NB(const void *sbuf, int scount, MPI_Datatype stype, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-NTSLR.cpp b/src/smpi/colls/allgather/allgather-NTSLR.cpp index 103c4740ca..782f72bf6b 100644 --- a/src/smpi/colls/allgather/allgather-NTSLR.cpp +++ b/src/smpi/colls/allgather/allgather-NTSLR.cpp @@ -6,8 +6,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { // Allgather-Non-Topology-Specific-Logical-Ring algorithm int @@ -57,6 +56,4 @@ allgather__NTSLR(const void *sbuf, int scount, MPI_Datatype stype, return MPI_SUCCESS; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-SMP-NTS.cpp b/src/smpi/colls/allgather/allgather-SMP-NTS.cpp index db0e689366..2656955e5d 100644 --- a/src/smpi/colls/allgather/allgather-SMP-NTS.cpp +++ b/src/smpi/colls/allgather/allgather-SMP-NTS.cpp @@ -6,9 +6,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { int allgather__SMP_NTS(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, @@ -163,6 +161,4 @@ int allgather__SMP_NTS(const void *sbuf, int scount, return MPI_SUCCESS; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-bruck.cpp b/src/smpi/colls/allgather/allgather-bruck.cpp index a4e3f11973..ed4983e4a2 100644 --- a/src/smpi/colls/allgather/allgather-bruck.cpp +++ b/src/smpi/colls/allgather/allgather-bruck.cpp @@ -67,10 +67,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Ahmad Faraj. ****************************************************************************/ -namespace simgrid{ -namespace smpi{ - - +namespace simgrid::smpi { int allgather__bruck(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, @@ -137,6 +134,4 @@ int allgather__bruck(const void *send_buff, int send_count, return MPI_SUCCESS; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-loosely-lr.cpp b/src/smpi/colls/allgather/allgather-loosely-lr.cpp index eb0e00481b..67debf513d 100644 --- a/src/smpi/colls/allgather/allgather-loosely-lr.cpp +++ b/src/smpi/colls/allgather/allgather-loosely-lr.cpp @@ -6,9 +6,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { int allgather__loosely_lr(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, @@ -137,6 +135,4 @@ if(comm->get_leaders_comm()==MPI_COMM_NULL){ return MPI_SUCCESS; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-mvapich-smp.cpp b/src/smpi/colls/allgather/allgather-mvapich-smp.cpp index 1b07fb4055..c465b0cd5d 100644 --- a/src/smpi/colls/allgather/allgather-mvapich-smp.cpp +++ b/src/smpi/colls/allgather/allgather-mvapich-smp.cpp @@ -35,8 +35,7 @@ * See COPYRIGHT in top-level directory. */ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allgather__mvapich2_smp(const void *sendbuf,int sendcnt, MPI_Datatype sendtype, void *recvbuf, int recvcnt,MPI_Datatype recvtype, @@ -142,5 +141,4 @@ int allgather__mvapich2_smp(const void *sendbuf,int sendcnt, MPI_Datatype sendty return mpi_errno; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp b/src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp index b81517dcc7..66195e5516 100644 --- a/src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp +++ b/src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp @@ -64,8 +64,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allgather__ompi_neighborexchange(const void *sbuf, int scount, @@ -183,6 +182,4 @@ allgather__ompi_neighborexchange(const void *sbuf, int scount, return err; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-pair.cpp b/src/smpi/colls/allgather/allgather-pair.cpp index a41e0b1b42..1654901692 100644 --- a/src/smpi/colls/allgather/allgather-pair.cpp +++ b/src/smpi/colls/allgather/allgather-pair.cpp @@ -65,9 +65,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { int allgather__pair(const void *send_buff, int send_count, @@ -107,6 +105,4 @@ allgather__pair(const void *send_buff, int send_count, return MPI_SUCCESS; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-rdb.cpp b/src/smpi/colls/allgather/allgather-rdb.cpp index 314a3902b6..54441b8fb4 100644 --- a/src/smpi/colls/allgather/allgather-rdb.cpp +++ b/src/smpi/colls/allgather/allgather-rdb.cpp @@ -6,8 +6,7 @@ #include "../colls_private.hpp" #include "smpi_status.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allgather__rdb(const void *sbuf, int send_count, @@ -131,6 +130,4 @@ allgather__rdb(const void *sbuf, int send_count, return success; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-rhv.cpp b/src/smpi/colls/allgather/allgather-rhv.cpp index e7dae7a77b..6992e4d79f 100644 --- a/src/smpi/colls/allgather/allgather-rhv.cpp +++ b/src/smpi/colls/allgather/allgather-rhv.cpp @@ -6,9 +6,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { // now only work with power of two processes @@ -100,6 +98,4 @@ allgather__rhv(const void *sbuf, int send_count, return MPI_SUCCESS; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-ring.cpp b/src/smpi/colls/allgather/allgather-ring.cpp index 8933927cdb..3ab41769f0 100644 --- a/src/smpi/colls/allgather/allgather-ring.cpp +++ b/src/smpi/colls/allgather/allgather-ring.cpp @@ -64,9 +64,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { int allgather__ring(const void *send_buff, int send_count, @@ -103,6 +101,4 @@ allgather__ring(const void *send_buff, int send_count, return MPI_SUCCESS; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-smp-simple.cpp b/src/smpi/colls/allgather/allgather-smp-simple.cpp index 71180e04ee..e69e2e849a 100644 --- a/src/smpi/colls/allgather/allgather-smp-simple.cpp +++ b/src/smpi/colls/allgather/allgather-smp-simple.cpp @@ -6,9 +6,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { int allgather__smp_simple(const void *send_buf, int scount, MPI_Datatype stype, void *recv_buf, @@ -125,6 +123,4 @@ int allgather__smp_simple(const void *send_buf, int scount, return MPI_SUCCESS; } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgather/allgather-spreading-simple.cpp b/src/smpi/colls/allgather/allgather-spreading-simple.cpp index 9836c3f1ec..095aad1f8f 100644 --- a/src/smpi/colls/allgather/allgather-spreading-simple.cpp +++ b/src/smpi/colls/allgather/allgather-spreading-simple.cpp @@ -67,9 +67,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { int allgather__spreading_simple(const void *send_buff, int send_count, @@ -116,5 +114,4 @@ allgather__spreading_simple(const void *send_buff, int send_count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgatherv/allgatherv-GB.cpp b/src/smpi/colls/allgatherv/allgatherv-GB.cpp index 8a5c8d0fac..a168ce9926 100644 --- a/src/smpi/colls/allgatherv/allgatherv-GB.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-GB.cpp @@ -6,8 +6,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { // Allgather - gather/bcast algorithm int allgatherv__GB(const void *send_buff, int send_count, @@ -28,5 +27,4 @@ int allgatherv__GB(const void *send_buff, int send_count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp b/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp index 6e6e5c2be7..97acd93ce5 100644 --- a/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp @@ -10,8 +10,7 @@ #include "smpi_status.hpp" #include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allgatherv__mpich_rdb( const void *sendbuf, @@ -202,5 +201,4 @@ int allgatherv__mpich_rdb( return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp b/src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp index b30ebda695..a7c6564f27 100644 --- a/src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp @@ -25,8 +25,7 @@ * comm: communication ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allgatherv__mpich_ring(const void *sendbuf, int sendcount, MPI_Datatype send_type, void *recvbuf, @@ -126,5 +125,4 @@ int allgatherv__mpich_ring(const void *sendbuf, int sendcount, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp b/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp index 05339259f6..8b089894f2 100644 --- a/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp @@ -77,8 +77,7 @@ * [6] [6] [6] [6] [6] [6] [6] */ -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int allgatherv__ompi_bruck(const void *sbuf, int scount, MPI_Datatype sdtype, @@ -174,6 +173,4 @@ int allgatherv__ompi_bruck(const void *sbuf, int scount, } - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp b/src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp index 845a24275f..56e3a1f511 100644 --- a/src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp @@ -65,8 +65,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allgatherv__ompi_neighborexchange(const void *sbuf, int scount, @@ -218,5 +217,4 @@ allgatherv__ompi_neighborexchange(const void *sbuf, int scount, return err; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgatherv/allgatherv-pair.cpp b/src/smpi/colls/allgatherv/allgatherv-pair.cpp index b09e4136ea..820fcf445c 100644 --- a/src/smpi/colls/allgatherv/allgatherv-pair.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-pair.cpp @@ -65,8 +65,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allgatherv__pair(const void *send_buff, int send_count, @@ -105,5 +104,4 @@ allgatherv__pair(const void *send_buff, int send_count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allgatherv/allgatherv-ring.cpp b/src/smpi/colls/allgatherv/allgatherv-ring.cpp index 8b476b0ce9..94f69cf708 100644 --- a/src/smpi/colls/allgatherv/allgatherv-ring.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-ring.cpp @@ -64,8 +64,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allgatherv__ring(const void *send_buff, int send_count, @@ -103,5 +102,4 @@ allgatherv__ring(const void *send_buff, int send_count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-lr.cpp b/src/smpi/colls/allreduce/allreduce-lr.cpp index b6e277d429..7270c21943 100644 --- a/src/smpi/colls/allreduce/allreduce-lr.cpp +++ b/src/smpi/colls/allreduce/allreduce-lr.cpp @@ -18,8 +18,7 @@ */ //#include -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int allreduce__lr(const void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { @@ -101,5 +100,4 @@ int allreduce__lr(const void *sbuf, void *rbuf, int rcount, return 0; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp b/src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp index 7d33c76ab7..6cb04ffd30 100644 --- a/src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp +++ b/src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp @@ -24,8 +24,7 @@ #include "../colls_private.hpp" #include -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int allreduce__mvapich2_rs(const void *sendbuf, void *recvbuf, int count, @@ -284,5 +283,4 @@ int allreduce__mvapich2_rs(const void *sendbuf, } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp b/src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp index 68c93b6974..b643cdb1c7 100644 --- a/src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp +++ b/src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp @@ -53,9 +53,7 @@ extern int (*MV2_Allreduce_intra_function)(const void *sendbuf, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); - -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { static int MPIR_Allreduce_reduce_p2p_MV2(const void *sendbuf, void *recvbuf, int count, @@ -171,5 +169,4 @@ int allreduce__mvapich2_two_level(const void *sendbuf, return (mpi_errno); } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp b/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp index e9b3ffe5e2..dfb61008ce 100644 --- a/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp +++ b/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp @@ -155,8 +155,7 @@ #include "../colls_private.hpp" -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int allreduce__ompi_ring_segmented(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, @@ -396,5 +395,4 @@ int allreduce__ompi_ring_segmented(const void *sbuf, void *rbuf, int count, smpi_free_tmp_buffer(inbuf[1]); return ret; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-rab-rdb.cpp b/src/smpi/colls/allreduce/allreduce-rab-rdb.cpp index 1f5f7ab62a..3b0a60595a 100644 --- a/src/smpi/colls/allreduce/allreduce-rab-rdb.cpp +++ b/src/smpi/colls/allreduce/allreduce-rab-rdb.cpp @@ -5,8 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allreduce__rab_rdb(const void *sbuff, void *rbuff, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) @@ -191,5 +190,4 @@ int allreduce__rab_rdb(const void *sbuff, void *rbuff, int count, smpi_free_tmp_buffer(tmp_buf); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-rab1.cpp b/src/smpi/colls/allreduce/allreduce-rab1.cpp index 997598a7de..179f7faabd 100644 --- a/src/smpi/colls/allreduce/allreduce-rab1.cpp +++ b/src/smpi/colls/allreduce/allreduce-rab1.cpp @@ -6,8 +6,7 @@ #include "../colls_private.hpp" //#include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { // NP pow of 2 for now int allreduce__rab1(const void *sbuff, void *rbuff, int count, MPI_Datatype dtype, @@ -107,5 +106,4 @@ int allreduce__rab1(const void *sbuff, void *rbuff, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-rab2.cpp b/src/smpi/colls/allreduce/allreduce-rab2.cpp index 6768e6b033..238b8bef3a 100644 --- a/src/smpi/colls/allreduce/allreduce-rab2.cpp +++ b/src/smpi/colls/allreduce/allreduce-rab2.cpp @@ -7,8 +7,7 @@ #include "../colls_private.hpp" //#include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { // this requires that count >= NP int allreduce__rab2(const void *sbuff, void *rbuff, int count, MPI_Datatype dtype, @@ -83,5 +82,4 @@ int allreduce__rab2(const void *sbuff, void *rbuff, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-rdb.cpp b/src/smpi/colls/allreduce/allreduce-rdb.cpp index 1eeba104a0..bde40d2153 100644 --- a/src/smpi/colls/allreduce/allreduce-rdb.cpp +++ b/src/smpi/colls/allreduce/allreduce-rdb.cpp @@ -6,8 +6,7 @@ #include "../colls_private.hpp" //#include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allreduce__rdb(const void *sbuff, void *rbuff, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { @@ -128,5 +127,4 @@ int allreduce__rdb(const void *sbuff, void *rbuff, int count, smpi_free_tmp_buffer(tmp_buf); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-redbcast.cpp b/src/smpi/colls/allreduce/allreduce-redbcast.cpp index 9d1e5f1036..dc2eea5e6b 100644 --- a/src/smpi/colls/allreduce/allreduce-redbcast.cpp +++ b/src/smpi/colls/allreduce/allreduce-redbcast.cpp @@ -5,8 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allreduce__redbcast(const void *buf, void *buf2, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) @@ -15,5 +14,4 @@ int allreduce__redbcast(const void *buf, void *buf2, int count, colls::bcast(buf2, count, datatype, 0, comm); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp b/src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp index c00a716900..f7c1b02f24 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp @@ -36,8 +36,7 @@ This function performs all-reduce operation as follow. ** in a pipeline fashion 3) binomial_tree bcast intra-communication between root of each SMP node 4) binomial_tree bcast inside each SMP node */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allreduce__smp_binomial_pipeline(const void *send_buf, void *recv_buf, int count, MPI_Datatype dtype, @@ -199,5 +198,4 @@ int allreduce__smp_binomial_pipeline(const void *send_buf, smpi_free_tmp_buffer(tmp_buf); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-smp-binomial.cpp b/src/smpi/colls/allreduce/allreduce-smp-binomial.cpp index d79da412ed..c53fc38e24 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-binomial.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-binomial.cpp @@ -26,8 +26,7 @@ This function performs all-reduce operation as follow. 3) binomial_tree bcast intra-communication between root of each SMP node 4) binomial_tree bcast inside each SMP node */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allreduce__smp_binomial(const void *send_buf, void *recv_buf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) @@ -153,5 +152,4 @@ int allreduce__smp_binomial(const void *send_buf, void *recv_buf, smpi_free_tmp_buffer(tmp_buf); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-smp-rdb.cpp b/src/smpi/colls/allreduce/allreduce-smp-rdb.cpp index 39e87b23aa..ca90a5510f 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-rdb.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-rdb.cpp @@ -25,8 +25,7 @@ This function performs all-reduce operation as follow. 2) Recursive doubling intra-communication between root of each SMP node 3) binomial_tree bcast inside each SMP node */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allreduce__smp_rdb(const void *send_buf, void *recv_buf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) @@ -185,5 +184,4 @@ int allreduce__smp_rdb(const void *send_buf, void *recv_buf, int count, smpi_free_tmp_buffer(tmp_buf); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp b/src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp index 3d7057d13c..cd6eac455b 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp @@ -14,8 +14,7 @@ This function performs all-reduce operation as follow. 3) allgather - inter between root of each SMP node 4) binomial_tree bcast inside each SMP node */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allreduce__smp_rsag_lr(const void *send_buf, void *recv_buf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) @@ -256,5 +255,4 @@ int allreduce__smp_rsag_lr(const void *send_buf, void *recv_buf, smpi_free_tmp_buffer(tmp_buf); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp b/src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp index cbc8ab7b20..034f9f8242 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp @@ -18,8 +18,7 @@ This function performs all-reduce operation as follow. 3) allgather - inter between root of each SMP node 4) binomial_tree bcast inside each SMP node */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allreduce__smp_rsag_rab(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) @@ -193,5 +192,4 @@ int allreduce__smp_rsag_rab(const void *sbuf, void *rbuf, int count, smpi_free_tmp_buffer(tmp_buf); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/allreduce/allreduce-smp-rsag.cpp b/src/smpi/colls/allreduce/allreduce-smp-rsag.cpp index 273118eaad..5f43edc343 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-rsag.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-rsag.cpp @@ -13,8 +13,7 @@ This function performs all-reduce operation as follow. 3) allgather - inter between root of each SMP node 4) binomial_tree bcast inside each SMP node */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allreduce__smp_rsag(const void *send_buf, void *recv_buf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) @@ -224,5 +223,4 @@ int allreduce__smp_rsag(const void *send_buf, void *recv_buf, smpi_free_tmp_buffer(tmp_buf); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-2dmesh.cpp b/src/smpi/colls/alltoall/alltoall-2dmesh.cpp index 0aeca6e87c..aa63c4157a 100644 --- a/src/smpi/colls/alltoall/alltoall-2dmesh.cpp +++ b/src/smpi/colls/alltoall/alltoall-2dmesh.cpp @@ -52,8 +52,7 @@ static int alltoall_check_is_2dmesh(int num, int *i, int *j) } return 0; } -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__2dmesh(const void *send_buff, int send_count, MPI_Datatype send_type, @@ -171,5 +170,4 @@ int alltoall__2dmesh(const void *send_buff, int send_count, smpi_free_tmp_buffer(tmp_buff2); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-3dmesh.cpp b/src/smpi/colls/alltoall/alltoall-3dmesh.cpp index bf22c1dba7..3dceba3830 100644 --- a/src/smpi/colls/alltoall/alltoall-3dmesh.cpp +++ b/src/smpi/colls/alltoall/alltoall-3dmesh.cpp @@ -45,8 +45,7 @@ static int alltoall_check_is_3dmesh(int num, int *i, int *j, int *k) } return 0; } -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__3dmesh(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, @@ -181,5 +180,4 @@ int alltoall__3dmesh(const void *send_buff, int send_count, smpi_free_tmp_buffer(tmp_buff2); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-basic-linear.cpp b/src/smpi/colls/alltoall/alltoall-basic-linear.cpp index e85d510237..9ee08afa0c 100644 --- a/src/smpi/colls/alltoall/alltoall-basic-linear.cpp +++ b/src/smpi/colls/alltoall/alltoall-basic-linear.cpp @@ -8,10 +8,7 @@ /*Naive and simple basic alltoall implementation. */ - -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { int alltoall__basic_linear(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) @@ -63,5 +60,4 @@ int alltoall__basic_linear(const void *sendbuf, int sendcount, MPI_Datatype send return err; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-bruck.cpp b/src/smpi/colls/alltoall/alltoall-bruck.cpp index a24dc9f642..da338eb9b4 100644 --- a/src/smpi/colls/alltoall/alltoall-bruck.cpp +++ b/src/smpi/colls/alltoall/alltoall-bruck.cpp @@ -27,9 +27,7 @@ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ - +namespace simgrid::smpi { int alltoall__bruck(const void *send_buff, int send_count, @@ -118,5 +116,4 @@ alltoall__bruck(const void *send_buff, int send_count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp b/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp index ca6b376c9b..99a845640b 100644 --- a/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp +++ b/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp @@ -42,8 +42,7 @@ #define MV2_ALLTOALL_THROTTLE_FACTOR 4 #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__mvapich2_scatter_dest(const void *sendbuf, int sendcount, MPI_Datatype sendtype, @@ -133,5 +132,4 @@ int alltoall__mvapich2_scatter_dest(const void *sendbuf, return (mpi_errno); } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp b/src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp index 7968199af2..5bdbcd0d15 100644 --- a/src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp @@ -27,8 +27,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__pair_light_barrier(const void *send_buff, int send_count, MPI_Datatype send_type, @@ -76,5 +75,4 @@ alltoall__pair_light_barrier(const void *send_buff, int send_count, } return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp b/src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp index b2d455b201..88467b1718 100644 --- a/src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp @@ -27,8 +27,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__pair_mpi_barrier(const void *send_buff, int send_count, MPI_Datatype send_type, @@ -63,5 +62,4 @@ alltoall__pair_mpi_barrier(const void *send_buff, int send_count, } return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp b/src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp index c4e7662dd7..27275aa907 100644 --- a/src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp @@ -26,8 +26,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__pair_one_barrier(const void *send_buff, int send_count, MPI_Datatype send_type, @@ -65,5 +64,4 @@ alltoall__pair_one_barrier(const void *send_buff, int send_count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-pair.cpp b/src/smpi/colls/alltoall/alltoall-pair.cpp index e991df0d95..b73d5b2ba0 100644 --- a/src/smpi/colls/alltoall/alltoall-pair.cpp +++ b/src/smpi/colls/alltoall/alltoall-pair.cpp @@ -28,8 +28,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__pair_rma(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) @@ -96,5 +95,4 @@ int alltoall__pair(const void *send_buff, int send_count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-rdb.cpp b/src/smpi/colls/alltoall/alltoall-rdb.cpp index f12da0a707..ed942b9aa6 100644 --- a/src/smpi/colls/alltoall/alltoall-rdb.cpp +++ b/src/smpi/colls/alltoall/alltoall-rdb.cpp @@ -28,8 +28,7 @@ * Author: MPICH / slightly modified by Ahmad Faraj. ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__rdb(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, @@ -154,5 +153,4 @@ int alltoall__rdb(const void *send_buff, int send_count, smpi_free_tmp_buffer(tmp_buff); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp b/src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp index 553e365c8b..804dbca54b 100644 --- a/src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp @@ -27,8 +27,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__ring_light_barrier(const void *send_buff, int send_count, MPI_Datatype send_type, @@ -76,5 +75,4 @@ alltoall__ring_light_barrier(const void *send_buff, int send_count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp b/src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp index 4dcaafd798..0810da0bf0 100644 --- a/src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp @@ -26,8 +26,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__ring_mpi_barrier(const void *send_buff, int send_count, MPI_Datatype send_type, @@ -62,5 +61,4 @@ alltoall__ring_mpi_barrier(const void *send_buff, int send_count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp b/src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp index d57047c682..748d68990a 100644 --- a/src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp @@ -25,8 +25,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoall__ring_one_barrier(const void *send_buff, int send_count, MPI_Datatype send_type, @@ -60,5 +59,4 @@ alltoall__ring_one_barrier(const void *send_buff, int send_count, } return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoall/alltoall-ring.cpp b/src/smpi/colls/alltoall/alltoall-ring.cpp index 82c9dc742e..306734eb6e 100644 --- a/src/smpi/colls/alltoall/alltoall-ring.cpp +++ b/src/smpi/colls/alltoall/alltoall-ring.cpp @@ -25,8 +25,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int alltoall__ring(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, @@ -58,5 +57,4 @@ int alltoall__ring(const void *send_buff, int send_count, } return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoallv/alltoallv-bruck.cpp b/src/smpi/colls/alltoallv/alltoallv-bruck.cpp index f6bc827d5d..6a7268f3ac 100644 --- a/src/smpi/colls/alltoallv/alltoallv-bruck.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-bruck.cpp @@ -13,8 +13,7 @@ * FIXME: uh, check smpi_pmpi again, but this routine is called for > 12, not * less... **/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoallv__bruck(const void *sendbuf, const int *sendcounts, const int *senddisps, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts,const int *recvdisps, MPI_Datatype recvtype, @@ -86,5 +85,4 @@ int alltoallv__bruck(const void *sendbuf, const int *sendcounts, const int *send } return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp b/src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp index 8c0db4be9f..431d14fdcc 100644 --- a/src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp @@ -14,8 +14,7 @@ * differently and so will not have to duplicate code. * GEF Oct05 after asking Jeff. */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoallv__ompi_basic_linear(const void *sbuf, const int *scounts, const int *sdisps, MPI_Datatype sdtype, void *rbuf, const int *rcounts, const int *rdisps, @@ -91,5 +90,4 @@ int alltoallv__ompi_basic_linear(const void *sbuf, const int *scounts, const int return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp index a99e36c865..c773e31638 100644 --- a/src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp @@ -27,8 +27,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int alltoallv__pair_light_barrier(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, void *recv_buff, const int *recv_counts, const int *recv_disps, @@ -72,5 +71,4 @@ int alltoallv__pair_light_barrier(const void *send_buff, const int *send_counts, } return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp index 4f1f8b3779..c901225e5c 100644 --- a/src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp @@ -27,8 +27,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int alltoallv__pair_mpi_barrier(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, void *recv_buff, const int *recv_counts, const int *recv_disps, @@ -59,5 +58,4 @@ int alltoallv__pair_mpi_barrier(const void *send_buff, const int *send_counts, c } return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp index a5e481d5fc..5a2bb886e4 100644 --- a/src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp @@ -26,8 +26,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoallv__pair_one_barrier(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) @@ -60,5 +59,4 @@ int alltoallv__pair_one_barrier(const void *send_buff, const int *send_counts, c return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoallv/alltoallv-pair.cpp b/src/smpi/colls/alltoallv/alltoallv-pair.cpp index 433fb718d2..a099450cd9 100644 --- a/src/smpi/colls/alltoallv/alltoallv-pair.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-pair.cpp @@ -27,8 +27,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int alltoallv__pair(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, void *recv_buff, const int *recv_counts, const int *recv_disps, @@ -58,5 +57,4 @@ int alltoallv__pair(const void *send_buff, const int *send_counts, const int *se } return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp index 9cc2ff2272..8231ebe83c 100644 --- a/src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp @@ -27,8 +27,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoallv__ring_light_barrier(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, void *recv_buff, const int *recv_counts, const int *recv_disps, @@ -72,5 +71,4 @@ int alltoallv__ring_light_barrier(const void *send_buff, const int *send_counts, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp index 0ce4424463..38cd26d0fa 100644 --- a/src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp @@ -26,8 +26,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoallv__ring_mpi_barrier(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, void *recv_buff, const int *recv_counts, const int *recv_disps, @@ -58,5 +57,4 @@ int alltoallv__ring_mpi_barrier(const void *send_buff, const int *send_counts, c return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp index 533635a69f..5007f91b54 100644 --- a/src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp @@ -25,8 +25,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoallv__ring_one_barrier(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, void *recv_buff, const int *recv_counts, const int *recv_disps, @@ -56,5 +55,4 @@ int alltoallv__ring_one_barrier(const void *send_buff, const int *send_counts, c } return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/alltoallv/alltoallv-ring.cpp b/src/smpi/colls/alltoallv/alltoallv-ring.cpp index d94a569fda..661a434673 100644 --- a/src/smpi/colls/alltoallv/alltoallv-ring.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-ring.cpp @@ -25,8 +25,7 @@ * Author: Ahmad Faraj ****************************************************************************/ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int alltoallv__ring(const void* send_buff, const int* send_counts, const int* send_disps, MPI_Datatype send_type, void* recv_buff, const int* recv_counts, const int* recv_disps, MPI_Datatype recv_type, MPI_Comm comm) @@ -61,5 +60,4 @@ int alltoallv__ring(const void* send_buff, const int* send_counts, const int* se } return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/barrier/barrier-mpich-smp.cpp b/src/smpi/colls/barrier/barrier-mpich-smp.cpp index 3135a2d1c5..eee6c2f6ab 100644 --- a/src/smpi/colls/barrier/barrier-mpich-smp.cpp +++ b/src/smpi/colls/barrier/barrier-mpich-smp.cpp @@ -15,8 +15,7 @@ #include "../coll_tuned_topo.hpp" #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int barrier__mpich_smp(MPI_Comm comm) { int mpi_errno = MPI_SUCCESS; @@ -63,6 +62,4 @@ int barrier__mpich_smp(MPI_Comm comm) return mpi_errno; } -} -} - +} // namespace simgrid::smpi diff --git a/src/smpi/colls/barrier/barrier-mvapich2-pair.cpp b/src/smpi/colls/barrier/barrier-mvapich2-pair.cpp index 8def355ebe..4b5a0aaa4a 100644 --- a/src/smpi/colls/barrier/barrier-mvapich2-pair.cpp +++ b/src/smpi/colls/barrier/barrier-mvapich2-pair.cpp @@ -42,8 +42,7 @@ #include "../coll_tuned_topo.hpp" #include "../colls_private.hpp" #include "smpi_actor.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int barrier__mvapich2_pair(MPI_Comm comm) { @@ -96,5 +95,4 @@ int barrier__mvapich2_pair(MPI_Comm comm) } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/barrier/barrier-ompi.cpp b/src/smpi/colls/barrier/barrier-ompi.cpp index 5c921c8370..e897a3f2fd 100644 --- a/src/smpi/colls/barrier/barrier-ompi.cpp +++ b/src/smpi/colls/barrier/barrier-ompi.cpp @@ -43,8 +43,7 @@ * synchronous guarantee made by last ring of sends are synchronous * */ -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int barrier__ompi_doublering(MPI_Comm comm) { int rank, size; @@ -301,5 +300,4 @@ int barrier__ompi_tree(MPI_Comm comm) return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-NTSB.cpp b/src/smpi/colls/bcast/bcast-NTSB.cpp index 0afac6285e..bfd343b32f 100644 --- a/src/smpi/colls/bcast/bcast-NTSB.cpp +++ b/src/smpi/colls/bcast/bcast-NTSB.cpp @@ -7,8 +7,7 @@ #include "../colls_private.hpp" int bcast_NTSB_segment_size_in_byte = 8192; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int bcast__NTSB(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm) { @@ -172,5 +171,4 @@ int bcast__NTSB(void *buf, int count, MPI_Datatype datatype, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-NTSL-Isend.cpp b/src/smpi/colls/bcast/bcast-NTSL-Isend.cpp index a1495c1a4e..6cfcd11f48 100644 --- a/src/smpi/colls/bcast/bcast-NTSL-Isend.cpp +++ b/src/smpi/colls/bcast/bcast-NTSL-Isend.cpp @@ -11,8 +11,7 @@ static int bcast_NTSL_segment_size_in_byte = 8192; /* Non-topology-specific pipelined linear-bcast function 0->1, 1->2 ,2->3, ....., ->last node : in a pipeline fashion */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int bcast__NTSL_Isend(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm) { @@ -123,5 +122,4 @@ int bcast__NTSL_Isend(void *buf, int count, MPI_Datatype datatype, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-NTSL.cpp b/src/smpi/colls/bcast/bcast-NTSL.cpp index 735b5d1009..9fdb21d651 100644 --- a/src/smpi/colls/bcast/bcast-NTSL.cpp +++ b/src/smpi/colls/bcast/bcast-NTSL.cpp @@ -11,8 +11,7 @@ static int bcast_NTSL_segment_size_in_byte = 8192; /* Non-topology-specific pipelined linear-bcast function 0->1, 1->2 ,2->3, ....., ->last node : in a pipeline fashion */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int bcast__NTSL(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm) { @@ -123,5 +122,4 @@ int bcast__NTSL(void *buf, int count, MPI_Datatype datatype, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-SMP-binary.cpp b/src/smpi/colls/bcast/bcast-SMP-binary.cpp index 5af3dd2ceb..0e2bc607e5 100644 --- a/src/smpi/colls/bcast/bcast-SMP-binary.cpp +++ b/src/smpi/colls/bcast/bcast-SMP-binary.cpp @@ -7,8 +7,7 @@ #include "../colls_private.hpp" int bcast_SMP_binary_segment_byte = 8192; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int bcast__SMP_binary(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm) @@ -222,5 +221,4 @@ int bcast__SMP_binary(void *buf, int count, return 1; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-SMP-binomial.cpp b/src/smpi/colls/bcast/bcast-SMP-binomial.cpp index 38e8153724..4c9589fcd3 100644 --- a/src/smpi/colls/bcast/bcast-SMP-binomial.cpp +++ b/src/smpi/colls/bcast/bcast-SMP-binomial.cpp @@ -5,8 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int bcast__SMP_binomial(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm) @@ -109,5 +108,4 @@ int bcast__SMP_binomial(void *buf, int count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-SMP-linear.cpp b/src/smpi/colls/bcast/bcast-SMP-linear.cpp index 902bcd0b4a..9d4dacda5f 100644 --- a/src/smpi/colls/bcast/bcast-SMP-linear.cpp +++ b/src/smpi/colls/bcast/bcast-SMP-linear.cpp @@ -7,8 +7,7 @@ #include "../colls_private.hpp" int bcast_SMP_linear_segment_byte = 8192; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int bcast__SMP_linear(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm) @@ -171,5 +170,4 @@ int bcast__SMP_linear(void *buf, int count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-arrival-pattern-aware-wait.cpp b/src/smpi/colls/bcast/bcast-arrival-pattern-aware-wait.cpp index 7367b40a47..6e17bd4f23 100644 --- a/src/smpi/colls/bcast/bcast-arrival-pattern-aware-wait.cpp +++ b/src/smpi/colls/bcast/bcast-arrival-pattern-aware-wait.cpp @@ -15,8 +15,7 @@ int bcast_arrival_pattern_aware_wait_segment_size_in_byte = 8192; #ifndef BCAST_ARRIVAL_PATTERN_AWARE_MAX_NODE #define BCAST_ARRIVAL_PATTERN_AWARE_MAX_NODE 128 #endif -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { /* Non-topology-specific pipelined linear-bcast function */ int bcast__arrival_pattern_aware_wait(void *buf, int count, MPI_Datatype datatype, @@ -241,5 +240,4 @@ int bcast__arrival_pattern_aware_wait(void *buf, int count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-arrival-pattern-aware.cpp b/src/smpi/colls/bcast/bcast-arrival-pattern-aware.cpp index 4cd0815745..f2952be551 100644 --- a/src/smpi/colls/bcast/bcast-arrival-pattern-aware.cpp +++ b/src/smpi/colls/bcast/bcast-arrival-pattern-aware.cpp @@ -11,8 +11,7 @@ static int bcast_NTSL_segment_size_in_byte = 8192; #define HEADER_SIZE 1024 #define MAX_NODE 1024 -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { /* Non-topology-specific pipelined linear-bcast function */ int bcast__arrival_pattern_aware(void *buf, int count, MPI_Datatype datatype, int root, @@ -356,5 +355,4 @@ int bcast__arrival_pattern_aware(void *buf, int count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-arrival-scatter.cpp b/src/smpi/colls/bcast/bcast-arrival-scatter.cpp index 78fb73965a..d4d03e1391 100644 --- a/src/smpi/colls/bcast/bcast-arrival-scatter.cpp +++ b/src/smpi/colls/bcast/bcast-arrival-scatter.cpp @@ -13,8 +13,7 @@ #ifndef BCAST_ARRIVAL_PATTERN_AWARE_MAX_NODE #define BCAST_ARRIVAL_PATTERN_AWARE_MAX_NODE 128 #endif -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { /* Non-topology-specific pipelined linear-bcast function */ int bcast__arrival_scatter(void *buf, int count, MPI_Datatype datatype, int root, @@ -233,5 +232,4 @@ int bcast__arrival_scatter(void *buf, int count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-binomial-tree.cpp b/src/smpi/colls/bcast/bcast-binomial-tree.cpp index 8d7076a220..0f19627116 100644 --- a/src/smpi/colls/bcast/bcast-binomial-tree.cpp +++ b/src/smpi/colls/bcast/bcast-binomial-tree.cpp @@ -67,8 +67,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Author: MPIH / modified by Ahmad Faraj ****************************************************************************/ -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int bcast__binomial_tree(void *buff, int count, MPI_Datatype data_type, int root, MPI_Comm comm) @@ -107,5 +106,4 @@ int bcast__binomial_tree(void *buff, int count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-flattree-pipeline.cpp b/src/smpi/colls/bcast/bcast-flattree-pipeline.cpp index 5ee6e2fa6a..a1446463f0 100644 --- a/src/smpi/colls/bcast/bcast-flattree-pipeline.cpp +++ b/src/smpi/colls/bcast/bcast-flattree-pipeline.cpp @@ -7,8 +7,7 @@ #include "../colls_private.hpp" int flattree_segment_in_byte = 8192; -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int bcast__flattree_pipeline(void *buff, int count, MPI_Datatype data_type, int root, MPI_Comm comm) @@ -59,5 +58,4 @@ int bcast__flattree_pipeline(void *buff, int count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-flattree.cpp b/src/smpi/colls/bcast/bcast-flattree.cpp index 8ae4577a47..800777f1d5 100644 --- a/src/smpi/colls/bcast/bcast-flattree.cpp +++ b/src/smpi/colls/bcast/bcast-flattree.cpp @@ -5,8 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "../colls_private.hpp" -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int bcast__flattree(void *buff, int count, MPI_Datatype data_type, int root, MPI_Comm comm) { @@ -39,5 +38,4 @@ int bcast__flattree(void *buff, int count, MPI_Datatype data_type, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-mvapich-smp.cpp b/src/smpi/colls/bcast/bcast-mvapich-smp.cpp index 5c55f32e03..50ea2ae39e 100644 --- a/src/smpi/colls/bcast/bcast-mvapich-smp.cpp +++ b/src/smpi/colls/bcast/bcast-mvapich-smp.cpp @@ -73,8 +73,7 @@ extern int mv2_intra_node_knomial_factor; #define mv2_bcast_large_msg 512*1024 #define mv2_knomial_intra_node_threshold 131072 #define mv2_scatter_rd_inter_leader_bcast 1 -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int bcast__mvapich2_inter_node(void *buffer, int count, MPI_Datatype datatype, @@ -380,5 +379,4 @@ int bcast__mvapich2_intra_node(void *buffer, } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-ompi-pipeline.cpp b/src/smpi/colls/bcast/bcast-ompi-pipeline.cpp index e4c06fb110..e57fc37402 100644 --- a/src/smpi/colls/bcast/bcast-ompi-pipeline.cpp +++ b/src/smpi/colls/bcast/bcast-ompi-pipeline.cpp @@ -9,8 +9,7 @@ #define MAXTREEFANOUT 32 -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int bcast__ompi_pipeline( void* buffer, int original_count, MPI_Datatype datatype, @@ -211,5 +210,4 @@ int bcast__ompi_pipeline( void* buffer, return (MPI_SUCCESS); } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp b/src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp index a99933f6fe..437905aebb 100644 --- a/src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp +++ b/src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp @@ -58,8 +58,7 @@ #include "../coll_tuned_topo.hpp" #include "../colls_private.hpp" #define MAXTREEFANOUT 32 -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int bcast__ompi_split_bintree( void* buffer, int count, @@ -292,6 +291,4 @@ int bcast__ompi_split_bintree( void* buffer, } -} -} - +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp b/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp index aca6957b21..dcf21486e0 100644 --- a/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp +++ b/src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp @@ -67,8 +67,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Author: MPIH / modified by Ahmad Faraj ****************************************************************************/ -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int bcast__scatter_LR_allgather(void *buff, int count, MPI_Datatype data_type, int root, MPI_Comm comm) @@ -177,5 +176,4 @@ int bcast__scatter_LR_allgather(void *buff, int count, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp b/src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp index 0c41344d63..1612f14ccf 100644 --- a/src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp +++ b/src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp @@ -6,8 +6,7 @@ #include "../colls_private.hpp" #include "smpi_status.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { static int scatter_for_bcast( int root, @@ -328,5 +327,4 @@ fn_exit: return mpi_errno; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/gather/gather-mvapich.cpp b/src/smpi/colls/gather/gather-mvapich.cpp index 3eb2a1b106..e4ee3dc366 100644 --- a/src/smpi/colls/gather/gather-mvapich.cpp +++ b/src/smpi/colls/gather/gather-mvapich.cpp @@ -55,8 +55,7 @@ extern MV2_Gather_function_ptr MV2_Gather_intra_node_function; #define TEMP_BUF_HAS_NO_DATA (false) #define TEMP_BUF_HAS_DATA (true) -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { /* sendbuf - (in) sender's buffer * sendcnt - (in) sender's element count @@ -394,6 +393,4 @@ int gather__mvapich2_two_level(const void *sendbuf, return (mpi_errno); } -} -} - +} // namespace simgrid::smpi diff --git a/src/smpi/colls/gather/gather-ompi.cpp b/src/smpi/colls/gather/gather-ompi.cpp index 45dfc3ac14..6ee45a8b77 100644 --- a/src/smpi/colls/gather/gather-ompi.cpp +++ b/src/smpi/colls/gather/gather-ompi.cpp @@ -22,8 +22,7 @@ #include "../coll_tuned_topo.hpp" #include "../colls_private.hpp" -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int gather__ompi_binomial(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, int root, MPI_Comm comm) @@ -409,5 +408,4 @@ int gather__ompi_basic_linear(const void* sbuf, int scount, MPI_Datatype sdtype, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce/reduce-NTSL.cpp b/src/smpi/colls/reduce/reduce-NTSL.cpp index a0b2925ee4..27eb434393 100644 --- a/src/smpi/colls/reduce/reduce-NTSL.cpp +++ b/src/smpi/colls/reduce/reduce-NTSL.cpp @@ -12,8 +12,7 @@ int reduce_NTSL_segment_size_in_byte = 8192; /* Non-topology-specific pipelined linear-bcast function 0->1, 1->2 ,2->3, ....., ->last node : in a pipeline fashion */ -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int reduce__NTSL(const void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) @@ -140,5 +139,4 @@ int reduce__NTSL(const void *buf, void *rbuf, int count, smpi_free_tmp_buffer(tmp_buf); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp b/src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp index fbd52c675f..e9d028283e 100644 --- a/src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp +++ b/src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp @@ -16,8 +16,7 @@ int reduce_arrival_pattern_aware_segment_size_in_byte = 8192; #ifndef MAX_NODE #define MAX_NODE 1024 #endif -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { /* Non-topology-specific pipelined linear-reduce function */ int reduce__arrival_pattern_aware(const void *buf, void *rbuf, int count, @@ -340,5 +339,4 @@ int reduce__arrival_pattern_aware(const void *buf, void *rbuf, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce/reduce-binomial.cpp b/src/smpi/colls/reduce/reduce-binomial.cpp index 80a4b6692f..b88575d260 100644 --- a/src/smpi/colls/reduce/reduce-binomial.cpp +++ b/src/smpi/colls/reduce/reduce-binomial.cpp @@ -8,8 +8,7 @@ #include //#include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int reduce__binomial(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) @@ -92,5 +91,4 @@ int reduce__binomial(const void *sendbuf, void *recvbuf, int count, return 0; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce/reduce-flat-tree.cpp b/src/smpi/colls/reduce/reduce-flat-tree.cpp index 40d1df6cce..0dd1668039 100644 --- a/src/smpi/colls/reduce/reduce-flat-tree.cpp +++ b/src/smpi/colls/reduce/reduce-flat-tree.cpp @@ -6,8 +6,7 @@ #include "../colls_private.hpp" //#include -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int reduce__flat_tree(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, int root, MPI_Comm comm) @@ -64,5 +63,4 @@ int reduce__flat_tree(const void *sbuf, void *rbuf, int count, /* All done */ return 0; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce/reduce-mvapich-knomial.cpp b/src/smpi/colls/reduce/reduce-mvapich-knomial.cpp index 8c7f0ac735..e875ede94d 100644 --- a/src/smpi/colls/reduce/reduce-mvapich-knomial.cpp +++ b/src/smpi/colls/reduce/reduce-mvapich-knomial.cpp @@ -116,8 +116,7 @@ static int MPIR_Reduce_knomial_trace(int root, int reduce_knomial_factor, return 0; } -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int reduce__mvapich2_knomial( const void *sendbuf, void *recvbuf, @@ -224,5 +223,4 @@ int reduce__mvapich2_knomial( return mpi_errno; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp b/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp index c99ec42e7c..cf090d0766 100644 --- a/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp +++ b/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp @@ -73,8 +73,7 @@ static int (*reduce_fn)(const void *sendbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int reduce__mvapich2_two_level( const void *sendbuf, void *recvbuf, int count, @@ -295,5 +294,4 @@ int reduce__mvapich2_two_level( const void *sendbuf, fn_exit: return mpi_errno; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce/reduce-ompi.cpp b/src/smpi/colls/reduce/reduce-ompi.cpp index 1a30e78453..f1db121f0a 100644 --- a/src/smpi/colls/reduce/reduce-ompi.cpp +++ b/src/smpi/colls/reduce/reduce-ompi.cpp @@ -22,8 +22,7 @@ #include "../coll_tuned_topo.hpp" #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int smpi_coll_tuned_ompi_reduce_generic(const void* sendbuf, void* recvbuf, int original_count, MPI_Datatype datatype, MPI_Op op, @@ -680,6 +679,4 @@ int reduce__ompi_basic_linear(const void *sbuf, void *rbuf, int count, /* copied function (with appropriate renaming) ends here */ - -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce/reduce-rab.cpp b/src/smpi/colls/reduce/reduce-rab.cpp index 38f2f88f6d..758cf32cf2 100644 --- a/src/smpi/colls/reduce/reduce-rab.cpp +++ b/src/smpi/colls/reduce/reduce-rab.cpp @@ -581,8 +581,7 @@ static void MPI_I_do_op(void* b1, void* b2, void* rslt, int cnt, MPIM_Datatype d } REDUCE_LIMITS -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { static int MPI_I_anyReduce(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype mpi_datatype, MPI_Op mpi_op, int root, MPI_Comm comm, bool is_all) { @@ -1024,5 +1023,4 @@ int allreduce__rab(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype d { return MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, -1, comm, true); } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce/reduce-scatter-gather.cpp b/src/smpi/colls/reduce/reduce-scatter-gather.cpp index 5c7a9d048b..40242f36aa 100644 --- a/src/smpi/colls/reduce/reduce-scatter-gather.cpp +++ b/src/smpi/colls/reduce/reduce-scatter-gather.cpp @@ -10,8 +10,7 @@ reduce Author: MPICH */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int reduce__scatter_gather(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) @@ -395,5 +394,4 @@ int reduce__scatter_gather(const void *sendbuf, void *recvbuf, return 0; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp b/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp index 3e3278a780..f2607b9060 100644 --- a/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp +++ b/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp @@ -21,8 +21,7 @@ static inline int MPIU_Mirror_permutation(unsigned int x, int bits) return retval; } -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int reduce_scatter__mpich_pair(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) @@ -482,7 +481,5 @@ int reduce_scatter__mpich_rdb(const void *sendbuf, void *recvbuf, const int recv smpi_free_tmp_buffer(tmp_recvbuf); smpi_free_tmp_buffer(tmp_results); return MPI_SUCCESS; - } -} } - +} // namespace simgrid::smpi diff --git a/src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp b/src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp index 6398ff37d9..bd651f4927 100644 --- a/src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp +++ b/src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp @@ -41,8 +41,7 @@ * Returns: - MPI_SUCCESS or error code * Limitation: - Works only for commutative operations. */ -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int reduce_scatter__ompi_basic_recursivehalving(const void *sbuf, void *rbuf, const int *rcounts, @@ -803,5 +802,4 @@ cleanup_and_return: free(tmpbuf[1]); return err; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/scatter/scatter-mvapich-two-level.cpp b/src/smpi/colls/scatter/scatter-mvapich-two-level.cpp index 02bb56d325..901d14e231 100644 --- a/src/smpi/colls/scatter/scatter-mvapich-two-level.cpp +++ b/src/smpi/colls/scatter/scatter-mvapich-two-level.cpp @@ -43,8 +43,7 @@ extern int (*MV2_Scatter_intra_function) (const void *sendbuf, int sendcount, MP void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int scatter__mvapich2_two_level_direct(const void *sendbuf, int sendcnt, @@ -401,6 +400,4 @@ int scatter__mvapich2_two_level_binomial(const void *sendbuf, return (mpi_errno); } -} -} - +} // namespace simgrid::smpi diff --git a/src/smpi/colls/scatter/scatter-ompi.cpp b/src/smpi/colls/scatter/scatter-ompi.cpp index 67984b0c9f..db47ef7cba 100644 --- a/src/smpi/colls/scatter/scatter-ompi.cpp +++ b/src/smpi/colls/scatter/scatter-ompi.cpp @@ -22,8 +22,7 @@ #include "../coll_tuned_topo.hpp" #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int scatter__ompi_binomial(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, int root, MPI_Comm comm) @@ -324,5 +323,4 @@ err_hndl: return err; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/smpi_automatic_selector.cpp b/src/smpi/colls/smpi_automatic_selector.cpp index b7efd1a039..01c108ce8c 100644 --- a/src/smpi/colls/smpi_automatic_selector.cpp +++ b/src/smpi/colls/smpi_automatic_selector.cpp @@ -63,8 +63,7 @@ return (min_coll != -1) ? MPI_SUCCESS : MPI_ERR_INTERN; \ } -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_ALLGATHERV_SIG, (send_buff, send_count, send_type, recv_buff, recv_count, recv_disps, recv_type, comm)) COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_ALLREDUCE_SIG, (sbuf, rbuf, rcount, dtype, op, comm)) @@ -78,5 +77,4 @@ COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_REDUCE_SCATTER_SIG ,(sbuf,rbuf, rcounts,dt COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_SCATTER_SIG ,(sendbuf, sendcount, sendtype,recvbuf, recvcount, recvtype,root, comm)) COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_BARRIER_SIG,(comm)) -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/smpi_coll.cpp b/src/smpi/colls/smpi_coll.cpp index c8c322e5d9..3d704cda57 100644 --- a/src/smpi/colls/smpi_coll.cpp +++ b/src/smpi/colls/smpi_coll.cpp @@ -17,8 +17,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi, "Logging specific to SMPI collectives."); -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { std::map, std::less<>> smpi_coll_descriptions( {{std::string("gather"), @@ -482,5 +481,4 @@ int colls::alltoallw(const void* sendbuf, const int* sendcounts, const int* send return Request::wait(&request, MPI_STATUS_IGNORE); } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/smpi_default_selector.cpp b/src/smpi/colls/smpi_default_selector.cpp index c16593c53c..efea3a1ca2 100644 --- a/src/smpi/colls/smpi_default_selector.cpp +++ b/src/smpi/colls/smpi_default_selector.cpp @@ -8,8 +8,7 @@ #include "colls_private.hpp" #include "src/smpi/include/smpi_actor.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int bcast__default(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm) { @@ -131,6 +130,4 @@ int alltoallv__default(const void *sendbuf, const int *sendcounts, const int *se return Request::wait(&request, MPI_STATUS_IGNORE); } -} -} - +} // namespace simgrid::smpi diff --git a/src/smpi/colls/smpi_intel_mpi_selector.cpp b/src/smpi/colls/smpi_intel_mpi_selector.cpp index 86e05080fa..fd4b879dd6 100644 --- a/src/smpi/colls/smpi_intel_mpi_selector.cpp +++ b/src/smpi/colls/smpi_intel_mpi_selector.cpp @@ -47,8 +47,7 @@ MPI_Allreduce as Shumilin's ring algorithm is unknown, default to ring' */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int (*intel_allreduce_functions_table[])(const void *sendbuf, void *recvbuf, @@ -2302,5 +2301,4 @@ COLL_APPLY(IMPI_COLL_SELECT, COLL_REDUCE_SCATTER_SIG ,(sbuf,rbuf, rcounts,dtype, COLL_APPLY(IMPI_COLL_SELECT, COLL_SCATTER_SIG ,(sendbuf, sendcount, sendtype,recvbuf, recvcount, recvtype,root, comm)) COLL_APPLY(IMPI_COLL_SELECT, COLL_BARRIER_SIG,(comm)) -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/smpi_mpich_selector.cpp b/src/smpi/colls/smpi_mpich_selector.cpp index 16f01f0d61..4a3a6ae01d 100644 --- a/src/smpi/colls/smpi_mpich_selector.cpp +++ b/src/smpi/colls/smpi_mpich_selector.cpp @@ -58,8 +58,7 @@ End Algorithm: MPI_Allreduce */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int allreduce__mpich(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { @@ -704,6 +703,4 @@ int scatter__mpich(const void *sbuf, int scount, } return scatter__ompi_binomial(sbuf, scount, sdtype, rbuf, rcount, rdtype, root, comm); } -} -} - +} // namespace simgrid::smpi diff --git a/src/smpi/colls/smpi_mvapich2_selector.cpp b/src/smpi/colls/smpi_mvapich2_selector.cpp index 5c2524f486..c79a308f0c 100644 --- a/src/smpi/colls/smpi_mvapich2_selector.cpp +++ b/src/smpi/colls/smpi_mvapich2_selector.cpp @@ -10,9 +10,7 @@ #include "smpi_mvapich2_selector_stampede.hpp" -namespace simgrid { -namespace smpi { - +namespace simgrid::smpi { int alltoall__mvapich2( const void *sendbuf, int sendcount, MPI_Datatype sendtype, @@ -974,8 +972,7 @@ int scatter__mvapich2(const void *sendbuf, return (mpi_errno); } -} -} +} // namespace simgrid::smpi void smpi_coll_cleanup_mvapich2() { diff --git a/src/smpi/colls/smpi_nbc_impl.cpp b/src/smpi/colls/smpi_nbc_impl.cpp index 4996a960d6..cd893b058d 100644 --- a/src/smpi/colls/smpi_nbc_impl.cpp +++ b/src/smpi/colls/smpi_nbc_impl.cpp @@ -8,8 +8,7 @@ #include "colls_private.hpp" #include "src/smpi/include/smpi_actor.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int colls::ibarrier(MPI_Comm comm, MPI_Request* request, int external) { @@ -550,5 +549,4 @@ int colls::ireduce_scatter(const void* sendbuf, void* recvbuf, const int* recvco return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/colls/smpi_openmpi_selector.cpp b/src/smpi/colls/smpi_openmpi_selector.cpp index d030955b10..404cbfaf08 100644 --- a/src/smpi/colls/smpi_openmpi_selector.cpp +++ b/src/smpi/colls/smpi_openmpi_selector.cpp @@ -11,8 +11,7 @@ #include -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int allreduce__ompi(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) @@ -1336,5 +1335,4 @@ int scatter__ompi(const void *sbuf, int scount, return funcs[alg-1](sbuf, scount, sdtype, rbuf, rcount, rdtype, root, comm); } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/include/smpi_actor.hpp b/src/smpi/include/smpi_actor.hpp index c2d324a417..5879ef6082 100644 --- a/src/smpi/include/smpi_actor.hpp +++ b/src/smpi/include/smpi_actor.hpp @@ -12,8 +12,7 @@ #include "xbt/xbt_os_time.h" #include -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { class ActorExt { double simulated_ = 0 /* Used to time with simulated_start/elapsed */; @@ -95,7 +94,6 @@ public: int set_bsend_buffer(void* buf, int size); }; -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_coll.hpp b/src/smpi/include/smpi_coll.hpp index 963de8a066..06e66e4a08 100644 --- a/src/smpi/include/smpi_coll.hpp +++ b/src/smpi/include/smpi_coll.hpp @@ -46,8 +46,7 @@ #define COLL_BARRIER_SIG barrier, int, \ (MPI_Comm comm) -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { struct s_mpi_coll_description_t { std::string name; @@ -337,6 +336,5 @@ int barrier__mvapich2 (MPI_Comm comm); int barrier__impi(MPI_Comm comm); int barrier__automatic(MPI_Comm comm); -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_comm.hpp b/src/smpi/include/smpi_comm.hpp index dee8666eb4..1ba249e014 100644 --- a/src/smpi/include/smpi_comm.hpp +++ b/src/smpi/include/smpi_comm.hpp @@ -15,8 +15,7 @@ #include "smpi_topo.hpp" #include "smpi_config.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Comm : public F2C, public Keyval{ friend Topo; @@ -103,7 +102,6 @@ public: void increment_collectives_count(); }; -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_datatype.hpp b/src/smpi/include/smpi_datatype.hpp index 5f67115960..a2e404ebaf 100644 --- a/src/smpi/include/smpi_datatype.hpp +++ b/src/smpi/include/smpi_datatype.hpp @@ -82,8 +82,7 @@ struct integer128_t { int64_t index; }; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Datatype_contents { public: int combiner_; @@ -179,7 +178,6 @@ public: static Datatype* f2c(int id); }; -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_datatype_derived.hpp b/src/smpi/include/smpi_datatype_derived.hpp index 64d02b5d92..cd7a9e0979 100644 --- a/src/smpi/include/smpi_datatype_derived.hpp +++ b/src/smpi/include/smpi_datatype_derived.hpp @@ -9,8 +9,7 @@ #include "smpi_datatype.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Type_Contiguous: public Datatype { int block_count_; @@ -93,7 +92,6 @@ public: void unserialize(const void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op) override; }; -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_errhandler.hpp b/src/smpi/include/smpi_errhandler.hpp index f3be169e41..c4018495d3 100644 --- a/src/smpi/include/smpi_errhandler.hpp +++ b/src/smpi/include/smpi_errhandler.hpp @@ -9,9 +9,7 @@ #include "smpi_f2c.hpp" #include - -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Errhandler: public F2C { private: @@ -32,7 +30,6 @@ class Errhandler: public F2C { static void unref(Errhandler* errhandler); static Errhandler* f2c(int id); }; -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_f2c.hpp b/src/smpi/include/smpi_f2c.hpp index 3433712cba..5b10ba78ef 100644 --- a/src/smpi/include/smpi_f2c.hpp +++ b/src/smpi/include/smpi_f2c.hpp @@ -13,8 +13,7 @@ #include #include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class F2C { private: @@ -59,7 +58,6 @@ public: const std::string& call_location() const { return call_location_; } }; -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_file.hpp b/src/smpi/include/smpi_file.hpp index efda1cd268..b79164b8df 100644 --- a/src/smpi/include/smpi_file.hpp +++ b/src/smpi/include/smpi_file.hpp @@ -16,8 +16,7 @@ XBT_LOG_EXTERNAL_CATEGORY(smpi_pmpi); -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class File : public F2C{ MPI_Comm comm_; int flags_; @@ -194,7 +193,6 @@ int File::op_all(void* buf, int count, const Datatype* datatype, MPI_Status* sta smpi_free_tmp_buffer(sendbuf); return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_group.hpp b/src/smpi/include/smpi_group.hpp index 1cec217058..aed599bea1 100644 --- a/src/smpi/include/smpi_group.hpp +++ b/src/smpi/include/smpi_group.hpp @@ -12,8 +12,7 @@ #include #include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Group : public F2C{ /* This is actually a map from int to aid_t. We could use std::map here, but looking up a value there costs @@ -50,7 +49,6 @@ public: static Group* f2c(int id); }; -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_host.hpp b/src/smpi/include/smpi_host.hpp index e398448d65..d75aa0ffd8 100644 --- a/src/smpi/include/smpi_host.hpp +++ b/src/smpi/include/smpi_host.hpp @@ -13,8 +13,7 @@ #include #include -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { class Host { std::vector orecv_parsed_values; @@ -37,6 +36,5 @@ public: double oisend(size_t size, s4u::Host* src, s4u::Host* dst); }; -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_info.hpp b/src/smpi/include/smpi_info.hpp index c9f789fe98..d40680166b 100644 --- a/src/smpi/include/smpi_info.hpp +++ b/src/smpi/include/smpi_info.hpp @@ -12,8 +12,7 @@ #include #include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Info : public F2C{ std::map> map_; @@ -34,7 +33,6 @@ public: static Info* f2c(int id); }; -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_keyvals.hpp b/src/smpi/include/smpi_keyvals.hpp index 4c00298a18..a4a0305529 100644 --- a/src/smpi/include/smpi_keyvals.hpp +++ b/src/smpi/include/smpi_keyvals.hpp @@ -38,8 +38,7 @@ struct smpi_key_elem { bool delete_attr; // if true, xbt_free(attr) on delete: used by Fortran bindings }; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Keyval{ private: @@ -163,7 +162,6 @@ template void Keyval::cleanup_attr(){ attributes().clear(); } -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_op.hpp b/src/smpi/include/smpi_op.hpp index 66a561d013..c8573dbfe0 100644 --- a/src/smpi/include/smpi_op.hpp +++ b/src/smpi/include/smpi_op.hpp @@ -9,8 +9,7 @@ #include "smpi_info.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Op : public F2C{ MPI_User_function* func_; @@ -41,7 +40,6 @@ public: static void unref(MPI_Op* op); }; -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_replay.hpp b/src/smpi/include/smpi_replay.hpp index d17d5fbde1..1f00a1921b 100644 --- a/src/smpi/include/smpi_replay.hpp +++ b/src/smpi/include/smpi_replay.hpp @@ -35,9 +35,7 @@ XBT_PRIVATE unsigned char* smpi_get_tmp_recvbuffer(size_t size); XBT_PRIVATE void log_timed_action(const simgrid::xbt::ReplayAction& action, double clock); -namespace simgrid { -namespace smpi { -namespace replay { +namespace simgrid::smpi::replay { extern MPI_Datatype MPI_DEFAULT_TYPE; class RequestStorage; // Forward decl @@ -356,8 +354,6 @@ public: void kernel(xbt::ReplayAction& action) override; }; -} // namespace replay -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi::replay #endif diff --git a/src/smpi/include/smpi_request.hpp b/src/smpi/include/smpi_request.hpp index a91b6ab948..d63ed7b1e2 100644 --- a/src/smpi/include/smpi_request.hpp +++ b/src/smpi/include/smpi_request.hpp @@ -11,8 +11,7 @@ #include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { struct smpi_mpi_generalized_request_funcs_t { MPI_Grequest_query_function *query_fn; @@ -129,8 +128,6 @@ public: static Request* f2c(int); }; - -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_status.hpp b/src/smpi/include/smpi_status.hpp index a6e2160926..25446988f2 100644 --- a/src/smpi/include/smpi_status.hpp +++ b/src/smpi/include/smpi_status.hpp @@ -9,8 +9,7 @@ #include "smpi/smpi.h" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { //Status has to stay in C, as its fields are public. //So status class only defines static methods to handle the C struct. @@ -23,7 +22,5 @@ static void set_elements(MPI_Status* status, const Datatype*, int count); static int get_count(const MPI_Status* status, const Datatype* datatype); }; - -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_topo.hpp b/src/smpi/include/smpi_topo.hpp index cdce35a7f9..0f5ff72bbe 100644 --- a/src/smpi/include/smpi_topo.hpp +++ b/src/smpi/include/smpi_topo.hpp @@ -12,8 +12,7 @@ using MPI_Topology = std::shared_ptr; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Topo { MPI_Comm comm_ = MPI_COMM_NULL; @@ -56,8 +55,6 @@ class Topo_Dist_Graph: public Topo { std::vector out_weights_; }; -} -} - +} // namespace simgrid::smpi #endif diff --git a/src/smpi/include/smpi_utils.hpp b/src/smpi/include/smpi_utils.hpp index ad7025246b..99ff9c7d44 100644 --- a/src/smpi/include/smpi_utils.hpp +++ b/src/smpi/include/smpi_utils.hpp @@ -21,9 +21,7 @@ struct s_smpi_factor_t { std::vector values; }; -namespace simgrid { -namespace smpi { -namespace utils { +namespace simgrid::smpi::utils { XBT_PUBLIC std::vector parse_factor(const std::string& smpi_coef_string); XBT_PUBLIC void add_benched_time(double time); @@ -39,7 +37,5 @@ XBT_PUBLIC size_t get_buffer_size(const void* ptr); XBT_PUBLIC void account_free(const void* ptr); XBT_PUBLIC int check_collectives_ordering(MPI_Comm comm, const std::string& call); -} // namespace utils -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi::utils #endif diff --git a/src/smpi/include/smpi_win.hpp b/src/smpi/include/smpi_win.hpp index 339b3c2b57..ea8b9c47b7 100644 --- a/src/smpi/include/smpi_win.hpp +++ b/src/smpi/include/smpi_win.hpp @@ -16,8 +16,7 @@ #include #include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Win : public F2C, public Keyval { void* base_; @@ -102,8 +101,6 @@ public: void set_errhandler( MPI_Errhandler errhandler); }; - -} -} +} // namespace simgrid::smpi #endif diff --git a/src/smpi/internals/smpi_actor.cpp b/src/smpi/internals/smpi_actor.cpp index 389adc4092..e513fabf8d 100644 --- a/src/smpi/internals/smpi_actor.cpp +++ b/src/smpi/internals/smpi_actor.cpp @@ -18,8 +18,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_process, smpi, "Logging specific to SMPI (kernel)"); -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { simgrid::xbt::Extension ActorExt::EXTENSION_ID; ActorExt::ActorExt(s4u::Actor* actor) : actor_(actor) @@ -273,5 +272,4 @@ int ActorExt::set_bsend_buffer(void* buf, int size) return MPI_SUCCESS; } -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi diff --git a/src/smpi/internals/smpi_deployment.cpp b/src/smpi/internals/smpi_deployment.cpp index 18abaa6af5..abc235f7a4 100644 --- a/src/smpi/internals/smpi_deployment.cpp +++ b/src/smpi/internals/smpi_deployment.cpp @@ -13,9 +13,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi); -namespace simgrid { -namespace smpi { -namespace app { +namespace simgrid::smpi::app { static int universe_size = 0; @@ -33,9 +31,7 @@ public: unsigned int finalized_ranks_ = 0; MPI_Comm comm_world_; }; -} -} -} +} // namespace simgrid::smpi::app using simgrid::smpi::app::Instance; diff --git a/src/smpi/internals/smpi_host.cpp b/src/smpi/internals/smpi_host.cpp index bef0db3321..d8daf0df72 100644 --- a/src/smpi/internals/smpi_host.cpp +++ b/src/smpi/internals/smpi_host.cpp @@ -29,8 +29,7 @@ void smpi_cleanup_op_cost_callback() cost_cbs.clear(); } -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { xbt::Extension Host::EXTENSION_ID; @@ -155,5 +154,4 @@ Host::Host(s4u::Host* ptr) : host(ptr) } } -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi diff --git a/src/smpi/internals/smpi_replay.cpp b/src/smpi/internals/smpi_replay.cpp index 803906fc5d..218f14d988 100644 --- a/src/smpi/internals/smpi_replay.cpp +++ b/src/smpi/internals/smpi_replay.cpp @@ -97,10 +97,7 @@ static MPI_Datatype parse_datatype(const simgrid::xbt::ReplayAction& action, uns return i < action.size() ? simgrid::smpi::Datatype::decode(action[i]) : simgrid::smpi::replay::MPI_DEFAULT_TYPE; } -namespace simgrid { -namespace smpi { - -namespace replay { +namespace simgrid::smpi::replay { MPI_Datatype MPI_DEFAULT_TYPE; class RequestStorage { @@ -801,8 +798,7 @@ void AllToAllVAction::kernel(simgrid::xbt::ReplayAction&) TRACE_smpi_comm_out(get_pid()); } -} // Replay Namespace -}} // namespace simgrid::smpi +} // namespace simgrid::smpi::replay static std::unordered_map storage; /** @brief Only initialize the replay, don't do it for real */ diff --git a/src/smpi/internals/smpi_utils.cpp b/src/smpi/internals/smpi_utils.cpp index 61974bd0e8..967e7296b4 100644 --- a/src/smpi/internals/smpi_utils.cpp +++ b/src/smpi/internals/smpi_utils.cpp @@ -22,9 +22,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_utils, smpi, "Logging specific to SMPI (uti extern std::string surf_parsed_filename; extern int surf_parse_lineno; -namespace simgrid { -namespace smpi { -namespace utils { +namespace simgrid::smpi::utils { double total_benched_time=0; unsigned long total_malloc_size=0; @@ -367,6 +365,4 @@ int check_collectives_ordering(MPI_Comm comm, const std::string& call) } return MPI_SUCCESS; } -} -} -} // namespace simgrid +} // namespace simgrid::smpi::utils diff --git a/src/smpi/mpi/smpi_comm.cpp b/src/smpi/mpi/smpi_comm.cpp index 117f08f7c9..2aab0fffd9 100644 --- a/src/smpi/mpi/smpi_comm.cpp +++ b/src/smpi/mpi/smpi_comm.cpp @@ -33,8 +33,7 @@ MPI_Comm MPI_COMM_WORLD = MPI_COMM_UNINITIALIZED; /* Support for cartesian topology was added, but there are 2 other types of topology, graph et dist graph. In order to * support them, we have to add a field SMPI_Topo_type, and replace the MPI_Topology field by an union. */ -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { std::unordered_map Comm::keyvals_; int Comm::keyval_id_=0; @@ -676,5 +675,4 @@ void Comm::increment_collectives_count() } } -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_datatype.cpp b/src/smpi/mpi/smpi_datatype.cpp index 3be3ace0be..e2b864076e 100644 --- a/src/smpi/mpi/smpi_datatype.cpp +++ b/src/smpi/mpi/smpi_datatype.cpp @@ -104,9 +104,7 @@ CREATE_MPI_DATATYPE(PTR, 58, void*, DT_FLAG_PREDEFINED) CREATE_MPI_DATATYPE(COUNT, 59, long long, DT_FLAG_MULTILANG) MPI_Datatype MPI_PTR = &smpi_MPI_PTR; - -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { std::unordered_map Datatype::keyvals_; // required by the Keyval class implementation int Datatype::keyval_id_=0; // required by the Keyval class implementation @@ -654,5 +652,4 @@ Datatype* Datatype::f2c(int id) return static_cast(F2C::f2c(id)); } -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_datatype_derived.cpp b/src/smpi/mpi/smpi_datatype_derived.cpp index 0a9895925c..3e3b3797fe 100644 --- a/src/smpi/mpi/smpi_datatype_derived.cpp +++ b/src/smpi/mpi/smpi_datatype_derived.cpp @@ -11,8 +11,7 @@ #include #include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { Datatype_contents::Datatype_contents(int combiner, int number_of_integers, const int* integers, int number_of_addresses, const MPI_Aint* addresses, int number_of_datatypes, const MPI_Datatype* datatypes) @@ -335,5 +334,4 @@ void Type_Struct::unserialize(const void* contiguous_buf, void *noncontiguous_bu } } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_errhandler.cpp b/src/smpi/mpi/smpi_errhandler.cpp index e795736ce5..300a0b2d41 100644 --- a/src/smpi/mpi/smpi_errhandler.cpp +++ b/src/smpi/mpi/smpi_errhandler.cpp @@ -11,8 +11,7 @@ simgrid::smpi::Errhandler smpi_MPI_ERRORS_RETURN; simgrid::smpi::Errhandler smpi_MPI_ERRORS_ARE_FATAL; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { MPI_Errhandler Errhandler::f2c(int id) { if (F2C::lookup() != nullptr && id >= 0) { @@ -52,6 +51,4 @@ void Errhandler::unref(Errhandler* errhandler){ } } -} - -} +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_f2c.cpp b/src/smpi/mpi/smpi_f2c.cpp index 746a3b41cf..ab1da74628 100644 --- a/src/smpi/mpi/smpi_f2c.cpp +++ b/src/smpi/mpi/smpi_f2c.cpp @@ -13,8 +13,7 @@ int mpi_bottom_; int mpi_status_ignore_; int mpi_statuses_ignore_; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { std::unique_ptr F2C::f2c_lookup_ = nullptr; int F2C::f2c_id_ = 0; @@ -56,5 +55,4 @@ F2C* F2C::f2c(int id) return nullptr; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_file.cpp b/src/smpi/mpi/smpi_file.cpp index 38dbf19a0d..c6a65c8447 100644 --- a/src/smpi/mpi/smpi_file.cpp +++ b/src/smpi/mpi/smpi_file.cpp @@ -23,8 +23,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_io, smpi, "Logging specific to SMPI (RMA op MPI_Errhandler SMPI_default_File_Errhandler = _smpi_cfg_default_errhandler_is_error ? MPI_ERRORS_ARE_FATAL : MPI_ERRORS_RETURN;; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { File::File(MPI_Comm comm, const char* filename, int amode, MPI_Info info) : comm_(comm), flags_(amode), info_(info) { @@ -345,5 +344,4 @@ File* File::f2c(int id) { return static_cast(F2C::f2c(id)); } -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_group.cpp b/src/smpi/mpi/smpi_group.cpp index 86a3403fcd..1c3b813184 100644 --- a/src/smpi/mpi/smpi_group.cpp +++ b/src/smpi/mpi/smpi_group.cpp @@ -10,8 +10,7 @@ simgrid::smpi::Group smpi_MPI_GROUP_EMPTY; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { Group::Group(const Group* origin) { @@ -214,5 +213,4 @@ MPI_Group Group::f2c(int id) { } } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_info.cpp b/src/smpi/mpi/smpi_info.cpp index dfcc335191..31f157a882 100644 --- a/src/smpi/mpi/smpi_info.cpp +++ b/src/smpi/mpi/smpi_info.cpp @@ -7,8 +7,7 @@ #include "smpi_comm.hpp" #include "simgrid/Exception.hpp" -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { Info::Info(const Info* orig) { @@ -84,5 +83,4 @@ Info* Info::f2c(int id){ return static_cast(F2C::f2c(id)); } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_keyvals.cpp b/src/smpi/mpi/smpi_keyvals.cpp index 2fd3fd0de0..5abfecc84f 100644 --- a/src/smpi/mpi/smpi_keyvals.cpp +++ b/src/smpi/mpi/smpi_keyvals.cpp @@ -7,8 +7,7 @@ #include "smpi_keyvals.hpp" #include "xbt/sysdep.h" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { template <> int Keyval::call_deleter(Comm* obj, const smpi_key_elem& elem, int keyval, void* value, int* /*flag*/) { @@ -47,5 +46,4 @@ int Keyval::call_deleter(Datatype* obj, const smpi_key_elem& elem, int return ret; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_op.cpp b/src/smpi/mpi/smpi_op.cpp index d2e9c50f18..0daff56ba5 100644 --- a/src/smpi/mpi/smpi_op.cpp +++ b/src/smpi/mpi/smpi_op.cpp @@ -260,8 +260,7 @@ CREATE_MPI_OP(MINLOC, minloc_func, DT_FLAG_REDUCTION) CREATE_MPI_OP(REPLACE, replace_func, 0) CREATE_MPI_OP(NO_OP, no_func, 0) -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { void Op::apply(const void* invec, void* inoutvec, const int* len, MPI_Datatype datatype) const { @@ -299,5 +298,4 @@ void Op::unref(MPI_Op* op){ } } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index e52317b4c3..0ceb1a398b 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -36,8 +36,7 @@ std::vector smpi_ois_values; extern std::function smpi_comm_copy_data_callback; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { Request::Request(const void* buf, int count, MPI_Datatype datatype, aid_t src, aid_t dst, int tag, MPI_Comm comm, unsigned flags, MPI_Op op) @@ -1355,5 +1354,4 @@ std::vector Request::get_nbc_requests() const { return nbc_requests_; } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_status.cpp b/src/smpi/mpi/smpi_status.cpp index 0c3a11074f..9c6b765815 100644 --- a/src/smpi/mpi/smpi_status.cpp +++ b/src/smpi/mpi/smpi_status.cpp @@ -7,8 +7,7 @@ #include "private.hpp" #include "smpi_datatype.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { void Status::empty(MPI_Status * status) { @@ -41,5 +40,4 @@ int Status::get_count(const MPI_Status* status, const Datatype* datatype) return status->count / datatype->size(); } -} -} +} // namespace simgrid::smpi diff --git a/src/smpi/mpi/smpi_topo.cpp b/src/smpi/mpi/smpi_topo.cpp index 750f020cca..12ca7eca5f 100644 --- a/src/smpi/mpi/smpi_topo.cpp +++ b/src/smpi/mpi/smpi_topo.cpp @@ -16,8 +16,7 @@ static int assignnodes(int ndim, const std::vector& factors, std::vector& dims); static int getfactors(int num, std::vector& factors); -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { void Topo::setComm(MPI_Comm comm) { @@ -320,8 +319,7 @@ int Topo_Cart::Dims_create(int nnodes, int ndims, int dims[]) return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi /* * assignnodes diff --git a/src/smpi/mpi/smpi_win.cpp b/src/smpi/mpi/smpi_win.cpp index 8eb022d210..c78dc3c18b 100644 --- a/src/smpi/mpi/smpi_win.cpp +++ b/src/smpi/mpi/smpi_win.cpp @@ -35,8 +35,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_rma, smpi, "Logging specific to SMPI (RMA o return MPI_ERR_WIN; \ } -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { std::unordered_map Win::keyvals_; int Win::keyval_id_=0; @@ -684,5 +683,4 @@ void Win::set_errhandler(MPI_Errhandler errhandler) if (errhandler_ != MPI_ERRHANDLER_NULL) errhandler_->ref(); } -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi diff --git a/src/smpi/plugins/ampi/ampi.cpp b/src/smpi/plugins/ampi/ampi.cpp index 78477dc69e..35c981ac31 100644 --- a/src/smpi/plugins/ampi/ampi.cpp +++ b/src/smpi/plugins/ampi/ampi.cpp @@ -80,16 +80,10 @@ extern "C" void* _sampi_realloc(void* ptr, size_t size) return result; } -namespace simgrid { -namespace smpi { -namespace plugin { -namespace ampi { +namespace simgrid::smpi::plugin::ampi { xbt::signal on_iteration_in; xbt::signal on_iteration_out; -} // namespace ampi -} // namespace plugin -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi::plugin::ampi /* FIXME The following contains several times "rank() + 1". This works for one * instance, but we need to find a way to deal with this for several instances and diff --git a/src/smpi/plugins/ampi/ampi.hpp b/src/smpi/plugins/ampi/ampi.hpp index 557855670b..1923d739e1 100644 --- a/src/smpi/plugins/ampi/ampi.hpp +++ b/src/smpi/plugins/ampi/ampi.hpp @@ -8,15 +8,9 @@ #include -namespace simgrid { -namespace smpi { -namespace plugin { -namespace ampi { +namespace simgrid::smpi::plugin::ampi { extern xbt::signal on_iteration_out; extern xbt::signal on_iteration_in; -} // namespace ampi -} // namespace plugin -} // namespace smpi -} // namespace simgrid +} // namespace simgrid::smpi::plugin::ampi #endif diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index 51f7f98366..5e7d0da0e6 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -18,9 +18,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_host, ker_resource, "Host resources agregate * Callbacks *t *************/ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /********* * Model * @@ -240,6 +238,4 @@ void HostImpl::seal() for (auto const& [_, vm] : vms_) vm->seal(); } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/surf/HostImpl.hpp b/src/surf/HostImpl.hpp index d82906db54..610068b153 100644 --- a/src/surf/HostImpl.hpp +++ b/src/surf/HostImpl.hpp @@ -13,9 +13,7 @@ #include -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /********* * Model * *********/ @@ -104,8 +102,6 @@ public: function(actor); } }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* HOST_INTERFACE_HPP */ diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index b2710f590f..8112b6a885 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -53,9 +53,7 @@ void surf_cpu_model_init_Cas01() engine->get_netzone_root()->set_cpu_pm_model(cpu_model_pm); } -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { CpuCas01Model::CpuCas01Model(const std::string& name) : CpuModel(name) { @@ -205,6 +203,4 @@ CpuCas01Action::CpuCas01Action(Model* model, double cost, bool failed, double sp model->get_maxmin_system()->expand(constraint, get_variable(), 1.0); } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/surf/cpu_cas01.hpp b/src/surf/cpu_cas01.hpp index ec8de0964f..94ab188b81 100644 --- a/src/surf/cpu_cas01.hpp +++ b/src/surf/cpu_cas01.hpp @@ -9,9 +9,7 @@ #include "src/kernel/resource/CpuImpl.hpp" #include "xbt/base.h" -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /*********** * Classes * @@ -68,8 +66,6 @@ public: int requested_core() const { return requested_core_; } }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index d5f215358c..6f1121be7f 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -19,9 +19,7 @@ constexpr double EPSILON = 0.000000001; XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cpu_ti, res_cpu, "CPU resource, Trace Integration model"); -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /********* * Trace * @@ -619,6 +617,4 @@ double CpuTiAction::get_remains() return get_remains_no_update(); } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index 16dcd5f3da..c1c72bb82d 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -11,9 +11,7 @@ #include #include -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /*********** * Classes * @@ -152,8 +150,6 @@ public: CpuTiList modified_cpus_; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* SURF_MODEL_CPUTI_HPP_ */ diff --git a/src/surf/disk_s19.cpp b/src/surf/disk_s19.cpp index d1df923827..a6f894faa7 100644 --- a/src/surf/disk_s19.cpp +++ b/src/surf/disk_s19.cpp @@ -27,9 +27,7 @@ void surf_disk_model_init_default() engine->get_netzone_root()->set_disk_model(disk_model); } -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { DiskImpl* DiskS19Model::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth) { @@ -134,6 +132,4 @@ void DiskS19Action::update_remains_lazy(double /*now*/) { THROW_IMPOSSIBLE; } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/surf/disk_s19.hpp b/src/surf/disk_s19.hpp index 414ca8b555..a6413ddb6c 100644 --- a/src/surf/disk_s19.hpp +++ b/src/surf/disk_s19.hpp @@ -10,9 +10,7 @@ #ifndef DISK_S19_HPP_ #define DISK_S19_HPP_ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /*********** * Classes * @@ -59,7 +57,5 @@ public: void update_remains_lazy(double now) override; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* DISK_S19_HPP_ */ diff --git a/src/surf/host_clm03.cpp b/src/surf/host_clm03.cpp index 87e1ec3650..0005ed40b6 100644 --- a/src/surf/host_clm03.cpp +++ b/src/surf/host_clm03.cpp @@ -33,9 +33,7 @@ void surf_host_model_init_compound() engine->get_netzone_root()->set_host_model(host_model); } -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { double HostCLM03Model::next_occurring_event(double /*now*/) { @@ -102,6 +100,4 @@ Action* HostCLM03Model::execute_thread(const s4u::Host* host, double flops_amoun return cpu->execution_start(thread_count * flops_amount, thread_count, -1); } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/surf/host_clm03.hpp b/src/surf/host_clm03.hpp index 7e1a81f899..e972cb7af3 100644 --- a/src/surf/host_clm03.hpp +++ b/src/surf/host_clm03.hpp @@ -12,9 +12,7 @@ * Classes * ***********/ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { class XBT_PRIVATE HostCLM03Model : public HostModel { public: @@ -25,8 +23,6 @@ public: Action* execute_parallel(const std::vector& host_list, const double* flops_amount, const double* bytes_amount, double rate) override; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* HOST_CLM03_HPP_ */ diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index e981df7484..c7f15ec492 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -79,9 +79,7 @@ void surf_network_model_init_CM02() engine->get_netzone_root()->set_network_model(net_model); } -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { NetworkCm02Model::NetworkCm02Model(const std::string& name) : NetworkModel(name) { @@ -580,6 +578,4 @@ void NetworkCm02Action::update_remains_lazy(double now) set_last_value(get_rate()); } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/surf/network_cm02.hpp b/src/surf/network_cm02.hpp index eb93747649..2fb8af7c30 100644 --- a/src/surf/network_cm02.hpp +++ b/src/surf/network_cm02.hpp @@ -17,9 +17,7 @@ * Classes * ***********/ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { class XBT_PRIVATE NetworkCm02Model; class XBT_PRIVATE NetworkCm02Action; @@ -90,7 +88,5 @@ public: using NetworkAction::NetworkAction; void update_remains_lazy(double now) override; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* SURF_NETWORK_CM02_HPP_ */ diff --git a/src/surf/network_constant.cpp b/src/surf/network_constant.cpp index 4f6e486575..c81187484b 100644 --- a/src/surf/network_constant.cpp +++ b/src/surf/network_constant.cpp @@ -23,9 +23,7 @@ void surf_network_model_init_Constant() engine->get_netzone_root()->set_network_model(net_model); } -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { StandardLinkImpl* NetworkConstantModel::create_link(const std::string& name, const std::vector& /*bandwidth*/) { @@ -94,6 +92,4 @@ void NetworkConstantAction::update_remains_lazy(double /*now*/) THROW_IMPOSSIBLE; } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/surf/network_constant.hpp b/src/surf/network_constant.hpp index 5828d69691..229043ac12 100644 --- a/src/surf/network_constant.hpp +++ b/src/surf/network_constant.hpp @@ -8,9 +8,7 @@ #include "src/kernel/resource/NetworkModel.hpp" -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { class NetworkConstantModel : public NetworkModel { public: @@ -29,8 +27,6 @@ public: void update_remains_lazy(double now) override; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* NETWORK_CONSTANT_HPP_ */ diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index a272167e13..0592a7d13a 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -45,9 +45,7 @@ void surf_network_model_init_IB() simgrid::config::set_default("network/weight-S", 8775); } -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { void NetworkIBModel::IB_create_host_callback(s4u::Host const& host) { @@ -205,6 +203,4 @@ void NetworkIBModel::update_IB_factors(NetworkAction* action, IBNode* from, IBNo update_IB_factors_rec(from, updated); XBT_DEBUG("IB - Finished updating %d", from->id_); } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/surf/network_ib.hpp b/src/surf/network_ib.hpp index f130d1c9fd..69b52fc48f 100644 --- a/src/surf/network_ib.hpp +++ b/src/surf/network_ib.hpp @@ -13,9 +13,7 @@ #include #include -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { class XBT_PRIVATE IBNode; @@ -57,7 +55,5 @@ public: static void IB_action_state_changed_callback(NetworkAction& action, Action::State /*previous*/); static void IB_comm_start_callback(const activity::CommImpl& comm); }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 9255c7e6e1..cdef2605df 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -308,8 +308,7 @@ static simgrid::config::Flag ns3_seed( }); namespace simgrid { -namespace kernel { -namespace resource { +namespace kernel::resource { NetworkNS3Model::NetworkNS3Model(const std::string& name) : NetworkModel(name) { @@ -570,8 +569,7 @@ void NetworkNS3Action::update_remains_lazy(double /*now*/) THROW_IMPOSSIBLE; } -} // namespace resource -} // namespace kernel +} // namespace kernel::resource ns3::Ptr get_ns3node_from_sghost(const simgrid::s4u::Host* host) { diff --git a/src/surf/network_ns3.hpp b/src/surf/network_ns3.hpp index 275d45d274..a0328a27f4 100644 --- a/src/surf/network_ns3.hpp +++ b/src/surf/network_ns3.hpp @@ -11,9 +11,7 @@ #include "src/kernel/resource/NetworkModel.hpp" #include "src/kernel/resource/StandardLinkImpl.hpp" -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid ::kernel::resource { class NetworkNS3Model : public NetworkModel { public: @@ -61,8 +59,6 @@ public: double last_sent_ = 0; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* NETWORK_NS3_HPP_ */ diff --git a/src/surf/network_smpi.cpp b/src/surf/network_smpi.cpp index 36c8a857ab..02d6a00d80 100644 --- a/src/surf/network_smpi.cpp +++ b/src/surf/network_smpi.cpp @@ -39,9 +39,7 @@ void surf_network_model_init_SMPI() simgrid::config::set_default("network/weight-S", 8775); } -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { void NetworkSmpiModel::check_lat_factor_cb() { @@ -96,6 +94,4 @@ double NetworkSmpiModel::get_latency_factor(double size) return current; } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/surf/network_smpi.hpp b/src/surf/network_smpi.hpp index cba39f90db..a2c81fddfc 100644 --- a/src/surf/network_smpi.hpp +++ b/src/surf/network_smpi.hpp @@ -11,9 +11,7 @@ #include "network_cm02.hpp" -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { class XBT_PRIVATE NetworkSmpiModel : public NetworkCm02Model { public: @@ -26,8 +24,6 @@ protected: void check_lat_factor_cb() override; void check_bw_factor_cb() override; }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index 88eac8f33b..012f9ef9e8 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -43,9 +43,7 @@ void surf_host_model_init_ptask_L07() engine->get_netzone_root()->set_host_model(host_model); } -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { HostL07Model::HostL07Model(const std::string& name, lmm::System* sys) : HostModel(name) { @@ -446,6 +444,4 @@ void L07Action::updateBound() } } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource diff --git a/src/surf/ptask_L07.hpp b/src/surf/ptask_L07.hpp index 9c0cbf26be..0bb5a46df3 100644 --- a/src/surf/ptask_L07.hpp +++ b/src/surf/ptask_L07.hpp @@ -12,9 +12,7 @@ #ifndef HOST_L07_HPP_ #define HOST_L07_HPP_ -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /*********** * Classes * @@ -163,8 +161,6 @@ public: void update_latency(double delta, double precision) { double_update(&latency_, delta, precision); } }; -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource #endif /* HOST_L07_HPP_ */ diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 57af0e9544..f7f483788a 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -31,13 +31,9 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse); -namespace simgrid { -namespace kernel { -namespace routing { +namespace simgrid::kernel::routing { xbt::signal on_cluster_creation; -} // namespace routing -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::routing static simgrid::kernel::routing::ClusterZoneCreationArgs zone_cluster; /* temporary store data for irregular clusters, created with */ diff --git a/src/surf/xml/platf_private.hpp b/src/surf/xml/platf_private.hpp index ebcf96480c..99b2dd15f8 100644 --- a/src/surf/xml/platf_private.hpp +++ b/src/surf/xml/platf_private.hpp @@ -17,9 +17,7 @@ #include #include -namespace simgrid { -namespace kernel { -namespace routing { +namespace simgrid::kernel::routing { /* ***************************************** */ /* * Platform creation functions. Instead of passing 123 arguments to the creation functions @@ -170,9 +168,7 @@ public: extern XBT_PRIVATE xbt::signal on_cluster_creation; -} // namespace routing -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::routing /********** Routing **********/ void routing_cluster_add_backbone(std::unique_ptr link); diff --git a/src/xbt/OsSemaphore.hpp b/src/xbt/OsSemaphore.hpp index b29a66550d..6582689d69 100644 --- a/src/xbt/OsSemaphore.hpp +++ b/src/xbt/OsSemaphore.hpp @@ -8,8 +8,7 @@ #include #include -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { class XBT_PUBLIC OsSemaphore { public: explicit inline OsSemaphore(unsigned int capa) : capa_(capa) {} @@ -33,5 +32,4 @@ private: std::mutex mutex_; std::condition_variable condition_; }; -} // namespace xbt -} // namespace simgrid +} // namespace simgrid::xbt diff --git a/src/xbt/PropertyHolder.cpp b/src/xbt/PropertyHolder.cpp index bb798c9f90..958daa6782 100644 --- a/src/xbt/PropertyHolder.cpp +++ b/src/xbt/PropertyHolder.cpp @@ -8,8 +8,7 @@ #include #include -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { /** @brief Return the property associated to the provided key (or nullptr if not existing) */ const char* PropertyHolder::get_property(const std::string& key) const @@ -53,5 +52,4 @@ template void PropertyHolder::set_properties(const Assoc& properti template void PropertyHolder::set_properties(const std::map>& properties); template void PropertyHolder::set_properties(const std::unordered_map& properties); -} // namespace xbt -} // namespace simgrid +} // namespace simgrid::xbt diff --git a/src/xbt/backtrace.cpp b/src/xbt/backtrace.cpp index e65124319b..bead6583cc 100644 --- a/src/xbt/backtrace.cpp +++ b/src/xbt/backtrace.cpp @@ -30,8 +30,7 @@ void xbt_backtrace_display_current() simgrid::xbt::Backtrace().display(); } -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { class BacktraceImpl { #if HAVE_BOOST_STACKTRACE_BACKTRACE || HAVE_BOOST_STACKTRACE_ADDR2LINE @@ -83,5 +82,4 @@ void Backtrace::display() const backtrace.empty() ? "(backtrace not set -- did you install Boost.Stacktrace?)" : backtrace.c_str()); } -} // namespace xbt -} // namespace simgrid +} // namespace simgrid::xbt diff --git a/src/xbt/config.cpp b/src/xbt/config.cpp index 08b403bd5c..64c5b99ca2 100644 --- a/src/xbt/config.cpp +++ b/src/xbt/config.cpp @@ -31,8 +31,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support"); XBT_EXPORT_NO_IMPORT xbt_cfg_t simgrid_config = nullptr; -namespace simgrid { -namespace config { +namespace simgrid::config { namespace { @@ -448,8 +447,7 @@ void help() { simgrid_config->help(); } -} -} +} // namespace simgrid::config /*----[ Setting ]---------------------------------------------------------*/ diff --git a/src/xbt/exception.cpp b/src/xbt/exception.cpp index bf5caf1abd..28d1c349c9 100644 --- a/src/xbt/exception.cpp +++ b/src/xbt/exception.cpp @@ -24,8 +24,7 @@ void _xbt_throw(char* message, const char* file, int line, const char* func) throw e; } -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { ImpossibleError::~ImpossibleError() = default; InitializationError::~InitializationError() = default; @@ -129,8 +128,7 @@ void install_exception_handler() }); } -} // namespace xbt -} // namespace simgrid +} // namespace simgrid::xbt void xbt_throw_impossible(const char* file, int line, const char* func) { diff --git a/src/xbt/memory_map.cpp b/src/xbt/memory_map.cpp index b54dce63ed..90e5c5f5d5 100644 --- a/src/xbt/memory_map.cpp +++ b/src/xbt/memory_map.cpp @@ -65,8 +65,7 @@ } else \ ((void)0) -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { /** * \todo This function contains many cases that do not allow for a @@ -419,5 +418,4 @@ std::vector get_memory_map(pid_t pid) return ret; } -} -} +} // namespace simgrid::xbt diff --git a/src/xbt/memory_map.hpp b/src/xbt/memory_map.hpp index d505496422..d85f0b7065 100644 --- a/src/xbt/memory_map.hpp +++ b/src/xbt/memory_map.hpp @@ -11,8 +11,7 @@ #include #include -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { /** An virtual memory map entry from /proc/$pid/maps */ struct VmMap { @@ -28,7 +27,6 @@ struct VmMap { }; std::vector get_memory_map(pid_t pid); -} -} +} // namespace simgrid::xbt #endif diff --git a/src/xbt/random.cpp b/src/xbt/random.cpp index af2cfd45cb..cb53f80c0a 100644 --- a/src/xbt/random.cpp +++ b/src/xbt/random.cpp @@ -15,9 +15,7 @@ XBT_LOG_EXTERNAL_CATEGORY(xbt); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_random, xbt, "Random"); -namespace simgrid { -namespace xbt { -namespace random { +namespace simgrid::xbt::random { bool Random::read_state(const std::string& filename) { @@ -157,6 +155,4 @@ double normal(double mean, double sd) return default_random->normal(mean, sd); } -} // namespace random -} // namespace xbt -} // namespace simgrid +} // namespace simgrid::xbt::random diff --git a/src/xbt/string.cpp b/src/xbt/string.cpp index 45f6348ecd..412b22e097 100644 --- a/src/xbt/string.cpp +++ b/src/xbt/string.cpp @@ -10,8 +10,7 @@ #include #include -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { #if SIMGRID_HAVE_MC @@ -52,5 +51,4 @@ std::string string_printf(const char *fmt, ...) return res; } -} -} +} // namespace simgrid::xbt diff --git a/src/xbt/xbt_main.cpp b/src/xbt/xbt_main.cpp index 41ae101009..065f79a2a2 100644 --- a/src/xbt/xbt_main.cpp +++ b/src/xbt/xbt_main.cpp @@ -35,12 +35,10 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling"); XBT_LOG_NEW_CATEGORY(smpi, "All SMPI categories"); /* lives here even if that's a bit odd to solve linking issues: this is used in xbt_log_file_appender to detect whether SMPI is used (and thus whether we should unbench the writing to disk) */ -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { std::string binary_name; /* Name of the system process containing us (mandatory to retrieve neat backtraces) */ std::vector cmdline; /* all we got in argv */ -} // namespace xbt -} // namespace simgrid +} // namespace simgrid::xbt int xbt_initialized = 0; simgrid::config::Flag cfg_dbg_clean_atexit{ diff --git a/src/xbt/xbt_replay.cpp b/src/xbt/xbt_replay.cpp index 4c10514a8a..d135bb581c 100644 --- a/src/xbt/xbt_replay.cpp +++ b/src/xbt/xbt_replay.cpp @@ -11,8 +11,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(replay,xbt,"Replay trace reader"); -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { static std::ifstream action_fs; @@ -140,8 +139,7 @@ int replay_runner(const char* actor_name, const char* trace_filename) } return 0; } -} -} +} // namespace simgrid::xbt /** * @ingroup XBT_replay