Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Better fix to the comparison between signed and unsigned int around dynar size: chang...
[simgrid.git] / src / simix / smx_global.c
index 311f0ab..c204eca 100644 (file)
@@ -31,7 +31,7 @@ static void simix_cfg_control_set(const char *control_string)
   /* To split the string in commands, and the cursors */
   xbt_dynar_t set_strings;
   char *str;
-  int cpt;
+  unsigned int cpt;
 
   if (!control_string)
     return;
@@ -147,7 +147,7 @@ void SIMIX_display_process_status(void)
 
     asprintf(&who, "%s on %s: %s",
             process->name,
-            p_simdata->s_host->name,
+            p_simdata->smx_host->name,
             (process->simdata->blocked) ? "[BLOCKED] "
             : ((process->simdata->suspended) ? "[SUSPENDED] " : ""));
 
@@ -221,7 +221,7 @@ void __SIMIX_main(void)
       xbt_fifo_foreach(smx_action->cond_list, _cursor, cond, smx_cond_t) {
        xbt_swag_foreach(process, cond->sleeping) {
          DEBUG2("\t preparing to wake up %s on %s",
-                process->name, process->simdata->s_host->name);
+                process->name, process->simdata->smx_host->name);
        }
        SIMIX_cond_broadcast(cond);
        /* remove conditional from action */
@@ -236,7 +236,7 @@ void __SIMIX_main(void)
       xbt_fifo_foreach(smx_action->cond_list, _cursor, cond, smx_cond_t) {
        xbt_swag_foreach(process, cond->sleeping) {
          DEBUG2("\t preparing to wake up %s on %s",
-                process->name, process->simdata->s_host->name);
+                process->name, process->simdata->smx_host->name);
        }
        SIMIX_cond_broadcast(cond);
        /* remove conditional from action */
@@ -323,7 +323,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
 {
 
   smx_process_t process = NULL;
-  int i;
+  unsigned int iter;
   double elapsed_time = 0.0;
   static int state_modifications = 1;
   static int first = 1;
@@ -338,7 +338,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
   }
   while ((process = xbt_swag_extract(simix_global->process_to_run))) {
     DEBUG2("Scheduling %s on %s",
-          process->name, process->simdata->s_host->name);
+          process->name, process->simdata->smx_host->name);
     simix_global->current_process = process;
     xbt_context_schedule(process->simdata->context);
     /*       fflush(NULL); */
@@ -353,11 +353,12 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
     void *fun = NULL;
     void *arg = NULL;
 
-    xbt_dynar_foreach(model_list, i, model) {
+    xbt_dynar_foreach(model_list, iter, model) {
       if (xbt_swag_size(model->common_public->states.failed_action_set)
          || xbt_swag_size(model->common_public->states.
                           done_action_set)) {
        state_modifications = 1;
+        break;
       }
     }
 
@@ -374,7 +375,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
        DEBUG2("Launching %s on %s", args->name, args->hostname);
        process = SIMIX_process_create(args->name, args->code,
                                       args->data, args->hostname,
-                                      args->argc, args->argv);
+                                      args->argc, args->argv, args->properties);
        if (args->kill_time > SIMIX_get_clock()) {
          surf_timer_model->extension_public->set(args->kill_time,
                                                     (void *)
@@ -386,13 +387,13 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
       if (fun == SIMIX_process_kill) {
        process = arg;
        DEBUG2("Killing %s on %s", process->name,
-              process->simdata->s_host->name);
+              process->simdata->smx_host->name);
        SIMIX_process_kill(process);
       }
     }
 
     /* Wake up all process waiting for the action finish */
-    xbt_dynar_foreach(model_list, i, model) {
+    xbt_dynar_foreach(model_list, iter, model) {
       while ((action =
              xbt_swag_extract(model->common_public->states.
                               failed_action_set))) {
@@ -456,7 +457,7 @@ int SIMIX_timer_get(void **function, void **arg)
  *     \param function Create process function
  *
  */
-void SIMIX_function_register_process_create(smx_creation_func_t function)
+void SIMIX_function_register_process_create(smx_creation_func_t function)
 {
   xbt_assert0((simix_global->create_process_function == NULL),
              "Data already set");
@@ -471,7 +472,7 @@ void SIMIX_function_register_process_create(smx_creation_func_t * function)
  *     \param function Kill process function
  *
  */
-void SIMIX_function_register_process_kill(void_f_pvoid_t function)
+void SIMIX_function_register_process_kill(void_f_pvoid_t function)
 {
   xbt_assert0((simix_global->kill_process_function == NULL),
              "Data already set");
@@ -486,7 +487,7 @@ void SIMIX_function_register_process_kill(void_f_pvoid_t * function)
  *     \param function cleanup process function
  *
  */
-void SIMIX_function_register_process_cleanup(void_f_pvoid_t function)
+void SIMIX_function_register_process_cleanup(void_f_pvoid_t function)
 {
   simix_global->cleanup_process_function = function;
 }