Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Protect variable surf_parmap.
[simgrid.git] / src / surf / surf.c
index cf78bea..e78088e 100644 (file)
@@ -399,6 +399,7 @@ void surf_exit(void)
 #ifdef CONTEXT_THREADS
   xbt_parmap_destroy(surf_parmap);
   xbt_free(surf_mins);
+  surf_mins = NULL;
 #endif
 
   xbt_dynar_free(&surf_path);
@@ -464,9 +465,12 @@ double surf_solve(double max_date)
   }
   surf_min_index = 0;
 
+
   if (surf_get_nthreads() > 1) {
     /* parallel version */
+#ifdef CONTEXT_THREADS
     xbt_parmap_apply(surf_parmap, (void_f_pvoid_t) surf_share_resources, model_list);
+#endif
   }
   else {
     /* sequential version */
@@ -550,7 +554,9 @@ double surf_solve(double max_date)
 
   if (surf_get_nthreads() > 1) {
     /* parallel version */
+#ifdef CONTEXT_THREADS
     xbt_parmap_apply(surf_parmap, (void_f_pvoid_t) surf_update_actions_state, model_list);
+#endif
   }
   else {
     /* sequential version */