Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added function prototypes in maxmin_private, minor bug corrections in
authorvelho <velho@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 27 Jun 2007 16:00:23 +0000 (16:00 +0000)
committervelho <velho@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 27 Jun 2007 16:00:23 +0000 (16:00 +0000)
surf.c.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3605 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/lagrange.c
src/surf/maxmin_private.h
src/surf/surf.c
src/surf/surf_private.h

index 7cf0332..c3aa908 100644 (file)
@@ -306,9 +306,9 @@ double partial_diff_mu(double mu, void *param_var){
 
   //for each link with capacity cnsts[i] that uses flow of variable var do
   for(i=0; i<var->cnsts_number; i++)
-    mu_partial += (var->cnsts[i].constraint)->lambda + mu;
+    mu_partial += (var->cnsts[i].constraint)->lambda;
   
-  mu_partial = (-1.0/mu_partial) + var->bound;
+  mu_partial = ( -1.0 / (mu_partial + mu) ) + var->bound;
 
   return mu_partial;
 }
@@ -369,3 +369,9 @@ double partial_diff_lambda(double lambda, void *param_cnst){
 }
   
  
+
+
+
+
+
+
index 034a252..7f503df 100644 (file)
@@ -54,8 +54,14 @@ typedef struct lmm_variable {
   double mu;
   double new_mu;
   double value;
+  double df; /* Total delay of flow */
   void *id;
   int index;
+  double (* func_f)    (lmm_variable var, double x);  /* f            */
+  double (* func_fp)   (lmm_variable var, double x);  /* f'           */
+  double (* func_fpi)  (lmm_variable var, double x);  /* (f')^{-1}    */
+  double (* func_fpip) (lmm_variable var, double x);  /* ((f')^{-1})' */
+  double func_fi;
 } s_lmm_variable_t;
 
 typedef struct lmm_system {
index 89b92c3..ee88a0f 100644 (file)
@@ -14,6 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
                                "Logging specific to SURF (kernel)");
 
 int use_sdp_solver=0;
+int use_lagrange_solver=0;
 
 /* Additional declarations for Windows potability. */
 
@@ -144,12 +145,14 @@ double generic_maxmin_share_resources2(xbt_swag_t running_actions,
 
   if(!use_sdp_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) {
index 9b27052..51dbd5f 100644 (file)
@@ -45,6 +45,7 @@ typedef struct surf_resource_private {
 /* #define priv2pub(r) ((void *) ((char *)(r) +(sizeof(struct surf_resource_private_part)))) */
 
 extern int use_sdp_solver;
+extern int use_lagrange_solver;
 
 double generic_maxmin_share_resources(xbt_swag_t running_actions,
                                      size_t offset);