Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add tests for ompi selector
[simgrid.git] / testsuite / surf / lmm_usage.c
index 586cd8c..37bb41e 100644 (file)
@@ -31,7 +31,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,
 typedef enum {
   MAXMIN,
   LAGRANGE_RENO,
-  LAGRANGE_VEGAS,
+  LAGRANGE_VEGAS
 } method_t;
 
 static double dichotomy(double func(double), double min, double max,
@@ -122,7 +122,7 @@ void test1(method_t method)
     lmm_set_default_protocol_function(func_reno_f, func_reno_fpi,
                                       func_reno_fpi);
 
-  Sys = lmm_system_new();
+  Sys = lmm_system_new(1);
   L1 = lmm_constraint_new(Sys, (void *) "L1", a);
   L2 = lmm_constraint_new(Sys, (void *) "L2", b);
   L3 = lmm_constraint_new(Sys, (void *) "L3", a);
@@ -229,6 +229,10 @@ void test1(method_t method)
   PRINT_VAR(R_2);
   PRINT_VAR(R_3);
 
+  lmm_variable_free(Sys, R_1_2_3);
+  lmm_variable_free(Sys, R_1);
+  lmm_variable_free(Sys, R_2);
+  lmm_variable_free(Sys, R_3);
   lmm_system_free(Sys);
 }
 
@@ -250,7 +254,7 @@ void test2(method_t method)
     lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
                                       func_reno_fpi);
 
-  Sys = lmm_system_new();
+  Sys = lmm_system_new(1);
   CPU1 = lmm_constraint_new(Sys, (void *) "CPU1", 200.0);
   CPU2 = lmm_constraint_new(Sys, (void *) "CPU2", 100.0);
 
@@ -279,6 +283,8 @@ void test2(method_t method)
   PRINT_VAR(T1);
   PRINT_VAR(T2);
 
+  lmm_variable_free(Sys, T1);
+  lmm_variable_free(Sys, T2);
   lmm_system_free(Sys);
 }
 
@@ -397,7 +403,7 @@ void test3(method_t method)
     lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
                                       func_reno_fpi);
 
-  Sys = lmm_system_new();
+  Sys = lmm_system_new(1);
 
 
 
@@ -451,6 +457,8 @@ void test3(method_t method)
     PRINT_VAR(tmp_var[j]);
   }
 
+  for (j = 0; j < 16; j++)
+    lmm_variable_free(Sys, tmp_var[j]);
   xbt_free(tmp_var);
   xbt_free(tmp_cnst);
   for (i = 0; i < 31; i++)