Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorSamuel Lepetit <samuel.lepetit@inria.fr>
Wed, 9 May 2012 15:30:29 +0000 (17:30 +0200)
committerSamuel Lepetit <samuel.lepetit@inria.fr>
Wed, 9 May 2012 15:30:29 +0000 (17:30 +0200)
buildtools/Cmake/simgrid.nsi.in
doc/webcruft/SGicon.gif [new file with mode: 0644]
doc/webcruft/SGicon.ico [new file with mode: 0644]
doc/webcruft/SimGrid_2010.ico [moved from doc/webcruft/SimGrid.ico with 100% similarity]
doc/webcruft/simgrid_logo_2010.png [moved from doc/webcruft/simgrid_logo.png with 100% similarity]
src/simix/smx_process.c
src/simix/smx_smurf.c
src/surf/network.c
src/xbt/heap.c
src/xbt/heap_private.h
src/xbt/log.c

index a5c4f84..7407773 100644 (file)
@@ -28,7 +28,7 @@
 \r
 Name "Simgrid"\r
 outFile "SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@_SGjava_@NSIS_WIN_VERSION@@BIN_EXE@"\r
-Icon "@CMAKE_HOME_DIRECTORY@\doc\webcruft\SimGrid.ico"\r
+Icon "@CMAKE_HOME_DIRECTORY@\doc\webcruft\SGicon.ico"\r
 \r
 RequestExecutionLevel admin\r
 \r
@@ -97,12 +97,15 @@ Section "Libraries and Headers" LibSection
        file @CMAKE_HOME_DIRECTORY@\include\xbt\automaton.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\automatonparse_promela.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\datadesc.h\r
+       file @CMAKE_HOME_DIRECTORY@\include\xbt\socket.h\r
+       file @CMAKE_HOME_DIRECTORY@\include\xbt\file_stat.h\r
 \r
        CreateDirectory  $INSTDIR\include\simgrid\r
        setOutPath $INSTDIR\include\simgrid\r
        file @CMAKE_HOME_DIRECTORY@\include\simgrid\platf.h\r
        file @CMAKE_HOME_DIRECTORY@\include\simgrid\modelchecker.h\r
-       \r
+       file @CMAKE_HOME_DIRECTORY@\include\simgrid\simix.h\r
+\r
        CreateDirectory  $INSTDIR\include\msg\r
        setOutPath $INSTDIR\include\msg\r
        file @CMAKE_HOME_DIRECTORY@\include\msg\msg.h\r
@@ -146,12 +149,6 @@ Section "Libraries and Headers" LibSection
        setOutPath $INSTDIR\include\instr\r
        file @CMAKE_HOME_DIRECTORY@\include\instr\instr.h\r
        \r
-       CreateDirectory  $INSTDIR\include\simix\r
-       setOutPath $INSTDIR\include\simix\r
-       file @CMAKE_HOME_DIRECTORY@\include\simix\simix.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\simix\datatypes.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\simix\context.h\r
-       \r
 SectionEnd\r
 Section "Binaries" BinSection  \r
        \r
@@ -341,7 +338,13 @@ section "Uninstall"
        delete $INSTDIR\include\xbt\mmalloc.h\r
        delete $INSTDIR\include\xbt\replay_trace_reader.h\r
        delete $INSTDIR\include\xbt\parmap.h\r
-       delete $INSTDIR\include\mc\modelchecker.h\r
+       delete $INSTDIR\include\xbt\socket.h\r
+       delete $INSTDIR\include\xbt\file_stat.h\r
+\r
+       delete $INSTDIR\include\simgrid\platf.h\r
+       delete $INSTDIR\include\simgrid\modelchecker.h\r
+       delete $INSTDIR\include\simgrid\simix.h\r
+\r
        delete $INSTDIR\include\msg\msg.h\r
        delete $INSTDIR\include\msg\datatypes.h \r
        delete $INSTDIR\include\simdag\simdag.h\r
@@ -365,9 +368,6 @@ section "Uninstall"
        delete $INSTDIR\include\amok\peermanagement.h\r
        delete $INSTDIR\include\amok\bandwidth.h\r
        delete $INSTDIR\include\instr\instr.h\r
-       delete $INSTDIR\include\simix\simix.h\r
-       delete $INSTDIR\include\simix\datatypes.h\r
-       delete $INSTDIR\include\simix\context.h\r
                \r
        # delete EXTRA FILES\r
        delete $INSTDIR\AUTHORS\r
