Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #59 from fabienchaix/master
[simgrid.git] / src / surf / surf_interface.cpp
index 6497396..2a86c80 100644 (file)
@@ -27,10 +27,9 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
  * The callback functions of cpu_model and network_model will be called from
  * those of these host models. */
 xbt_dynar_t all_existing_models = NULL; /* to destroy models correctly */
-xbt_dynar_t model_list_invoke = NULL;  /* for invoking callbacks */
+xbt_dynar_t model_list_invoke = NULL;  /* to invoke callbacks */
 
-tmgr_history_t history = NULL;
-lmm_system_t maxmin_system = NULL;
+sg_future_evt_set_t future_evt_set = nullptr;
 xbt_dynar_t surf_path = NULL;
 xbt_dynar_t host_that_restart = NULL;
 xbt_dict_t watched_hosts_lib;
@@ -131,7 +130,7 @@ s_surf_model_description_t surf_storage_model_description[] = {
   {NULL, NULL,  NULL}      /* this array must be NULL terminated */
 };
 
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
 static xbt_parmap_t surf_parmap = NULL; /* parallel map on models */
 #endif
 
@@ -328,8 +327,8 @@ void surf_init(int *argc, char **argv)
     all_existing_models = xbt_dynar_new(sizeof(simgrid::surf::Model*), NULL);
   if (!model_list_invoke)
     model_list_invoke = xbt_dynar_new(sizeof(simgrid::surf::Model*), NULL);
-  if (!history)
-    history = tmgr_history_new();
+  if (!future_evt_set)
+    future_evt_set = new simgrid::trace_mgr::future_evt_set();
 
   TRACE_add_start_function(TRACE_surf_alloc);
   TRACE_add_end_function(TRACE_surf_release);
@@ -369,16 +368,12 @@ void surf_exit(void)
 
   simgrid::surf::surfExitCallbacks();
 
-  if (maxmin_system) {
-    lmm_system_free(maxmin_system);
-    maxmin_system = NULL;
-  }
-  if (history) {
-    tmgr_history_free(history);
-    history = NULL;
+  if (future_evt_set) {
+    delete future_evt_set;
+    future_evt_set = nullptr;
   }
 
-#ifdef CONTEXT_THREADS
+#ifdef HAVE_THREAD_CONTEXTS
   xbt_parmap_destroy(surf_parmap);
 #endif
 
@@ -806,7 +801,7 @@ void Action::setPriority(double priority)
   lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), priority);
 
   if (getModel()->getUpdateMechanism() == UM_LAZY)
-       heapRemove(getModel()->getActionHeap());
+    heapRemove(getModel()->getActionHeap());
   XBT_OUT();
 }