From: Frederic Suter Date: Fri, 25 Mar 2016 11:46:50 +0000 (+0100) Subject: some cleanups before reorg X-Git-Tag: v3_13~270^2~10 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ec40265fd12aabf117e6c0c3f77347bc351cff76?hp=41c1c60e6a271e5c765deb0f2c4c28eb2e3516c3 some cleanups before reorg --- diff --git a/examples/msg/tracing/CMakeLists.txt b/examples/msg/tracing/CMakeLists.txt index 3be1e6b5b3..c4e742c079 100644 --- a/examples/msg/tracing/CMakeLists.txt +++ b/examples/msg/tracing/CMakeLists.txt @@ -16,5 +16,4 @@ set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_f set(tesh_files ${tesh_files} PARENT_SCOPE) set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/simple.c PARENT_SCOPE) -set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/deployment.xml - ${CMAKE_CURRENT_SOURCE_DIR}/procmig-deploy.xml PARENT_SCOPE) +set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/deployment.xml PARENT_SCOPE) diff --git a/examples/msg/tracing/categories.c b/examples/msg/tracing/categories.c index 43963e314a..22d2c47801 100644 --- a/examples/msg/tracing/categories.c +++ b/examples/msg/tracing/categories.c @@ -78,10 +78,8 @@ static int slave(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/procmig-deploy.xml b/examples/msg/tracing/procmig-deploy.xml deleted file mode 100644 index 0f08ee07e8..0000000000 --- a/examples/msg/tracing/procmig-deploy.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/msg/tracing/procmig.c b/examples/msg/tracing/procmig.c index a98786ecee..78f3616100 100644 --- a/examples/msg/tracing/procmig.c +++ b/examples/msg/tracing/procmig.c @@ -74,20 +74,15 @@ static int master(int argc, char *argv[]) int main(int argc, char *argv[]) { MSG_init(&argc, argv); - if (argc < 3) { - XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]); - exit(1); - } + xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); MSG_create_environment(argv[1]); TRACE_category ("migration_order"); - /* Application deployment */ - MSG_function_register("emigrant", emigrant); - MSG_function_register("master", master); - MSG_launch_application(argv[2]); + 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_main(); return 0; -} /* end_of_main */ +} diff --git a/examples/msg/tracing/simple.c b/examples/msg/tracing/simple.c index 876828f186..27a08aa548 100644 --- a/examples/msg/tracing/simple.c +++ b/examples/msg/tracing/simple.c @@ -4,25 +4,18 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include #include "simgrid/msg.h" -#include "xbt/sysdep.h" /* calloc, printf */ /** @addtogroup MSG_examples * * @section MSG_ex_tracing Tracing and vizualisation features * - * - tracing/simple.c very simple program where each process creates, executes and - * destroy a task. You might want to run this program with the following parameters: + * - tracing/simple.c very simple program where each process creates, executes and destroy a task. You might want + * to run this program with the following parameters: * --cfg=tracing/uncategorized:yes * (See \ref tracing_tracing_options for details) */ -/* Create a log channel to have nice outputs. */ -#include "xbt/log.h" -#include "xbt/asserts.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); - static int simple_func(int argc, char *argv[]) { msg_task_t task = MSG_task_create("task", 100, 0, NULL); @@ -34,16 +27,11 @@ static int simple_func(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 > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); MSG_create_environment(argv[1]); - - MSG_function_register("master", simple_func); - MSG_function_register("slave", simple_func); - MSG_launch_application(argv[2]); + MSG_process_create("simple_func", simple_func, NULL, MSG_get_host_by_name("Tremblay")); + MSG_process_create("simple_func", simple_func, NULL, MSG_get_host_by_name("Fafard")); MSG_main(); return 0; diff --git a/examples/msg/tracing/trace_platform.c b/examples/msg/tracing/trace_platform.c index 9431a5fc6a..6cb9d80f7f 100644 --- a/examples/msg/tracing/trace_platform.c +++ b/examples/msg/tracing/trace_platform.c @@ -15,16 +15,10 @@ #include "simgrid/msg.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); - int main(int argc, char *argv[]) { MSG_init(&argc, argv); - if (argc < 2) { - printf("Usage: %s platform_file\n", argv[0]); - exit(1); - } - + xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]); MSG_create_environment(argv[1]); MSG_main(); return 0; diff --git a/examples/msg/tracing/trace_platform.tesh b/examples/msg/tracing/trace_platform.tesh index 0c61bfcab4..6b0bb20fd7 100644 --- a/examples/msg/tracing/trace_platform.tesh +++ b/examples/msg/tracing/trace_platform.tesh @@ -1,6 +1,5 @@ #! ./tesh - p Tracing master/slave application $ $SG_TEST_EXENV ${bindir:=.}/tracing/trace_platform$EXEEXT --cfg=tracing:yes --cfg=tracing/filename:tracing/trace_platform.trace --cfg=tracing/categorized:yes ${srcdir:=.}/../platforms/small_platform.xml > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'