diff --git a/doc/webcruft/SGicon.gif b/doc/webcruft/SGicon.gif
new file mode 100644 (file)
index 0000000..04b7188
Binary files /dev/null and b/doc/webcruft/SGicon.gif differ
diff --git a/doc/webcruft/SGicon.ico b/doc/webcruft/SGicon.ico
new file mode 100644 (file)
index 0000000..11f9273
Binary files /dev/null and b/doc/webcruft/SGicon.ico differ
index 31e46e6..31d822a 100644 (file)
@@ -384,6 +384,10 @@ smx_action_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
           SIMIX_process_sleep_suspend(process->waiting_action);
           break;
 
+        case SIMIX_ACTION_SYNCHRO:
+          /* Suspension is delayed to when the process is rescheduled. */
+          break;
+
         default:
           xbt_die("Internal error in SIMIX_process_suspend: unexpected action type %d",
               (int)process->waiting_action->type);
@@ -431,14 +435,18 @@ void SIMIX_process_resume(smx_process_t process, smx_process_t issuer)
           SIMIX_process_sleep_resume(process->waiting_action);
           break;
 
+        case SIMIX_ACTION_SYNCHRO:
+          /* I cannot resume it now. This is delayed to when the process is rescheduled at
+           * the end of the synchro. */
+          break;
+
         default:
           xbt_die("Internal error in SIMIX_process_resume: unexpected action type %d",
               (int)process->waiting_action->type);
       }
     }
-    else
-      XBT_WARN("Strange. Process %p is trying to resume himself.", issuer);
-  }
+  } else XBT_WARN("Strange. Process %p is trying to resume himself.", issuer);
+
   XBT_OUT();
 }
 
index c752587..a66b8f4 100644 (file)
@@ -33,10 +33,12 @@ void SIMIX_simcall_answer(smx_simcall_t simcall)
     XBT_DEBUG("Answer simcall %s (%d) issued by %s (%p)", SIMIX_simcall_name(simcall->call), (int)simcall->call,
         simcall->issuer->name, simcall->issuer);
     simcall->issuer->simcall.call = SIMCALL_NONE;
-    if(!xbt_dynar_member(simix_global->process_to_run, &(simcall->issuer)))
-      xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, simcall->issuer);
-    else
-      DIE_IMPOSSIBLE;
+/*    This check should be useless and slows everyone. Reactivate if you see something
+ *    weird in process scheduling.
+ */
+/*    if(!xbt_dynar_member(simix_global->process_to_run, &(simcall->issuer))) */
+    xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, simcall->issuer);
+/*    else DIE_IMPOSSIBLE; */
   }
 }
 
index 2680406..7bb1803 100644 (file)
@@ -60,7 +60,7 @@ e_UM_t network_update_mechanism = UM_UNDEFINED;
 static int net_selective_update = 0;
 
 static int net_action_is_suspended(surf_action_t action);
-static void net_update_action_remaining_lazy(double now);
+static void net_update_action_remaining_lazy(surf_action_network_CM02_t action, double now);
 
 static xbt_swag_t net_modified_set = NULL;
 static xbt_heap_t net_action_heap = NULL;
@@ -353,46 +353,47 @@ int net_get_link_latency_limited(surf_action_t action)
 
 double net_action_get_remains(surf_action_t action)
 {
+  XBT_IN("(%p)", action);
+  /* update remains before return it */
   if (network_update_mechanism == UM_LAZY)      /* update remains before return it */
-    net_update_action_remaining_lazy(surf_get_clock());
+    net_update_action_remaining_lazy((surf_action_network_CM02_t)action,
+        surf_get_clock());
+  XBT_OUT();
   return action->remains;
 }
 
