Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / teshsuite / surf / lmm_usage / lmm_usage.cpp
index 95ef068..fadbaa6 100644 (file)
@@ -11,6 +11,7 @@
 #include "xbt/log.h"
 #include "xbt/module.h"
 #include <math.h>
+#include "src/surf/surf_interface.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 
@@ -87,15 +88,15 @@ static double diff_lagrange_test_1(double x)
 
 static void test1(method_t method)
 {
-  lmm_system_t Sys = NULL;
-  lmm_constraint_t L1 = NULL;
-  lmm_constraint_t L2 = NULL;
-  lmm_constraint_t L3 = NULL;
+  lmm_system_t Sys = nullptr;
+  lmm_constraint_t L1 = nullptr;
+  lmm_constraint_t L2 = nullptr;
+  lmm_constraint_t L3 = nullptr;
 
-  lmm_variable_t R_1_2_3 = NULL;
-  lmm_variable_t R_1 = NULL;
-  lmm_variable_t R_2 = NULL;
-  lmm_variable_t R_3 = NULL;
+  lmm_variable_t R_1_2_3 = nullptr;
+  lmm_variable_t R_1 = nullptr;
+  lmm_variable_t R_2 = nullptr;
+  lmm_variable_t R_3 = nullptr;
 
   double a = 1.0, b = 10.0;
 
@@ -204,12 +205,12 @@ static void test1(method_t method)
 
 static void test2(method_t method)
 {
-  lmm_system_t Sys = NULL;
-  lmm_constraint_t CPU1 = NULL;
-  lmm_constraint_t CPU2 = NULL;
+  lmm_system_t Sys = nullptr;
+  lmm_constraint_t CPU1 = nullptr;
+  lmm_constraint_t CPU2 = nullptr;
 
-  lmm_variable_t T1 = NULL;
-  lmm_variable_t T2 = NULL;
+  lmm_variable_t T1 = nullptr;
+  lmm_variable_t T2 = nullptr;
 
   if (method == LAGRANGE_VEGAS)
     lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp, func_vegas_fpi);
@@ -257,9 +258,9 @@ static void test3(method_t method)
 
   double **A;
 
-  lmm_system_t Sys = NULL;
-  lmm_constraint_t *tmp_cnst = NULL;
-  lmm_variable_t *tmp_var = NULL;
+  lmm_system_t Sys = nullptr;
+  lmm_constraint_t *tmp_cnst = nullptr;
+  lmm_variable_t *tmp_var = nullptr;
   char **tmp_name;
 
   /*array to add the the constraints of fictitious variables */
@@ -357,7 +358,7 @@ static void test3(method_t method)
 
 int main(int argc, char **argv)
 {
-  xbt_init(&argc, argv);
+  surf_init(&argc, argv);
 
   XBT_INFO("***** Test 1 (Max-Min)");
   test1(MAXMIN);
@@ -380,5 +381,6 @@ int main(int argc, char **argv)
   XBT_INFO("***** Test 3 (Lagrange - Reno)");
   test3(LAGRANGE_RENO);
 
+  surf_exit();
   return 0;
 }