#include <set>
#include <string>
-namespace simgrid {
-namespace instr {
+namespace simgrid::instr {
/* User-variables related functions*/
/* for host variables */
XBT_PUBLIC void declare_host_variable(const std::string& variable, const std::string& color = "");
XBT_PUBLIC void platform_graph_export_graphviz(const std::string& output_filename);
/* Function used by graphicator (transform a SimGrid platform file in a CSV file with the network topology) */
XBT_PUBLIC void platform_graph_export_csv(const std::string& output_filename);
-} // namespace instr
-} // namespace simgrid
+} // namespace simgrid::instr
#endif
SG_BEGIN_DECL
#include <simgrid/forward.h>
#include <functional>
-namespace simgrid {
-namespace kernel {
-namespace profile {
-
+namespace simgrid::kernel::profile {
/** @brief Modeling of the availability profile (due to an external load) or the churn
*
static Profile* from_callback(const std::string& name, const std::function<UpdateCb>& cb, double repeat_delay);
};
-} // namespace profile
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::profile
#endif /* SIMGRID_KERNEL_PROFILEBUILDER_HPP */
#include <boost/heap/fibonacci_heap.hpp>
-namespace simgrid {
-namespace kernel {
-namespace timer {
+namespace simgrid::kernel::timer {
inline auto& kernel_timers() // avoid static initialization order fiasco
{
static bool execute_all();
};
-} // namespace timer
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::timer
#endif /* SRC_KERNEL_TIMER_TIMER_HPP_ */
static constexpr double NO_MAX_DURATION = -1.0;
-namespace simgrid {
-namespace kernel {
-namespace resource {
+namespace simgrid::kernel::resource {
using heap_element_type = std::pair<double, Action*>;
using heap_type =
void set_suspend_state(Action::SuspendStates state) { suspended_ = state; }
};
-} // namespace resource
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::resource
#endif
#include <simgrid/kernel/resource/Action.hpp>
#include <unordered_map>
-namespace simgrid {
-namespace kernel {
-namespace resource {
+namespace simgrid::kernel::resource {
class XBT_PUBLIC Model {
public:
ActionHeap action_heap_;
};
-} // namespace resource
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::resource
#endif
#include <unordered_map>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
/**
* @brief Placeholder for old ClusterZone class
return node_pos_with_loopback(id) + (has_limiter_ ? 1 : 0);
}
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif /* SIMGRID_ROUTING_CLUSTER_HPP_ */
#include <simgrid/kernel/routing/RoutedZone.hpp>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
/** @ingroup ROUTING_API
* @brief NetZone with an explicit routing computed on need with Dijkstra
void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
const std::vector<s4u::LinkInRoute>& link_list, bool symmetrical) override;
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif /* SIMGRID_ROUTING_DIJKSTRA_HPP_ */
#include <simgrid/kernel/routing/ClusterZone.hpp>
#include <simgrid/s4u/Link.hpp>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
class DragonflyRouter {
public:
unsigned int num_links_per_link_ = 1; // splitduplex -> 2, only for local link
std::vector<DragonflyRouter> routers_;
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif
#include <simgrid/kernel/routing/NetZoneImpl.hpp>
#include <xbt/asserts.h>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
/** @ingroup ROUTING_API
* @brief NetZone with no routing, useful with the constant network model
void get_graph(const s_xbt_graph_t* graph, std::map<std::string, xbt_node_t, std::less<>>* /*nodes*/,
std::map<std::string, xbt_edge_t, std::less<>>* /*edges*/) override;
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif /* SIMGRID_ROUTING_NONE_HPP_ */
#include <simgrid/kernel/routing/ClusterZone.hpp>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
class XBT_PRIVATE FatTreeLink;
void build_upper_levels(const s4u::ClusterCallbacks& set_callbacks);
void generate_dot_file(const std::string& filename = "fat_tree.dot") const;
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif
#include <simgrid/kernel/routing/RoutedZone.hpp>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
/** @ingroup ROUTING_API
* @brief NetZone with an explicit routing computed at initialization with Floyd-Warshal
void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
const std::vector<s4u::LinkInRoute>& link_list, bool symmetrical) override;
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif /* SIMGRID_ROUTING_FLOYD_HPP_ */
#include <simgrid/kernel/routing/RoutedZone.hpp>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
/** @ingroup ROUTING_API
* @brief NetZone with an explicit routing provided by the user
void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
const std::vector<s4u::LinkInRoute>& link_list, bool symmetrical) override;
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif /* SIMGRID_ROUTING_FULL_HPP_ */
extern template class XBT_PUBLIC xbt::Extendable<kernel::routing::NetPoint>;
-namespace kernel {
-namespace routing {
+namespace kernel::routing {
/** @ingroup ROUTING_API
* @brief Network cards are the vertices in the graph representing the network, used to compute paths between nodes.
NetPoint::Type component_type_;
NetZoneImpl* englobing_zone_ = nullptr;
};
-} // namespace routing
-} // namespace kernel
+} // namespace kernel::routing
} // namespace simgrid
XBT_PUBLIC simgrid::kernel::routing::NetPoint* sg_netpoint_by_name_or_null(const char* name);
#include <unordered_set>
#include <vector>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
class Route {
public:
virtual resource::StandardLinkImpl* do_create_link(const std::string& name, const std::vector<double>& bandwidths);
void add_child(NetZoneImpl* new_zone);
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif /* SIMGRID_ROUTING_NETZONEIMPL_HPP */
#include <simgrid/kernel/routing/NetZoneImpl.hpp>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
/** @ingroup ROUTING_API
* @brief NetZone with an explicit routing (abstract class)
void add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
const std::vector<s4u::LinkInRoute>& link_list, bool symmetrical) const;
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif /* SIMGRID_ROUTING_GENERIC_HPP_ */
#include <unordered_map>
#include <unordered_set>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
/** @ingroup ROUTING_API
* @brief NetZone where components are connected following a star topology
bool symmetrical) const;
std::unordered_map<unsigned long, StarRoute> routes_;
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif /* SIMGRID_KERNEL_ROUTING_STARZONE_HPP_ */
#include <vector>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
/** @ingroup ROUTING_API
* @brief NetZone using a Torus topology
static std::vector<unsigned long> parse_topo_parameters(const std::string& topo_parameters);
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif
#include <simgrid/kernel/routing/StarZone.hpp>
#include <xbt/Extendable.hpp>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
/** @ingroup ROUTING_API
* @brief NetZone modeling peers connected to the cloud through a private link
std::vector<double> coords;
};
} // namespace vivaldi
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif /* SIMGRID_ROUTING_VIVALDI_HPP_ */
#include <simgrid/kernel/routing/RoutedZone.hpp>
-namespace simgrid {
-namespace kernel {
-namespace routing {
+namespace simgrid::kernel::routing {
/** @ingroup ROUTING_API
* @brief NetZone modeling a Wifi zone
void get_local_route(const NetPoint* src, const NetPoint* dst, Route* into, double* latency) override;
NetPoint* get_access_point() const { return access_point_; }
};
-} // namespace routing
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::routing
#endif /* SIMGRID_ROUTING_WIFI_HPP_ */
/** Stock implementation of a generic monitored queue to solve the producer-consumer problem */
-namespace simgrid {
-namespace plugin {
+namespace simgrid::plugin {
template <typename T> class ProducerConsumer;
template <typename T> using ProducerConsumerPtr = boost::intrusive_ptr<ProducerConsumer<T>>;
}
};
-} // namespace plugin
-} // namespace simgrid
+} // namespace simgrid::plugin
#endif // SIMGRID_PLUGIN_PRODUCERCONSUMER_HPP
#include <atomic>
#include <future>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
class XBT_PUBLIC Barrier {
kernel::activity::BarrierImpl* pimpl_;
friend XBT_PUBLIC void intrusive_ptr_release(Barrier* barrier);
#endif
};
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif
#include <string>
#include <vector>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** @brief Communication async
*
* Represents all asynchronous communications, that you can test or wait onto.
* occurs). */
static size_t wait_all_for(const std::vector<CommPtr>& comms, double timeout);
};
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_COMM_HPP */
#include <future>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/**
* @beginrst
void notify_all();
};
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif
#include <utility>
#include <vector>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** @brief Simulation engine
*
* This is a singleton containing all the main functions of the simulation.
}
}
#endif
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_ENGINE_HPP */
#include <simgrid/s4u/Actor.hpp>
#include <xbt/ex.h>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** Computation Activity, representing the asynchronous executions.
*
bool is_assigned() const override;
};
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_EXEC_HPP */
#include <string>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** I/O Activity, representing the asynchronous disk access.
*
bool is_assigned() const override;
};
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_IO_HPP */
#include <memory>
#include <string>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** @brief Mailboxes: Network rendez-vous points. */
class XBT_PUBLIC Mailbox {
get_async<T>(&res)->wait_for(timeout);
return res;
}
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_MAILBOX_HPP */
#include <simgrid/forward.h>
#include <xbt/asserts.h>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** @brief A classical mutex, but blocking in the simulation world.
*
bool try_lock();
};
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_MUTEX_HPP */
#include <utility>
#include <vector>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** @brief Networking Zones
*
const DragonflyParams& parameters, const ClusterCallbacks& set_callbacks,
double bandwidth, double latency, Link::SharingPolicy sharing_policy);
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_NETZONE_HPP */
#include <simgrid/forward.h>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** @brief A classical semaphore, but blocking in the simulation world
*
bool would_block() const;
};
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_SEMAPHORE_HPP */
#include <simgrid/s4u/Host.hpp>
#include <xbt/utility.hpp>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** @brief Host extension for the VMs */
class VmHostExt {
on_migration_end.connect(cb);
}
};
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif
XBT_PUBLIC void simcall_run_object_access(std::function<void()> const& code,
simgrid::kernel::actor::ObjectAccessSimcallItem* item);
-namespace simgrid {
-namespace kernel {
-namespace actor {
+namespace simgrid::kernel::actor {
/** Execute some code in kernel context on behalf of the user code.
*
simcall_blocking(std::forward<F>(code), static_cast<SimcallObserver*>(observer));
return observer->get_result();
}
-// compact namespaces are C++17 and this is a public header file so let's stick to C++14
-} // namespace actor
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::actor
#endif
#ifdef __cplusplus
#include <boost/intrusive_ptr.hpp>
-namespace simgrid {
-namespace smpi {
+namespace simgrid::smpi {
class Colls;
class Comm;
class Topo_Dist_Graph;
class Win;
-}
-}
+} // namespace simgrid::smpi
using SMPI_Comm = simgrid::smpi::Comm;
using SMPI_Datatype = simgrid::smpi::Datatype;
#include <limits>
#include <vector>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
template<class T, class U> class Extension;
template<class T> class Extendable;
// Initialized with a first element, to save space for void* user data
template <class T> std::vector<std::function<void(void*)>> Extendable<T>::deleters_{1};
-}
-}
+} // namespace simgrid::xbt
#endif
#include <string>
#include <unordered_map>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
/** @brief a PropertyHolder can be given a set of textual properties
*
template <class Assoc> void set_properties(const Assoc& properties);
};
-} // namespace xbt
-} // namespace simgrid
+} // namespace simgrid::xbt
#endif
#include <xbt/automaton.h>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
/** Add a proposition to an automaton (the C++ way)
*
a, id, [](auto* cb) -> int { return (*(F*)cb)(); }, callback, [](auto* cb) -> void { delete (F*)cb; });
}
-}
-}
+} // namespace simgrid::xbt
#endif
XBT_PUBLIC void xbt_backtrace_display_current();
SG_END_DECL
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
class BacktraceImpl;
/** A backtrace
void display() const;
};
-}
-}
+} // namespace simgrid::xbt
#endif
#include <xbt/sysdep.h>
#include <xbt/utility.hpp>
-namespace simgrid {
-namespace config {
+namespace simgrid::config {
class Config;
XBT_PUBLIC void show_aliases();
XBT_PUBLIC void help();
-} // namespace config
-} // namespace simgrid
+} // namespace simgrid::config
#endif
#include <vector>
#include <xbt/base.h>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
void path_push(std::string const& str);
void path_pop();
private:
std::string path_;
};
-}}
+} // namespace simgrid::xbt
#endif /* XBT_FILE_HPP */
#include <utility>
#include <vector>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
template <class F> class MainFunction {
F code_;
return Task<decltype(code(std::move(args)...))()>(std::move(task));
}
-} // namespace xbt
-} // namespace simgrid
+} // namespace simgrid::xbt
#endif
#include <simgrid/Exception.hpp>
#include <xbt/log.h>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
/** Display information about an exception
*
XBT_PUBLIC void install_exception_handler();
-} // namespace xbt
-} // namespace simgrid
+} // namespace simgrid::xbt
-#endif
\ No newline at end of file
+#endif
#include <utility>
#include <xbt/ex.h>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
/** A value or an exception (or nothing)
*
{
fulfill_promise(promise, [&future] { return std::forward<F>(future).get(); });
}
-}
-}
+} // namespace simgrid::xbt
#endif
#include <random>
#include <string>
-namespace simgrid {
-namespace xbt {
-namespace random {
+namespace simgrid::xbt::random {
/** A random number generator.
*
* @param sd Standard deviation of the normal distribution
*/
double normal(double mean, double sd);
-} // namespace random
-} // namespace xbt
-} // namespace simgrid
+} // namespace simgrid::xbt::random
#endif
#include <algorithm>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
/** Describes a contiguous inclusive-exclusive [a,b) range of values */
template<class T> class Range {
bool contain(T const& x) const { return begin_ <= x && end_ > x; }
};
-}
-}
+} // namespace simgrid::xbt
#endif
#include <queue>
#include <unordered_map>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
/* To split the file if a unique one is given (specific variable for the other case live in runner()) */
using ReplayAction = std::vector<std::string>;
* xbt_replay_set_tracefile(). If trace_filename is not nullptr, then it's not shared and this trace file is for this
* actor only */
XBT_PUBLIC int replay_runner(const char* actor_name, const char* trace_filename = nullptr);
-}
-}
+} // namespace simgrid::xbt
using action_fun = std::function<void(simgrid::xbt::ReplayAction&)>;
XBT_PUBLIC void xbt_replay_action_register(const char* action_name, const action_fun& function);
#include <map>
#include <utility>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
template <class S> class signal;
/** Remove all callbacks */
void disconnect_slots() { handlers_.clear(); }
};
-}
-}
+} // namespace simgrid::xbt
#endif
#include <cstdlib>
#include <string>
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
/** Create a C++ string from a C-style format
*
*/
XBT_PUBLIC std::string string_vprintf(const char* fmt, va_list ap) XBT_ATTRIB_PRINTF(1, 0);
-} // namespace xbt
-}
-#endif
\ No newline at end of file
+} // namespace simgrid::xbt
+#endif
#ifndef SIMGRID_MC_SYSTEM_ERROR_HPP
#define SIMGRID_MC_SYSTEM_ERROR_HPP
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
/** A `error_category` suitable to be used with `errno`
*
return std::system_error(errno_code(), what);
}
-}
-}
+} // namespace simgrid::xbt
#endif
} \
enum class EnumType { __VA_ARGS__ } /* defined here to handle trailing semicolon */
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
/** @brief Replacement for C++20's std::type_identity_t
*/
list.erase(list.iterator_to(elem));
}
-} // namespace xbt
-} // namespace simgrid
+} // namespace simgrid::xbt
#endif
#include "src/kernel/resource/NetworkModel.hpp"
#include "src/kernel/resource/StandardLinkImpl.hpp"
-namespace simgrid ::kernel::resource {
+namespace simgrid::kernel::resource {
class NetworkNS3Model : public NetworkModel {
public:
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_torus, ker_platform, "Kernel Torus Routing");
namespace simgrid {
-namespace kernel ::routing {
+namespace kernel::routing {
void TorusZone::create_torus_links(unsigned long id, int rank, unsigned long position)
{