-static void net_update_action_remaining_lazy(double now)
+static void net_update_action_remaining_lazy(surf_action_network_CM02_t action, double now)
 {
-  surf_action_lmm_t action = NULL;
   double delta = 0.0;
 
-  xbt_swag_foreach(action, net_modified_set) {
+  if (GENERIC_LMM_ACTION(action).suspended != 0)
+    return;
 
-    if (action->suspended != 0) {
-      continue;
-    }
+  delta = now - GENERIC_LMM_ACTION(action).last_update;
 
-    delta = now - action->last_update;
+  double_update(&(((surf_action_t)action)->remains),
+      GENERIC_LMM_ACTION(action).last_value * delta);
 
-    double_update(&(((surf_action_t)action)->remains),
-                  lmm_variable_getvalue(action->variable) * delta);
+  if (((surf_action_t)action)->max_duration != NO_MAX_DURATION)
+    double_update(&(((surf_action_t)action)->max_duration), delta);
 
-    if (((surf_action_t)action)->max_duration != NO_MAX_DURATION)
-      double_update(&(((surf_action_t)action)->max_duration), delta);
-
-    if ((((surf_action_t)action)->remains <= 0) &&
-        (lmm_get_variable_weight(action->variable) > 0)) {
-      ((surf_action_t)action)->finish = surf_get_clock();
-      surf_network_model->action_state_set((surf_action_t) action,
-                                           SURF_ACTION_DONE);
-      surf_action_lmm_heap_remove(net_action_heap,action);
-    } else if (((((surf_action_t)action)->max_duration != NO_MAX_DURATION)
-               && (((surf_action_t)action)->max_duration <= 0))) {
-      ((surf_action_t)action)->finish = surf_get_clock();
-      surf_network_model->action_state_set((surf_action_t) action,
-                                           SURF_ACTION_DONE);
-      surf_action_lmm_heap_remove(net_action_heap,action);
-    }
+  if ((((surf_action_t)action)->remains <= 0) &&
+      (lmm_get_variable_weight(GENERIC_LMM_ACTION(action).variable) > 0)) {
+    ((surf_action_t)action)->finish = surf_get_clock();
+    surf_network_model->action_state_set((surf_action_t) action,
+        SURF_ACTION_DONE);
 
-    action->last_update = now;
+    surf_action_lmm_heap_remove(net_action_heap,(surf_action_lmm_t)action);
+  } else if (((((surf_action_t)action)->max_duration != NO_MAX_DURATION)
+      && (((surf_action_t)action)->max_duration <= 0))) {
+    ((surf_action_t)action)->finish = surf_get_clock();
+    surf_network_model->action_state_set((surf_action_t) action,
+        SURF_ACTION_DONE);
+    surf_action_lmm_heap_remove(net_action_heap,(surf_action_lmm_t)action);
   }
+
+  GENERIC_LMM_ACTION(action).last_update = now;
+  GENERIC_LMM_ACTION(action).last_value = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable);
 }
 
 static double net_share_resources_full(double now)
@@ -438,7 +439,6 @@ static double net_share_resources_lazy(double now)
   XBT_DEBUG
       ("Before share resources, the size of modified actions set is %d",
        xbt_swag_size(net_modified_set));
-  net_update_action_remaining_lazy(now);
 
   lmm_solve(network_maxmin_system);
 
@@ -446,7 +446,7 @@ static double net_share_resources_lazy(double now)
       ("After share resources, The size of modified actions set is %d",
        xbt_swag_size(net_modified_set));
 
-  xbt_swag_foreach(action, net_modified_set) {
+  while((action = xbt_swag_extract(net_modified_set))) {
     int max_dur_flag = 0;
 
     if (GENERIC_ACTION(action).state_set !=
@@ -457,6 +457,8 @@ static double net_share_resources_lazy(double now)
     if (GENERIC_ACTION(action).priority <= 0)
       continue;
 
+    net_update_action_remaining_lazy(action,now);
+
     min = -1;
     value = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable);
     if (value > 0) {
index a91e006..2b15380 100644 (file)
@@ -148,7 +148,7 @@ void *xbt_heap_pop(xbt_heap_t H)
  * \param i    element position
  * \return the element at position i if ok, NULL otherwise
  *
- * Extracts from the heap and returns the element at position i. The head is automatically reorded.
+ * Extracts from the heap and returns the element at position i. The heap is automatically reorded.
  */
 void *xbt_heap_remove(xbt_heap_t H, int i)
 {
index cd2b6a8..40a17af 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "xbt/dynar.h"          /* void_f_pvoid_t */
 #include "xbt/heap.h"
+#include <float.h>
 
 typedef struct xbt_heap_item {
   void *content;
@@ -30,6 +31,6 @@ typedef struct xbt_heap {
 #define KEY(H,i)     ((H->items)[i]).key
 #define CONTENT(H,i) ((H->items)[i]).content
 
-#define MIN_KEY_VALUE -10000
+#define MIN_KEY_VALUE -DBL_MAX
 
 #endif                          /* _XBT_HEAP_PRIVATE_H */
index d0e6d00..95b6843 100644 (file)
@@ -556,7 +556,9 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(xbt);
   XBT_LOG_CONNECT(graphxml_parse);
   XBT_LOG_CONNECT(log);
+#if HAVE_MMAP
   XBT_LOG_CONNECT(mm_diff);
+#endif
   XBT_LOG_CONNECT(module);
   XBT_LOG_CONNECT(peer);
   XBT_LOG_CONNECT(replay);