Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add extra argument "priority" to SIMIX_req_host_execute.
authorcristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 27 Jan 2011 13:59:24 +0000 (13:59 +0000)
committercristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 27 Jan 2011 13:59:24 +0000 (13:59 +0000)
This avoids a second request to set it right afterwards.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9518 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/simix/simix.h
src/gras/Virtu/sg_emul.c
src/msg/gos.c
src/simix/host_private.h
src/simix/smurf_private.h
src/simix/smx_host.c
src/simix/smx_smurf.c
src/simix/smx_user.c
src/smpi/smpi_bench.c

index d73f296..a64306c 100644 (file)
@@ -98,7 +98,8 @@ XBT_PUBLIC(void *) SIMIX_req_host_get_data(smx_host_t host);
 XBT_PUBLIC(void) SIMIX_req_host_set_data(smx_host_t host, void *data);
 
 XBT_PUBLIC(smx_action_t) SIMIX_req_host_execute(const char *name, smx_host_t host,
-                                            double computation_amount);
+                                                double computation_amount,
+                                                double priority);
 XBT_PUBLIC(smx_action_t) SIMIX_req_host_parallel_execute(const char *name,
                                                      int host_nb,
                                                      smx_host_t *host_list,
index 62be7c2..4729c35 100644 (file)
@@ -23,7 +23,7 @@ void gras_cpu_burn(double flops)
   smx_action_t execution;
 
   if (flops > 0){
-    execution = SIMIX_req_host_execute("task", SIMIX_host_self(), flops);
+    execution = SIMIX_req_host_execute("task", SIMIX_host_self(), flops, 1);
     SIMIX_req_host_execution_wait(execution);
   }
 }
index e281bf7..75aa084 100644 (file)
@@ -64,8 +64,8 @@ MSG_error_t MSG_task_execute(m_task_t task)
   simdata->isused=1;
   simdata->compute =
       SIMIX_req_host_execute(task->name, SIMIX_host_self(),
-                           simdata->computation_amount);
-  SIMIX_req_host_execution_set_priority(simdata->compute, simdata->priority);
+                           simdata->computation_amount,
+                           simdata->priority);
 #ifdef HAVE_TRACING
   SIMIX_req_set_category(simdata->compute, task->category);
 #endif
index ad5332d..84a315c 100644 (file)
@@ -27,7 +27,7 @@ double SIMIX_host_get_speed(smx_host_t host);
 double SIMIX_host_get_available_speed(smx_host_t host);
 int SIMIX_host_get_state(smx_host_t host);
 smx_action_t SIMIX_host_execute(const char *name,
-    smx_host_t host, double computation_amount);
+    smx_host_t host, double computation_amount, double priority);
 smx_action_t SIMIX_host_parallel_execute(const char *name,
     int host_nb, smx_host_t *host_list,
     double *computation_amount, double *communication_amount,
index 0a0bcd8..59fcf28 100644 (file)
@@ -169,6 +169,7 @@ typedef struct s_smx_req {
       const char* name;
       smx_host_t host;
       double computation_amount;
+      double priority;
       smx_action_t result;
     } host_execute;
 
index 205c46b..65afb4f 100644 (file)
@@ -178,7 +178,8 @@ void SIMIX_host_set_data(smx_host_t host, void *data)
 }
 
 smx_action_t SIMIX_host_execute(const char *name, smx_host_t host,
-                                double computation_amount)
+                                double computation_amount,
+                                double priority)
 {
   /* alloc structures and initialize */
   smx_action_t action = xbt_new0(s_smx_action_t, 1);
@@ -198,6 +199,7 @@ smx_action_t SIMIX_host_execute(const char *name, smx_host_t host,
       surf_workstation_model->extension.workstation.execute(host->host,
          computation_amount);
     surf_workstation_model->action_data_set(action->execution.surf_exec, action);
+    surf_workstation_model->set_priority(action->execution.surf_exec, priority);
   }
 
 #ifdef HAVE_TRACING
index 7ed0ac1..da3f652 100644 (file)
@@ -268,7 +268,8 @@ void SIMIX_request_pre(smx_req_t req, int value)
       req->host_execute.result = SIMIX_host_execute(
          req->host_execute.name,
          req->host_execute.host,
-         req->host_execute.computation_amount);
+         req->host_execute.computation_amount,
+         req->host_execute.priority);
       SIMIX_request_answer(req);
       break;
 
index 1b75a46..163a7d4 100644 (file)
@@ -150,7 +150,8 @@ void SIMIX_req_host_set_data(smx_host_t host, void *data)
  * \return A new SIMIX execution action
  */
 smx_action_t SIMIX_req_host_execute(const char *name, smx_host_t host,
-                                double computation_amount)
+                                    double computation_amount,
+                                    double priority)
 {
   smx_req_t req = SIMIX_req_mine();
 
@@ -158,6 +159,7 @@ smx_action_t SIMIX_req_host_execute(const char *name, smx_host_t host,
   req->host_execute.name = name;
   req->host_execute.host = host;
   req->host_execute.computation_amount = computation_amount;
+  req->host_execute.priority = priority;
   SIMIX_request_push();
   return req->host_execute.result;
 }
index 084123b..ae6c88c 100644 (file)
@@ -48,7 +48,7 @@ static void smpi_execute_flops(double flops)
   host = SIMIX_host_self();
 
   DEBUG1("Handle real computation time: %f flops", flops);
-  action = SIMIX_req_host_execute("computation", host, flops);
+  action = SIMIX_req_host_execute("computation", host, flops, 1);
 #ifdef HAVE_TRACING
   SIMIX_req_set_category (action, TRACE_internal_smpi_get_category());
 #endif