Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New functions getWattMinAt and getWattMaxAt
[simgrid.git] / src / simix / popping_bodies.c
index 0f233fe..6f0afee 100644 (file)
@@ -291,6 +291,50 @@ inline static int simcall_BODY_host_get_nb_pstates(smx_host_t host) {
     return self->simcall.result.i;
   }
   
+inline static double simcall_BODY_host_get_wattmin_at(smx_host_t host, int pstate_index) {
+    smx_process_t self = SIMIX_process_self();
+
+    /* Go to that function to follow the code flow through the simcall barrier */
+    if (0) SIMIX_host_get_wattmin_at(host, pstate_index);
+    /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
+
+    self->simcall.call = SIMCALL_HOST_GET_WATTMIN_AT;
+    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
+    memset(self->simcall.args, 0, sizeof(self->simcall.args));
+    self->simcall.args[0].dp = (void*) host;
+    self->simcall.args[1].i = (int) pstate_index;
+    if (self != simix_global->maestro_process) {
+      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
+                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
+      SIMIX_process_yield(self);
+    } else {
+      SIMIX_simcall_handle(&self->simcall, 0);
+    }    
+    return self->simcall.result.d;
+  }
+  
+inline static double simcall_BODY_host_get_wattmax_at(smx_host_t host, int pstate_index) {
+    smx_process_t self = SIMIX_process_self();
+
+    /* Go to that function to follow the code flow through the simcall barrier */
+    if (0) SIMIX_host_get_wattmax_at(host, pstate_index);
+    /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
+
+    self->simcall.call = SIMCALL_HOST_GET_WATTMAX_AT;
+    memset(&self->simcall.result, 0, sizeof(self->simcall.result));
+    memset(self->simcall.args, 0, sizeof(self->simcall.args));
+    self->simcall.args[0].dp = (void*) host;
+    self->simcall.args[1].i = (int) pstate_index;
+    if (self != simix_global->maestro_process) {
+      XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
+                SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
+      SIMIX_process_yield(self);
+    } else {
+      SIMIX_simcall_handle(&self->simcall, 0);
+    }    
+    return self->simcall.result.d;
+  }
+  
 inline static void simcall_BODY_host_set_pstate(smx_host_t host, int pstate_index) {
     smx_process_t self = SIMIX_process_self();