/** @brief Check if the Link is used (at least one flow uses the link) */
bool is_used() const;
+ /** @brief Check if the Link is shared (not a FATPIPE) */
+ bool is_shared() const;
+
void turn_on();
bool is_on() const;
void turn_off();
return this->pimpl_->is_used();
}
+bool Link::is_shared() const
+{
+ return this->pimpl_->get_sharing_policy() != SharingPolicy::FATPIPE;
+}
+
double Link::get_latency() const
{
return this->pimpl_->get_latency();
int sg_link_is_shared(const_sg_link_t link)
{
- return link->get_sharing_policy() != simgrid::s4u::Link::SharingPolicy::FATPIPE;
+ return link->is_shared();
}
double sg_link_get_bandwidth(const_sg_link_t link)
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
+#include "simgrid/s4u/Link.hpp"
#include "src/surf/network_interface.hpp"
#include <algorithm>
std::printf(" <link id=\"");
std::printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"", link->get_cname(), link->get_bandwidth(), link->get_latency());
- if (sg_link_is_shared(link)) {
+ if (link->is_shared()) {
std::printf("/>\n");
} else {
std::printf(" sharing_policy=\"FATPIPE\"/>\n");