From 3fd1c802a946042793109d0da05a748a7b9c1d43 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 3 Nov 2011 15:16:10 +0100 Subject: [PATCH] integrate initialization functions within the parsing main function to clean the calling code --- examples/msg/masterslave/masterslave_cpu_ti.tesh | 2 +- src/simdag/sd_global.c | 6 ------ src/simix/smx_environment.c | 10 +--------- teshsuite/simdag/platforms/basic_parsing_test.tesh | 2 +- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/examples/msg/masterslave/masterslave_cpu_ti.tesh b/examples/msg/masterslave/masterslave_cpu_ti.tesh index 354343d44e..5979766b4f 100644 --- a/examples/msg/masterslave/masterslave_cpu_ti.tesh +++ b/examples/msg/masterslave/masterslave_cpu_ti.tesh @@ -376,8 +376,8 @@ p Testing the bypassing of the flexml parser ! output sort $ $SG_TEST_EXENV ${bindir:=.}/masterslave_bypass --log=no_loc --cfg=cpu/model:CpuTI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:@) Configuration change: Set 'cpu/model' to 'CpuTI' -> [ 0.000000] (0:@) Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code. > [ 0.000000] (0:@) Switching workstation model to compound since you changed the network and/or cpu model(s) +> [ 0.000000] (0:@) Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code. > [ 0.000000] (1:master@host A) Got 1 slave(s) : > [ 0.000000] (1:master@host A) host B > [ 0.000000] (1:master@host A) Got 20 task to process : diff --git a/src/simdag/sd_global.c b/src/simdag/sd_global.c index 28398afd67..a9065e35c7 100644 --- a/src/simdag/sd_global.c +++ b/src/simdag/sd_global.c @@ -182,13 +182,7 @@ void SD_create_environment(const char *platform_file) void **surf_workstation = NULL; void **surf_link = NULL; - // Reset callbacks - surf_parse_reset_callbacks(); - // Add config callbacks - surf_parse_add_callback_config(); - parse_platform_file(platform_file); - surf_config_models_create_elms(); /* now let's create the SD wrappers for workstations and links */ xbt_lib_foreach(host_lib, cursor, name, surf_workstation){ diff --git a/src/simix/smx_environment.c b/src/simix/smx_environment.c index 0c7d109899..4b648162d0 100644 --- a/src/simix/smx_environment.c +++ b/src/simix/smx_environment.c @@ -39,16 +39,8 @@ void SIMIX_create_environment(const char *file) double start, end; - // Reset callbacks - surf_parse_reset_callbacks(); - // Add config callbacks - surf_parse_add_callback_config(); - - parse_platform_file(file); - surf_config_models_create_elms(); - start = xbt_os_time(); - /* FIXME: what time are we measuring ??? */ + parse_platform_file(file); end = xbt_os_time(); XBT_DEBUG("PARSE TIME: %lg", (end - start)); diff --git a/teshsuite/simdag/platforms/basic_parsing_test.tesh b/teshsuite/simdag/platforms/basic_parsing_test.tesh index b81c47ed87..3731fcb0ac 100644 --- a/teshsuite/simdag/platforms/basic_parsing_test.tesh +++ b/teshsuite/simdag/platforms/basic_parsing_test.tesh @@ -85,7 +85,7 @@ $ ${bindir:=.}/basic_parsing_test ./properties.xml $ ${bindir:=.}/basic_parsing_test ./properties.xml --cfg=cpu/model:CpuTI > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'CpuTI' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '0.000010' -> [0.000000] [surf_route/INFO] The custom configuration 'cpu/model' is already define by user! +> [0.000000] [surf_route/INFO] The custom configuration 'cpu/model' is already defined by user! > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'workstation/model' to 'compound' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'Vegas' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'path' to '~/' -- 2.20.1