From: Frederic Suter Date: Sat, 26 Mar 2016 16:14:29 +0000 (+0100) Subject: move one more tracing test X-Git-Tag: v3_13~270^2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e98247819f8693d64145110665434d3a6a01ffc3?hp=6fe803617ce4e98547bf1d8c040a9576cc8e4eac move one more tracing test --- diff --git a/.gitignore b/.gitignore index d11288719d..199dd54732 100644 --- a/.gitignore +++ b/.gitignore @@ -192,7 +192,7 @@ examples/msg/tracing/procmig examples/msg/trace-simple/trace-simple examples/msg/tracing/tasks examples/msg/trace-platform/trace-platform -examples/msg/tracing/user_variables +examples/msg/trace-user-variables/trace-user-variables examples/s4u/basic/s4u_basic examples/s4u/io/s4u_io examples/simdag/daxload/sd_daxload diff --git a/examples/msg/CMakeLists.txt b/examples/msg/CMakeLists.txt index f9f9338cad..5334f6e5de 100644 --- a/examples/msg/CMakeLists.txt +++ b/examples/msg/CMakeLists.txt @@ -1,7 +1,8 @@ foreach(x actions-mpi actions-storage async-wait async-waitall async-waitany dht-chord dht-pastry exception energy-consumption energy-onoff energy-pstate energy-ptask energy-vm failures io-file io-file-unlink io-remote io-storage pmm priority process-kill process-migration process-suspend properties sendrecv - set-maestro start_kill_time synchro token_ring trace-categories trace-platform trace-simple) + set-maestro start_kill_time synchro token_ring + trace-categories trace-platform trace-simple trace-user-variables) add_executable (${x} ${x}/${x}.c) target_link_libraries(${x} simgrid) set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) @@ -64,7 +65,7 @@ foreach (example consumption onoff pstate vm) ADD_TESH_FACTORIES(msg-energy-${example} "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy-${example}/energy-${example}.tesh) endforeach() -foreach (x categories platform simple) +foreach (x categories platform simple user-variables) ADD_TESH(msg-trace-${x} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/trace-${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/trace-${x} trace-${x}.tesh) endforeach() diff --git a/examples/msg/trace-categories/trace-categories.c b/examples/msg/trace-categories/trace-categories.c index 22d2c47801..acc12b3b0a 100644 --- a/examples/msg/trace-categories/trace-categories.c +++ b/examples/msg/trace-categories/trace-categories.c @@ -19,11 +19,8 @@ * (See \ref tracing_tracing_options for details) */ -#include #include "simgrid/msg.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); - static int master(int argc, char *argv[]) { long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s"); diff --git a/examples/msg/tracing/user_variables.c b/examples/msg/trace-user-variables/trace-user-variables.c similarity index 95% rename from examples/msg/tracing/user_variables.c rename to examples/msg/trace-user-variables/trace-user-variables.c index b338130b8d..5e6a05735c 100644 --- a/examples/msg/tracing/user_variables.c +++ b/examples/msg/trace-user-variables/trace-user-variables.c @@ -12,7 +12,7 @@ * --cfg=tracing/platform:yes * (See \ref tracing_tracing_options for details) */ - +#include #include "simgrid/msg.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); @@ -51,10 +51,8 @@ static int master(int argc, char *argv[]) int main(int argc, char *argv[]) { MSG_init(&argc, argv); - if (argc < 3) { - printf("Usage: %s platform_file deployment_file\n", argv[0]); - exit(1); - } + xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" + "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); MSG_create_environment(argv[1]); diff --git a/examples/msg/tracing/user_variables.tesh b/examples/msg/trace-user-variables/trace-user-variables.tesh similarity index 65% rename from examples/msg/tracing/user_variables.tesh rename to examples/msg/trace-user-variables/trace-user-variables.tesh index 35eec3cd76..0cb32efff5 100644 --- a/examples/msg/tracing/user_variables.tesh +++ b/examples/msg/trace-user-variables/trace-user-variables.tesh @@ -1,7 +1,7 @@ #! ./tesh p Tracing user variables -$ $SG_TEST_EXENV ${bindir:=.}/tracing/user_variables$EXEEXT --cfg=tracing:yes --cfg=tracing/platform:yes ${srcdir:=.}/../platforms/small_platform.xml ${srcdir:=.}/tracing/deployment.xml +$ $SG_TEST_EXENV ${bindir:=.}/trace-user-variabless$EXEEXT --cfg=tracing:yes --cfg=tracing/platform:yes ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/masterslave/deployment_masterslave_mailbox.xml > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/platform' to 'yes' > [0.004078] [msg_test/INFO] Declared host variables: @@ -16,7 +16,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/tracing/user_variables$EXEEXT --cfg=tracing:yes -- > [0.004078] [msg_test/INFO] 0-HOST1-LINK3 > [0.004078] [msg_test/INFO] 0-LINK3-HOST1 -$ rm viva_graph.plist +$ rm -f viva_graph.plist p Not tracing user variables -$ $SG_TEST_EXENV ${bindir:=.}/tracing/user_variables$EXEEXT ${srcdir:=.}/../platforms/small_platform.xml ${srcdir:=.}/tracing/deployment.xml +$ $SG_TEST_EXENV ${bindir:=.}/trace-user-variabless$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/masterslave/deployment_masterslave_mailbox.xml diff --git a/examples/msg/tracing/CMakeLists.txt b/examples/msg/tracing/CMakeLists.txt index 295887af08..efecac9fae 100644 --- a/examples/msg/tracing/CMakeLists.txt +++ b/examples/msg/tracing/CMakeLists.txt @@ -1,4 +1,4 @@ -foreach (example ms procmig user_variables link_user_variables link_srcdst_user_variables) +foreach (example ms procmig link_user_variables link_srcdst_user_variables) add_executable (${example} ${example}.c) target_link_libraries(${example} simgrid) set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.c) diff --git a/examples/msg/tracing/procmig.c b/examples/msg/tracing/procmig.c index 78f3616100..13f3955550 100644 --- a/examples/msg/tracing/procmig.c +++ b/examples/msg/tracing/procmig.c @@ -16,8 +16,6 @@ #include "simgrid/msg.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); - /** The guy we will move from host to host. It move alone and then is moved by policeman back */ static int emigrant(int argc, char *argv[]) { @@ -39,7 +37,7 @@ static int emigrant(int argc, char *argv[]) return 0; } -static int master(int argc, char *argv[]) +static int policeman(int argc, char *argv[]) { msg_task_t task = NULL; @@ -81,7 +79,7 @@ int main(int argc, char *argv[]) TRACE_category ("migration_order"); MSG_process_create("emigrant", emigrant, NULL, MSG_get_host_by_name("Fafard")); - MSG_process_create("master", master, NULL, MSG_get_host_by_name("Tremblay")); + MSG_process_create("policeman", policeman, NULL, MSG_get_host_by_name("Tremblay")); MSG_main(); return 0;