From: Martin Quinson Date: Wed, 15 Feb 2017 14:33:21 +0000 (+0100) Subject: Make room for the upcoming network energy plugin X-Git-Tag: v3_15~376^2~6 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d8a58294b59b5660e91410d5c9e5a48e44c67005 Make room for the upcoming network energy plugin --- diff --git a/ChangeLog b/ChangeLog index e74893b955..2af5b4a087 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ SimGrid (3.15) UNRELEASED; urgency=low MSG - New function: MSG_process_yield() + - Renamed MSG_energy_plugin_init() -> MSG_host_energy_plugin_init() + to make room for the upcoming network energy plugin. Java - Ensure that an actor can kill itself with Process::exit() diff --git a/examples/msg/energy-consumption/energy-consumption.c b/examples/msg/energy-consumption/energy-consumption.c index f8985ef64c..00231b6855 100644 --- a/examples/msg/energy-consumption/energy-consumption.c +++ b/examples/msg/energy-consumption/energy-consumption.c @@ -68,7 +68,7 @@ static int dvfs(int argc, char *argv[]) int main(int argc, char *argv[]) { - sg_energy_plugin_init(); + sg_host_energy_plugin_init(); MSG_init(&argc, argv); xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); diff --git a/examples/msg/energy-onoff/energy-onoff.c b/examples/msg/energy-onoff/energy-onoff.c index 98562d5a66..17ae54ad40 100644 --- a/examples/msg/energy-onoff/energy-onoff.c +++ b/examples/msg/energy-onoff/energy-onoff.c @@ -84,7 +84,7 @@ static int onoff(int argc, char *argv[]) { int main(int argc, char *argv[]) { - sg_energy_plugin_init(); + sg_host_energy_plugin_init(); MSG_init(&argc, argv); xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); diff --git a/examples/msg/energy-ptask/energy-ptask.c b/examples/msg/energy-ptask/energy-ptask.c index 3cf07cc8ce..2764151643 100644 --- a/examples/msg/energy-ptask/energy-ptask.c +++ b/examples/msg/energy-ptask/energy-ptask.c @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) xbt_assert(argc >= 2, "2Usage: %s [--energy]", argv[0]); if(argc == 3 && argv[2][2] == 'e') - sg_energy_plugin_init(); + sg_host_energy_plugin_init(); MSG_create_environment(argv[1]); diff --git a/examples/msg/energy-vm/energy-vm.c b/examples/msg/energy-vm/energy-vm.c index c885f51f5c..8a2011dc9f 100644 --- a/examples/msg/energy-vm/energy-vm.c +++ b/examples/msg/energy-vm/energy-vm.c @@ -58,7 +58,7 @@ static int dvfs(int argc, char *argv[]) int main(int argc, char *argv[]) { - sg_energy_plugin_init(); + sg_host_energy_plugin_init(); MSG_init(&argc, argv); xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); diff --git a/include/simgrid/plugins/energy.h b/include/simgrid/plugins/energy.h index f21799fe10..06d1de8fd4 100644 --- a/include/simgrid/plugins/energy.h +++ b/include/simgrid/plugins/energy.h @@ -12,12 +12,12 @@ SG_BEGIN_DECL() -XBT_PUBLIC(void) sg_energy_plugin_init(); +XBT_PUBLIC(void) sg_host_energy_plugin_init(); XBT_PUBLIC(double) sg_host_get_consumed_energy(sg_host_t host); XBT_PUBLIC(double) sg_host_get_wattmin_at(sg_host_t host, int pstate); XBT_PUBLIC(double) sg_host_get_wattmax_at(sg_host_t host, int pstate); -#define MSG_energy_plugin_init() sg_energy_plugin_init() +#define MSG_host_energy_plugin_init() sg_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) #define MSG_host_get_wattmax_at(host,pstate) sg_host_get_wattmax_at(host,pstate) diff --git a/src/bindings/java/jmsg.cpp b/src/bindings/java/jmsg.cpp index 7e536dea77..819951bb48 100644 --- a/src/bindings/java/jmsg.cpp +++ b/src/bindings/java/jmsg.cpp @@ -258,7 +258,7 @@ Java_org_simgrid_msg_Msg_deployApplication(JNIEnv * env, jclass cls, jstring jde SG_END_DECL() JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit() { - sg_energy_plugin_init(); + sg_host_energy_plugin_init(); } /** Run a Java org.simgrid.msg.Process diff --git a/src/surf/plugins/energy.cpp b/src/surf/plugins/energy.cpp index 97e99fd02c..c063cd3172 100644 --- a/src/surf/plugins/energy.cpp +++ b/src/surf/plugins/energy.cpp @@ -277,7 +277,7 @@ static void onHostDestruction(simgrid::s4u::Host& host) { * \brief Enable energy plugin * \details Enable energy plugin to get joules consumption of each cpu. You should call this function before #MSG_init(). */ -void sg_energy_plugin_init() +void sg_host_energy_plugin_init() { if (HostEnergy::EXTENSION_ID.valid()) return; diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 3a37bcc055..7db2906da7 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -46,8 +46,8 @@ simgrid::xbt::signal surfExitCallbacks; #include // FIXME: this plugin should not be linked to the core s_surf_model_description_t surf_plugin_description[] = { - {"Energy", "Cpu energy consumption.", &sg_energy_plugin_init}, - {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */ + {"Energy", "Cpu energy consumption.", &sg_host_energy_plugin_init}, + {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */ }; /* Don't forget to update the option description in smx_config when you change this */