From: navarrop Date: Tue, 15 Feb 2011 16:43:24 +0000 (+0000) Subject: Correctely use xbt_str_varsubs X-Git-Tag: v3.6_beta2~300 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/93e5688a00110496a7b1b9d03656bc3b9c87b69c Correctely use xbt_str_varsubs git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9633 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 50eba99251..d91322f9ac 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -3699,9 +3699,9 @@ static char* replace_random_parameter(char * string) return string; temp_string = bprintf("%s",string); - xbt_str_varsubst(temp_string,patterns); // for patterns of cluster + temp_string = xbt_str_varsubst(temp_string,patterns); // for patterns of cluster test_string = bprintf("${%s}",temp_string); - xbt_str_varsubst(test_string,random_value); //Add ${xxxxx} for random Generator + test_string = xbt_str_varsubst(test_string,random_value); //Add ${xxxxx} for random Generator if(strcmp(test_string,"")) //if not empty, keep this value. string = bprintf("%s",test_string); @@ -3861,13 +3861,15 @@ static void routing_parse_Speer(void) static void routing_parse_Srandom(void) { + double mean, std, min, max, seed; char *random_id = A_surfxml_random_id; - double mean = atol(A_surfxml_random_mean); - double std = atol(A_surfxml_random_std_deviation); - double min = atol(A_surfxml_random_min); - double max = atol(A_surfxml_random_max); - double seed = atol(A_surfxml_random_seed); char *random_radical = A_surfxml_random_radical; + surf_parse_get_double(&mean,A_surfxml_random_mean); + surf_parse_get_double(&std,A_surfxml_random_std_deviation); + surf_parse_get_double(&min,A_surfxml_random_min); + surf_parse_get_double(&max,A_surfxml_random_max); + surf_parse_get_double(&seed,A_surfxml_random_seed); + double res = 0; int i = 0; random_data_t random = xbt_new0(s_random_data_t, 1); diff --git a/teshsuite/simdag/platforms/random.xml b/teshsuite/simdag/platforms/random.xml index 95d9dff888..ccdba5f90d 100644 --- a/teshsuite/simdag/platforms/random.xml +++ b/teshsuite/simdag/platforms/random.xml @@ -2,19 +2,15 @@ - - - - - @@ -24,8 +20,8 @@ prefix="bob" suffix=".hamburger.edu" radical="0-1" - power="MyCustomRandomPW${radical}" - bw="MyCustomRandomBW${radical}" + power="CustomPower${radical}" + bw="CustomBandwidth${radical}" lat="5e-5" bb_bw="2250000000.00" bb_lat="5e-4" @@ -36,7 +32,7 @@ suffix=".crepe.fr" radical="0-1" power="1000000000.00" - bw="MyCustomRandomBW" + bw="1600000000" lat="5e-5" bb_bw="2250000000.00" bb_lat="5e-4"/>