XBT_PUBLIC(void) sg_link_energy_plugin_init();
XBT_PUBLIC(double) sg_link_get_consumed_energy(sg_link_t link);
+XBT_PUBLIC(int) sg_link_energy_is_inited();
+
#define MSG_host_energy_plugin_init() sg_host_energy_plugin_init()
#define MSG_host_get_consumed_energy(host) sg_host_get_consumed_energy(host)
#define MSG_host_get_wattmin_at(host,pstate) sg_host_get_wattmin_at(host,pstate)
#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
#include "src/kernel/routing/NetPoint.hpp"
+#include "simgrid/plugins/energy.h"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/NetZone.hpp"
namespace surf {
NetworkNS3Model::NetworkNS3Model() : NetworkModel() {
+ xbt_assert(not sg_link_energy_is_inited(),
+ "LinkEnergy plugin and NS3 network models are not compatible. Are you looking for Ecofen, maybe?");
+
NetPointNs3::EXTENSION_ID = simgrid::kernel::routing::NetPoint::extension_create<NetPointNs3>();
ns3_initialize(ns3_tcp_model.get().c_str());
}
/* **************************** Public interface *************************** */
SG_BEGIN_DECL()
+int sg_link_energy_is_inited()
+{
+ return LinkEnergy::EXTENSION_ID.valid();
+}
/** \ingroup SURF_plugin_energy
* \brief Enable energy plugin
* \details Enable energy plugin to get joules consumption of each cpu. You should call this function before