Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : fix sort of acceptance pairs
[simgrid.git] / src / mc / mc_liveness.c
index 66f17c5..e62c1f6 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2011-2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2011-2013. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -202,10 +203,15 @@ static void set_acceptance_pair_reached(mc_pair_t pair){
       }
     }
 
-    if(bytes_used_test < current_bytes_used)
-      xbt_dynar_insert_at(acceptance_pairs, cursor + 1, &pair);
-    else
-      xbt_dynar_insert_at(acceptance_pairs, cursor, &pair);    
+    if(pair_test->nb_processes < pair->nb_processes){
+      xbt_dynar_insert_at(acceptance_pairs, cursor+1, &pair);
+    }else{
+      if(pair_test->heap_bytes_used < pair->heap_bytes_used)
+        xbt_dynar_insert_at(acceptance_pairs, cursor + 1, &pair);
+      else
+        xbt_dynar_insert_at(acceptance_pairs, cursor, &pair);
+    }    
+
   }
 
   if(!raw_mem_set)
@@ -320,13 +326,13 @@ static int is_visited_pair(mc_pair_t pair){
     }
 
     if(xbt_dynar_length(visited_pairs) > _sg_mc_visited){
-      int min = mc_stats->expanded_states;
+      int min2 = mc_stats->expanded_pairs;
       unsigned int cursor2 = 0;
       unsigned int index2 = 0;
       xbt_dynar_foreach(visited_pairs, cursor2, pair_test){
-        if(pair_test->num < min){
-          index = cursor2;
-          min = pair_test->num;
+        if(pair_test->num < min2){
+          index2 = cursor2;
+          min2 = pair_test->num;
         }
       }
       xbt_dynar_remove_at(visited_pairs, index2, &pair_test);