From: Paul Bédaride Date: Tue, 1 Jul 2014 09:28:50 +0000 (+0200) Subject: Path relative to xml directory works X-Git-Tag: v3_12~941 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/717a0f6c0ff88cbfd2ff66291c80f312d95d73a6 Path relative to xml directory works --- diff --git a/examples/msg/sendrecv/platform_sendrecv.xml b/examples/msg/sendrecv/platform_sendrecv.xml deleted file mode 100644 index 25d1cf385d..0000000000 --- a/examples/msg/sendrecv/platform_sendrecv.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/teshsuite/surf/trace_A.txt b/examples/platforms/trace/trace_A.txt similarity index 100% rename from teshsuite/surf/trace_A.txt rename to examples/platforms/trace/trace_A.txt diff --git a/teshsuite/surf/trace_A_failure.txt b/examples/platforms/trace/trace_A_failure.txt similarity index 100% rename from teshsuite/surf/trace_A_failure.txt rename to examples/platforms/trace/trace_A_failure.txt diff --git a/teshsuite/surf/trace_B.txt b/examples/platforms/trace/trace_B.txt similarity index 100% rename from teshsuite/surf/trace_B.txt rename to examples/platforms/trace/trace_B.txt diff --git a/teshsuite/surf/platform.xml b/examples/platforms/two_hosts_platform_with_availability.xml similarity index 61% rename from teshsuite/surf/platform.xml rename to examples/platforms/two_hosts_platform_with_availability.xml index b6c18bb7af..5378b5fb22 100644 --- a/teshsuite/surf/platform.xml +++ b/examples/platforms/two_hosts_platform_with_availability.xml @@ -2,8 +2,8 @@ - - + + diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index d19fdefba4..98f90f9f73 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -7,6 +7,7 @@ #include #include #include /* va_arg */ +#include #include "xbt/misc.h" #include "xbt/log.h" @@ -1025,6 +1026,8 @@ void surf_parse_open(const char *file) if (!surf_parsed_filename_stack) surf_parsed_filename_stack = xbt_dynar_new(sizeof(char *), &xbt_free_ref); surf_parsed_filename = xbt_strdup(file); + char *dir = dirname(surf_parsed_filename); + xbt_dynar_push(surf_path, &dir); surf_file_to_parse = surf_fopen(file, "r"); xbt_assert((surf_file_to_parse), "Unable to open \"%s\"\n", file); @@ -1038,6 +1041,11 @@ void surf_parse_close(void) xbt_dynar_free(&surf_input_buffer_stack); xbt_dynar_free(&surf_file_to_parse_stack); xbt_dynar_free(&surf_parsed_filename_stack); + if (surf_parsed_filename) { + char *dir = NULL; + xbt_dynar_pop(surf_path, dir); + free(dir); + } free(surf_parsed_filename); surf_parsed_filename = NULL; diff --git a/teshsuite/smpi/pingpong/broken_hostfiles.tesh b/teshsuite/smpi/pingpong/broken_hostfiles.tesh index 87830407fd..6e78e3483b 100644 --- a/teshsuite/smpi/pingpong/broken_hostfiles.tesh +++ b/teshsuite/smpi/pingpong/broken_hostfiles.tesh @@ -1,8 +1,8 @@ ! setenv LD_LIBRARY_PATH=../../lib ! expect return 1 -$ ${bindir:=.}/../../../bin/smpirun -hostfile empty-hostfile.txt -platform ../../../examples/msg/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -hostfile empty-hostfile.txt -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning > [smpirun] ** error: the hostfile 'empty-hostfile.txt' is empty. Aborting. ! expect return 1 -$ ${bindir:=.}/../../../bin/smpirun -hostfile hostfile-does-not-exist.txt -platform ../../../examples/msg/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -hostfile hostfile-does-not-exist.txt -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pingpong -q --log=smpi_kernel.thres:warning > [smpirun] ** error: the file 'hostfile-does-not-exist.txt' does not exist. Aborting. diff --git a/teshsuite/surf/surf_usage/surf_usage.tesh b/teshsuite/surf/surf_usage/surf_usage.tesh index 5010663652..0ee8c57a95 100644 --- a/teshsuite/surf/surf_usage/surf_usage.tesh +++ b/teshsuite/surf/surf_usage/surf_usage.tesh @@ -1,11 +1,11 @@ #! ./tesh -$ $SG_TEST_EXENV ${bindir:=.}/surf_usage platform.xml +$ $SG_TEST_EXENV ${bindir:=.}/surf_usage ../../examples/platforms/two_hosts_platform_with_availability.xml > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02' > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) -$ $SG_TEST_EXENV ${bindir:=.}/surf_usage2 platform.xml +$ $SG_TEST_EXENV ${bindir:=.}/surf_usage2 ../../examples/platforms/two_hosts_platform_with_availability.xml > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01' > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) diff --git a/teshsuite/surf/trace_usage/trace_usage.tesh b/teshsuite/surf/trace_usage/trace_usage.tesh index f75d50676a..4a5fed3b47 100644 --- a/teshsuite/surf/trace_usage/trace_usage.tesh +++ b/teshsuite/surf/trace_usage/trace_usage.tesh @@ -1,3 +1,3 @@ #! ./tesh -$ $SG_TEST_EXENV ${bindir:=.}/trace_usage +$ $SG_TEST_EXENV ${bindir:=.}/trace_usage --cfg=path:../../examples/platforms/trace/