Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[MSG] Renaming MSG_get_host_speed in MSG_host_get_speed. No function should be ostrac...
authorJulien Gossa <julien.gossa@unistra.fr>
Fri, 4 Mar 2016 18:31:24 +0000 (19:31 +0100)
committerJulien Gossa <julien.gossa@unistra.fr>
Fri, 4 Mar 2016 18:31:24 +0000 (19:31 +0100)
examples/msg/cloud/bound.c
examples/msg/cloud/multicore.c
examples/msg/properties/msg_prop.c
include/simgrid/msg.h
src/bindings/java/jmsg_host.cpp
src/msg/msg_host.cpp
src/msg/msg_vm.cpp

index 06a059b..ffb7387 100644 (file)
@@ -96,7 +96,7 @@ static void test_dynamic_change(void)
   double task1_remain_prev = MSG_task_get_flops_amount(task1);
 
   {
-    const double cpu_speed = MSG_get_host_speed(pm0);
+    const double cpu_speed = MSG_host_get_speed(pm0);
     int i = 0;
     for (i = 0; i < 10; i++) {
       double new_bound = (cpu_speed / 10) * i;
@@ -129,7 +129,7 @@ static void test_dynamic_change(void)
 
 static void test_one_task(msg_host_t hostA)
 {
-  const double cpu_speed = MSG_get_host_speed(hostA);
+  const double cpu_speed = MSG_host_get_speed(hostA);
   const double computation_amount = cpu_speed * 10;
   const char *hostA_name = MSG_host_get_name(hostA);
 
@@ -174,8 +174,8 @@ static void test_one_task(msg_host_t hostA)
 
 static void test_two_tasks(msg_host_t hostA, msg_host_t hostB)
 {
-  const double cpu_speed = MSG_get_host_speed(hostA);
-  xbt_assert(cpu_speed == MSG_get_host_speed(hostB));
+  const double cpu_speed = MSG_host_get_speed(hostA);
+  xbt_assert(cpu_speed == MSG_host_get_speed(hostB));
   const double computation_amount = cpu_speed * 10;
   const char *hostA_name = MSG_host_get_name(hostA);
   const char *hostB_name = MSG_host_get_name(hostB);
@@ -288,7 +288,7 @@ static int master_main(int argc, char *argv[])
 
   {
     msg_host_t vm0 = MSG_vm_create_core(pm0, "VM0");
-    const double cpu_speed = MSG_get_host_speed(pm0);
+    const double cpu_speed = MSG_host_get_speed(pm0);
     MSG_vm_set_bound(vm0, cpu_speed / 10);
     MSG_vm_start(vm0);
 
@@ -317,7 +317,7 @@ static int master_main(int argc, char *argv[])
     MSG_host_set_params(vm0, &params);
     MSG_vm_start(vm0);
 
-    const double cpu_speed = MSG_get_host_speed(pm0);
+    const double cpu_speed = MSG_host_get_speed(pm0);
     MSG_vm_start(vm0);
 
     XBT_INFO("# 10. Test migration");
index 32229cf..c8ad9f6 100644 (file)
@@ -335,11 +335,11 @@ int main(int argc, char *argv[])
   msg_host_t pm2 = xbt_dynar_get_as(hosts_dynar, 2, msg_host_t);
 
   XBT_INFO("%s: %d core(s), %f flops/s per each", MSG_host_get_name(pm0), MSG_host_get_core_number(pm0),
-           MSG_get_host_speed(pm0));
+           MSG_host_get_speed(pm0));
   XBT_INFO("%s: %d core(s), %f flops/s per each", MSG_host_get_name(pm1), MSG_host_get_core_number(pm1),
-           MSG_get_host_speed(pm1));
+           MSG_host_get_speed(pm1));
   XBT_INFO("%s: %d core(s), %f flops/s per each", MSG_host_get_name(pm2), MSG_host_get_core_number(pm2),
-           MSG_get_host_speed(pm2));
+           MSG_host_get_speed(pm2));
 
   MSG_process_create("master", master_main, NULL, pm0);
 
index 8e05705..caae47f 100644 (file)
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
   hosts = MSG_hosts_as_dynar();
 
   xbt_dynar_foreach(hosts, i, host){
-    XBT_INFO("Host '%s' runs at %.0f flops/s",MSG_host_get_name(host), MSG_get_host_speed(host));
+    XBT_INFO("Host '%s' runs at %.0f flops/s",MSG_host_get_name(host), MSG_host_get_speed(host));
   }
 
   MSG_launch_application(argv[2]);
index c1a2cf3..562f659 100644 (file)
@@ -284,12 +284,16 @@ XBT_PUBLIC(void *) MSG_host_get_data(msg_host_t host);
 XBT_PUBLIC(void) MSG_host_on(msg_host_t host);
 XBT_PUBLIC(void) MSG_host_off(msg_host_t host);
 XBT_PUBLIC(msg_host_t) MSG_host_self(void);
-XBT_PUBLIC(double) MSG_get_host_speed(msg_host_t h);
+XBT_PUBLIC(double) MSG_host_get_speed(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_get_core_number(msg_host_t h);
 XBT_PUBLIC(xbt_swag_t) MSG_host_get_process_list(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_is_on(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_is_off(msg_host_t h);
 
+// deprecated
+XBT_PUBLIC(double) MSG_get_host_speed(msg_host_t h);
+
+
 XBT_PUBLIC(double) MSG_host_get_power_peak_at(msg_host_t h, int pstate);
 XBT_PUBLIC(double) MSG_host_get_current_power_peak(msg_host_t h);
 XBT_PUBLIC(int)    MSG_host_get_nb_pstates(msg_host_t h);
index dba26b2..98e5094 100644 (file)
@@ -186,7 +186,7 @@ Java_org_simgrid_msg_Host_getSpeed(JNIEnv * env,
     return -1;
   }
 
-  return (jdouble) MSG_get_host_speed(host);
+  return (jdouble) MSG_host_get_speed(host);
 }
 
 JNIEXPORT jdouble JNICALL
index feb4f97..c5e8a47 100644 (file)
@@ -146,10 +146,20 @@ xbt_dynar_t MSG_hosts_as_dynar(void) {
 /** \ingroup m_host_management
  * \brief Return the speed of the processor (in flop/s), regardless of the current load on the machine.
  */
-double MSG_get_host_speed(msg_host_t host) {
+double MSG_host_get_speed(msg_host_t host) {
   return host->speed();
 }
 
+/** \ingroup m_host_management
+ * \brief Return the speed of the processor (in flop/s), regardless of the current load on the machine.
+ * Deprecated: use MSG_host_get_speed
+ */
+double MSG_get_host_speed(msg_host_t host) {
+  XBT_WARN("MSG_get_host_speed is deprecated: use MSG_host_get_speed");
+  return MSG_host_get_speed(host);
+}
+
+
 /** \ingroup m_host_management
  * \brief Return the number of cores.
  *
index dd1747e..2e11d89 100644 (file)
@@ -180,7 +180,7 @@ msg_vm_t MSG_vm_create(msg_host_t pm, const char *name,
 {
   /* For the moment, intensity_rate is the percentage against the migration
    * bandwidth */
-  double host_speed = MSG_get_host_speed(pm);
+  double host_speed = MSG_host_get_speed(pm);
   double update_speed = ((double)dp_intensity/100) * mig_netspeed;
 
   msg_vm_t vm = MSG_vm_create_core(pm, name);