/* 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. */
+#include <ctype.h>
+
#include "surf_private.h"
#include "xbt/module.h"
"Logging specific to SURF (kernel)");
int use_sdp_solver=0;
+int use_lagrange_solver=0;
/* Additional declarations for Windows potability. */
for(i = 0; i<MAX_DRIVE;i++)
{
- if(root[0] == disk_drives_letter_table[i][0])
+ if(toupper(root[0]) == disk_drives_letter_table[i][0])
return disk_drives_letter_table[i];
}
static double NOW = 0;
-xbt_dynar_t XBT_DECLARE_DATA resource_list = NULL;
+xbt_dynar_t resource_list = NULL;
tmgr_history_t history = NULL;
lmm_system_t maxmin_system = NULL;
xbt_dynar_t surf_path = NULL;
double value = -1;
#define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + (offset))))
- if(!use_sdp_solver)
+ if(!use_sdp_solver && !use_lagrange_solver)
lmm_solve(sys);
- else {
+ else if(!use_lagrange_solver){
#ifdef HAVE_SDP
sdp_solve(sys);
#else
xbt_assert0(0, "No CSDP found! You cannot use this model!");
#endif
+ }else{
+ lagrange_solve(sys);
}
xbt_swag_foreach(action, running_actions) {
} else
min = action->max_duration;
+ DEBUG5("Found an action (%p: duration = %f, remains = %f, value = %f) ! %f",action, action->max_duration, action->remains, value, min);
for (action = xbt_swag_getNext(action, running_actions->offset);
action;
value = lmm_variable_getvalue(VARIABLE(action));
if (value > 0) {
value = action->remains / value;
- if (value < min)
+ if (value < min) {
min = value;
+ DEBUG2("Updating min (value) with %p: %f",action, min);
+ }
}
- if ((action->max_duration >= 0) && (action->max_duration < min))
+ if ((action->max_duration >= 0) && (action->max_duration < min)) {
min = action->max_duration;
+ DEBUG2("Updating min (duration) with %p: %f",action, min);
+ }
}
+ DEBUG1("min value : %f",min);
+
#undef VARIABLE
return min;
}