From: velho Date: Fri, 29 Jun 2007 09:20:13 +0000 (+0000) Subject: Added the update for the Df parameter (lmm_variable_t), which means the sum of all X-Git-Tag: v3.3~1751 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d30b64ee1cb46a273b00b58ad3c97bb92157cd55?ds=sidebyside Added the update for the Df parameter (lmm_variable_t), which means the sum of all link latencies. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3609 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/Makefile.in b/src/Makefile.in index b62bebd4a8..7e97eba2b3 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -382,11 +382,11 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ FLEXML = @FLEXML@ GRAMINE_MODE_FALSE = @GRAMINE_MODE_FALSE@ GRAMINE_MODE_TRUE = @GRAMINE_MODE_TRUE@ +GRAS_ARCH_32_BITS_FALSE = @GRAS_ARCH_32_BITS_FALSE@ +GRAS_ARCH_32_BITS_TRUE = @GRAS_ARCH_32_BITS_TRUE@ GRAS_DEP = @GRAS_DEP@ GREP = @GREP@ GTNETS_CFLAGS = @GTNETS_CFLAGS@ @@ -442,7 +442,6 @@ abs_top_srcdir = @abs_top_srcdir@ ac_configure_args = @ac_configure_args@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ diff --git a/src/include/surf/maxmin.h b/src/include/surf/maxmin.h index 024807e626..98c5f27ce5 100644 --- a/src/include/surf/maxmin.h +++ b/src/include/surf/maxmin.h @@ -61,6 +61,23 @@ void lmm_update(lmm_system_t sys, lmm_constraint_t cnst, lmm_variable_t var, double value); void lmm_update_variable_bound(lmm_system_t sys, lmm_variable_t var, double bound); + +/** \brief Add the value delta to var->df the sum of latencys. + * + * \param sys the lmm_system_t + * \param var the lmm_variable_t + * + * Add the value delta to var->df (the sum of latencys associated to the + * flow). Whenever this function is called a change is signed in the system. To + * avoid false system changing detection it is a good idea to test + * (delta != 0) before calling it. + * + */ +void lmm_update_variable_latency(lmm_system_t sys, lmm_variable_t var, + double delta); + + + XBT_PUBLIC(void) lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var, double weight); double lmm_get_variable_weight(lmm_variable_t var); diff --git a/src/surf/maxmin.c b/src/surf/maxmin.c index 8dd3fb35d3..2131d8fb06 100644 --- a/src/surf/maxmin.c +++ b/src/surf/maxmin.c @@ -173,6 +173,7 @@ lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id, var->weight = weight; var->bound = bound; var->value = 0.0; + var->df = 0.0; if(weight) xbt_swag_insert_at_head(var,&(sys->variable_set)); else xbt_swag_insert_at_tail(var,&(sys->variable_set)); XBT_OUT; @@ -533,6 +534,13 @@ void lmm_update_variable_bound(lmm_system_t sys, lmm_variable_t var, var->bound = bound; } +void lmm_update_variable_latency(lmm_system_t sys, lmm_variable_t var, + double delta) +{ + sys->modified = 1; + var->df += delta; +} + void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var, double weight) { diff --git a/src/surf/maxmin_private.h b/src/surf/maxmin_private.h index 5e9e453570..27c44d299f 100644 --- a/src/surf/maxmin_private.h +++ b/src/surf/maxmin_private.h @@ -57,11 +57,10 @@ typedef struct lmm_variable { double df; /* Total delay of flow */ void *id; int index; - double (* func_f) (struct lmm_variable *, double); /* f */ - double (* func_fp) (struct lmm_variable *, double); /* f' */ - double (* func_fpi) (struct lmm_variable *, double); /* (f')^{-1} */ - double (* func_fpip) (struct lmm_variable *, double); /* ((f')^{-1})' */ - double func_fi; + double (* func_f) (struct lmm_variable *var, double x); /* f */ + double (* func_fp) (struct lmm_variable *var, double x); /* f' */ + double (* func_fpi) (struct lmm_variable *var, double x); /* (f')^{-1} */ + double (* func_fpip) (struct lmm_variable *var, double x); /* ((f')^{-1})' */ } s_lmm_variable_t; typedef struct lmm_system { diff --git a/src/surf/workstation_KCCFLN05.c b/src/surf/workstation_KCCFLN05.c index 9f80c8ea86..1097df4e55 100644 --- a/src/surf/workstation_KCCFLN05.c +++ b/src/surf/workstation_KCCFLN05.c @@ -353,6 +353,9 @@ static void update_resource_state(void *id, if(action->suspended==0) lmm_update_variable_weight(maxmin_system, action->variable, action->lat_current); + lmm_update_variable_latency(maxmin_system, action->variable, delta); + + } } else if (event_type == nw_link->state_event) { if (value > 0) @@ -491,6 +494,7 @@ static double get_available_speed(void *cpu) return ((cpu_KCCFLN05_t) cpu)->power_current; } + static surf_action_t communicate(void *src, void *dst, double size, double rate) { surf_action_workstation_KCCFLN05_t action = NULL; @@ -555,6 +559,8 @@ static surf_action_t communicate(void *src, void *dst, double size, double rate) lmm_update_variable_bound(maxmin_system, action->variable, action->rate); } + lmm_update_variable_latency(maxmin_system, action->variable, action->latency); + for (i = 0; i < route_size; i++) lmm_expand(maxmin_system, route->links[i]->constraint, action->variable, 1.0); if (card_src->bus)