Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
special exportation data for visual c++
[simgrid.git] / src / surf / surf.c
index ae05341..ced29d3 100644 (file)
@@ -11,6 +11,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
                                "Logging specific to SURF (kernel)");
 
+int use_sdp_solver=0;
 
 /* Additional declarations for Windows potability. */
 
@@ -18,6 +19,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
 #define MAX_DRIVE 26
 #endif 
 
+#ifdef _WIN32
+#include <windows.h>
 static const char* disk_drives_letter_table[MAX_DRIVE] =
 {
         "A:\\",
@@ -47,6 +50,7 @@ static const char* disk_drives_letter_table[MAX_DRIVE] =
         "Y:\\",
         "Z:\\"
 };
+#endif /* #ifdef _WIN32 */
 
 /*
  * Returns the initial path. On Windows the initial path is
@@ -54,8 +58,8 @@ static const char* disk_drives_letter_table[MAX_DRIVE] =
  * case the function returns "./" that represents the current
  * directory on Unix/Linux platforms.
  */
-
-const char* __surf_get_initial_path()
+                       
+const char* __surf_get_initial_path(void)
 {
 
        #ifdef _WIN32
@@ -107,7 +111,7 @@ typedef struct surf_resource_object {
 
 static double NOW = 0;
 
-xbt_dynar_t resource_list = NULL;
+xbt_dynar_t XBT_DECLARE_DATA  resource_list = NULL;
 tmgr_history_t history = NULL;
 lmm_system_t maxmin_system = NULL;
 xbt_dynar_t surf_path = NULL;
@@ -136,7 +140,15 @@ double generic_maxmin_share_resources2(xbt_swag_t running_actions,
   double value = -1;
 #define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + (offset))))
 
-  lmm_solve(sys);
+  if(!use_sdp_solver)
+    lmm_solve(sys);
+  else {
+#ifdef HAVE_SDP
+    sdp_solve(sys);
+#else
+    xbt_assert0(0, "No CSDP found! You cannot use this model!");
+#endif
+  }
 
   xbt_swag_foreach(action, running_actions) {
     value = lmm_variable_getvalue(VARIABLE(action));