+++ /dev/null
-<?xml version='1.0'?>
- <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
- <platform version="3">
- <AS id="AS0" routing="Full">
- <!-- For using with ping_pong example, very simple platform -->
- <host id="Inmos" power="98.095Mf"/>
- <host id="Bellevue" power="76.296Mf"/>
- <link id="link" bandwidth="1MBps" latency="100ms"/>
- <route src="Inmos" dst="Bellevue">
- <link_ctn id="link"/>
- </route>
- </AS>
- </platform>
<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
<platform version="3">
<AS id="AS0" routing="Full">
- <host id="Cpu A" power="100Mf" availability_file="trace_A.txt" state_file="trace_A_failure.txt"/>
- <host id="Cpu B" power="100Mf" availability_file="trace_B.txt"/>
+ <host id="Cpu A" power="100Mf" availability_file="trace/trace_A.txt" state_file="trace/trace_A_failure.txt"/>
+ <host id="Cpu B" power="100Mf" availability_file="trace/trace_B.txt"/>
<link id="LinkA" bandwidth="10MBps" latency="200ms"/>
<route src="Cpu A" dst="Cpu B"><link_ctn id="LinkA"/></route>
</AS>
#include <errno.h>
#include <math.h>
#include <stdarg.h> /* va_arg */
+#include <libgen.h>
#include "xbt/misc.h"
#include "xbt/log.h"
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);
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;
! 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.
#! ./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)
#! ./tesh
-$ $SG_TEST_EXENV ${bindir:=.}/trace_usage
+$ $SG_TEST_EXENV ${bindir:=.}/trace_usage --cfg=path:../../examples/platforms/trace/