From: Frederic Suter Date: Mon, 7 Mar 2016 09:11:08 +0000 (+0100) Subject: adopt good practices for s4u too X-Git-Tag: v3_13~512 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1776f894cccfa2a6d9f7059772089eb35f1a8ebb?hp=e9571b9009e090c9b59c6ccc1f6a0167fd868e91 adopt good practices for s4u too --- diff --git a/.gitignore b/.gitignore index 5ea3ec481b..541308e5e7 100644 --- a/.gitignore +++ b/.gitignore @@ -189,6 +189,7 @@ examples/msg/properties/msg_prop examples/msg/semaphores/synchro examples/msg/sendrecv/sendrecv examples/msg/sendrecv/sendrecv_main +examples/msg/set-maestro/set-maestro examples/msg/simulation.trace examples/msg/start_kill_time/sk_time examples/msg/suspend/suspend @@ -209,6 +210,8 @@ examples/msg/tracing/volume examples/msg/volume.trace examples/msg/z_gtnets.trace examples/msg/zmsg_test.trace +examples/s4u/basic/s4u_basic +examples/s4u/io/s4u_io examples/simdag/dax/dax_test examples/simdag/dot/dot_test examples/simdag/dot/dot_test2 diff --git a/examples/s4u/CMakeLists.txt b/examples/s4u/CMakeLists.txt index a092a3dbf8..8576a7ddbb 100644 --- a/examples/s4u/CMakeLists.txt +++ b/examples/s4u/CMakeLists.txt @@ -1,4 +1,13 @@ -set(txt_files - ${txt_files} - ${CMAKE_CURRENT_SOURCE_DIR}/README - PARENT_SCOPE) \ No newline at end of file +foreach (example basic io) + add_executable (s4u_${example} ${example}/s4u_${example}.cpp) + target_link_libraries(s4u_${example} simgrid) + set_target_properties(s4u_${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example}) + + set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u_${example}.tesh) + set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u_${example}.cpp) + ADD_TESH_FACTORIES(s4u-${example} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/s4u/${example} --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example} s4u_${example}.tesh) +endforeach() + +set(examples_src ${examples_src} PARENT_SCOPE) +set(tesh_files ${tesh_files} PARENT_SCOPE) +set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/README PARENT_SCOPE) \ No newline at end of file diff --git a/examples/s4u/README b/examples/s4u/README index 48f7ff46bf..6c6dc9cb3c 100644 --- a/examples/s4u/README +++ b/examples/s4u/README @@ -1,7 +1,5 @@ -S4U (Simgrid for you) is the next interface of SimGrid, expected to be -released with SimGrid 4.0. +S4U (Simgrid for you) is the next interface of SimGrid, expected to be released with SimGrid 4.0. -Even if it's in a very preliminary state so far, you are welcome to -try it and report any interface glitches that you see. Be however -warned that the interface will be modified until its final release. +Even if it's in a very preliminary state so far, you are welcome to try it and report any interface glitches that you +see. Be however warned that the interface will be modified until its final release. You will have to adapt your code on the way. \ No newline at end of file diff --git a/examples/s4u/basic/CMakeLists.txt b/examples/s4u/basic/CMakeLists.txt deleted file mode 100644 index 272b30207f..0000000000 --- a/examples/s4u/basic/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -add_executable (s4u_basic s4u_basic.cpp) -target_link_libraries(s4u_basic simgrid) - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/s4u_basic.tesh - PARENT_SCOPE) -set(examples_src - ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/s4u_basic.cpp - PARENT_SCOPE) diff --git a/examples/s4u/io/CMakeLists.txt b/examples/s4u/io/CMakeLists.txt deleted file mode 100644 index d61f16b6ce..0000000000 --- a/examples/s4u/io/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -add_executable (s4u_io_test s4u_io_test.cpp) -target_link_libraries(s4u_io_test simgrid) - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/s4u_io.tesh - PARENT_SCOPE) -set(examples_src - ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/s4u_io_test.cpp - PARENT_SCOPE) diff --git a/examples/s4u/io/s4u_io_test.cpp b/examples/s4u/io/s4u_io.cpp similarity index 100% rename from examples/s4u/io/s4u_io_test.cpp rename to examples/s4u/io/s4u_io.cpp diff --git a/examples/s4u/io/s4u_io.tesh b/examples/s4u/io/s4u_io.tesh index 7557d493d8..0a17043aa8 100644 --- a/examples/s4u/io/s4u_io.tesh +++ b/examples/s4u/io/s4u_io.tesh @@ -1,6 +1,6 @@ #! ./tesh -$ $SG_TEST_EXENV ${bindir:=.}/s4u_io_test +$ $SG_TEST_EXENV ${bindir:=.}/s4u_io > [denise:host:(0) 0.000000] [s4u_test/INFO] Storage info on denise: > [denise:host:(0) 0.000000] [s4u_test/INFO] Disk4 (/home) Used: 13221994; Free: 536857690006; Total: 536870912000. > [denise:host:(0) 0.000000] [s4u_test/INFO] Disk2 (c:) Used: 2391537133; Free: 534479374867; Total: 536870912000. diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 295dcb71ca..01dfb03fbd 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -999,8 +999,6 @@ set(CMAKEFILES_TXT examples/msg/tracing/CMakeLists.txt examples/s4u/CMakeLists.txt - examples/s4u/basic/CMakeLists.txt - examples/s4u/io/CMakeLists.txt examples/simdag/CMakeLists.txt examples/simdag/dax/CMakeLists.txt diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index 25793ed70b..50db16ed46 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -128,7 +128,6 @@ IF(NOT enable_memcheck) ## INTERFACES ## ### MSG ### # BEGIN TESH TESTS - ADD_TESH(tracing-ms --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/ms.tesh) ADD_TESH(tracing-trace-platform --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/trace_platform.tesh) ADD_TESH(tracing-user-variables --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/user_variables.tesh) @@ -138,10 +137,6 @@ IF(NOT enable_memcheck) ADD_TESH(tracing-process-migration --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/procmig.tesh) # END TESH TESTS - ### S4U ### - ADD_TESH_FACTORIES(s4u-basic "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/s4u/basic --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/basic s4u_basic.tesh) - ADD_TESH_FACTORIES(s4u-io "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/s4u/io --cd ${CMAKE_HOME_DIRECTORY}/examples/s4u/io s4u_io.tesh) - ### SIMDAG ### # BEGIN TESH TESTS # these tests need the assertion mechanism