From: Arnaud Giersch Date: Thu, 31 Jan 2013 21:05:30 +0000 (+0100) Subject: Merge branch 'with_java' X-Git-Tag: v3_9_90~569 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e0188e2a2598ce57a4d21a3d7eb5f303aecaf0dd?hp=c5e0ef2257e5f14e6204b52174003b3d9901c9eb Merge branch 'with_java' --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f1436e5c5..a1b4f44744 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,4 @@ cmake_minimum_required(VERSION 2.6) - -IF(CMAKE_BUILD_TYPE STREQUAL "ModelChecker") - SET(enable_coverage ON) - SET(enable_model-checking ON) - SET(enable_lua ON) - SET(enable_compile_optimization OFF) -ENDIF() - ### Need to set rc ccompiler before enable language if(WIN32) SET(CMAKE_RC_COMPILER "windres") diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index 283893ca40..d5e39396f4 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -287,6 +287,7 @@ set(EXTRA_DIST #* ****************************************************************************************** *# set(SIMDAG_SRC + src/simdag/instr_sd_task.c src/simdag/sd_daxloader.c src/simdag/sd_global.c src/simdag/sd_link.c diff --git a/buildtools/Cmake/Distrib.cmake b/buildtools/Cmake/Distrib.cmake index 6ae9a00a1e..6e4ccb2035 100644 --- a/buildtools/Cmake/Distrib.cmake +++ b/buildtools/Cmake/Distrib.cmake @@ -260,6 +260,7 @@ add_custom_command( add_custom_target(dist COMMENT "Removing the distribution directory" DEPENDS ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-${release_version}.tar.gz + COMMAND ${CMAKE_COMMAND} -E echo ${PROJECT_NAME}-${release_version} > ${CMAKE_BINARY_DIR}/VERSION COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_NAME}-${release_version}/ ) diff --git a/doc/doxygen/inside_extending.doc b/doc/doxygen/inside_extending.doc index 6332d506d2..554ab1746b 100644 --- a/doc/doxygen/inside_extending.doc +++ b/doc/doxygen/inside_extending.doc @@ -39,6 +39,49 @@ user@caraja:~/workspace/simgrid/src$ cg "TUTORIAL: New model" 7 include/surf/surf.h 661 /* TUTORIAL: New model*/ \endverbatim +\section simgrid_dev_guide_simcall How to add a new simcall? +To add a simcall called `` with three arguments `arg1`, `arg2` and `arg3` +of type `targ1`, `targ2`, `targ3` respectively and which return a value of +type `tret` you must first define the simcall function in the the +`include/simgrid/simix.h` and make it call the automatically generated `BODY` +function which will do all the bad stuff. + +~~~~{.c} +tret simcall_(targ1 arg1, targ2 arg2, targ3 arg3){ + return simcall_BODY_(arg1, arg2, arg3); +} +~~~~ + +Then you must add an new line in the list `SIMCALL_LIST1` of simcall actions in +`src/simix/smx_smurf_private.h`. The arguments of the `ACTION` are: +- the simcall enum name, +- the `` of the simcall, +- if the result must be automatically saved in the simcall + (`WITH_ANSWER`/`WITHOUT_ANSWER`) +- the return type, +- the arguments. + +The return type and the arguments must be define by using `TSPEC(name, type)`, +or one of the predefined type (e.g., `TSTRING(n)`, `TINT(n)`, `TVOID(n)`, +`TPTR(n)`, …). You must get something like this: + +~~~~{.c} +ACTION(SIMCALL_, , WITH_ANSWER, TSPEC(result, tret), TSPEC(arg1, targ1), TSPEC(arg2, targ2), TSPEC(arg3, targ3)) sep \ +~~~~ + +Finaly you have to define the kernel code in a `SIMIX_pre_` in the +corresponding src/simix/smx_*.c file: + +~~~~{.c} +tret SIMIX_pre_(smx_simcall_t simcall, targ1 arg1, targ2 arg2, targ3 arg3) { + SIMIX_(arg1, arg2, arg3); +} + +tret SIMIX_(targ1 arg1, targ2 arg2, targ3 arg3) { + // Your code in kernel mode +} +~~~~ + \section simgrid_dev_guide_tag What is How to add a new tag for xml files? Search for expression \"TUTORIAL: New TAG\". \verbatim diff --git a/examples/simdag/dax/smalldax.tesh b/examples/simdag/dax/smalldax.tesh index 0021c0cc26..20db4b6a2b 100644 --- a/examples/simdag/dax/smalldax.tesh +++ b/examples/simdag/dax/smalldax.tesh @@ -9,6 +9,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/dax_test --log=no_loc ../2clusters.xml ./smalldax. > [0.000000] [sd_task/INFO] Displaying task root > [0.000000] [sd_task/INFO] - state: schedulable not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: COMP_SEQ > [0.000000] [sd_task/INFO] - amount: 0 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 0 > [0.000000] [sd_task/INFO] - post-dependencies: @@ -17,6 +18,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/dax_test --log=no_loc ../2clusters.xml ./smalldax. > [0.000000] [sd_task/INFO] Displaying task 1@task1 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: task1 > [0.000000] [sd_task/INFO] - amount: 42000000000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -27,6 +29,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/dax_test --log=no_loc ../2clusters.xml ./smalldax. > [0.000000] [sd_task/INFO] Displaying task 2@task2 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: task2 > [0.000000] [sd_task/INFO] - amount: 42000000000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -37,6 +40,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/dax_test --log=no_loc ../2clusters.xml ./smalldax. > [0.000000] [sd_task/INFO] Displaying task 3@task1 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: task1 > [0.000000] [sd_task/INFO] - amount: 42000000000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 4 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -49,6 +53,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/dax_test --log=no_loc ../2clusters.xml ./smalldax. > [0.000000] [sd_task/INFO] Displaying task root_i2_2@task2 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 1000000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -58,6 +63,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/dax_test --log=no_loc ../2clusters.xml ./smalldax. > [0.000000] [sd_task/INFO] Displaying task 1@task1_o1_3@task1 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: task1 > [0.000000] [sd_task/INFO] - amount: 1000000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -67,6 +73,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/dax_test --log=no_loc ../2clusters.xml ./smalldax. > [0.000000] [sd_task/INFO] Displaying task 2@task2_o2_3@task1 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: task2 > [0.000000] [sd_task/INFO] - amount: 1000000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -76,6 +83,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/dax_test --log=no_loc ../2clusters.xml ./smalldax. > [0.000000] [sd_task/INFO] Displaying task 3@task1_o3_end > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: task1 > [0.000000] [sd_task/INFO] - amount: 4167312 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -85,6 +93,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/dax_test --log=no_loc ../2clusters.xml ./smalldax. > [0.000000] [sd_task/INFO] Displaying task root_i1_1@task1 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 1000000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -94,6 +103,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/dax_test --log=no_loc ../2clusters.xml ./smalldax. > [0.000000] [sd_task/INFO] Displaying task end > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: COMP_SEQ > [0.000000] [sd_task/INFO] - amount: 0 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: diff --git a/examples/simdag/dot/test_simdag_dotload.tesh b/examples/simdag/dot/test_simdag_dotload.tesh index 5a9629fa9f..36f69d9d4e 100644 --- a/examples/simdag/dot/test_simdag_dotload.tesh +++ b/examples/simdag/dot/test_simdag_dotload.tesh @@ -1,12 +1,23 @@ #! ./tesh p Test the loader of DAG written in the DOT format -$ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot +$ $SG_TEST_EXENV ./dot_test --log=no_loc ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07 +> [0.000000] [sd_dotparse/WARNING] 'end' node is explicitly declared in the DOT file. Update it +> [0.000000] [sd_dotparse/WARNING] 0->1 already exists +> [0.000000] [sd_dotparse/WARNING] 1->2 already exists +> [0.000000] [sd_dotparse/WARNING] 2->3 already exists +> [0.000000] [sd_dotparse/WARNING] 4->5 already exists +> [0.000000] [sd_dotparse/WARNING] 6->7 already exists +> [0.000000] [sd_dotparse/WARNING] 7->end already exists +> [0.000000] [sd_dotparse/WARNING] 7->8 already exists +> [0.000000] [sd_dotparse/WARNING] 'root' node is explicitly declared in the DOT file. Update it +> [0.000000] [sd_dotparse/WARNING] root->5 already exists > [0.000000] [test/INFO] ------------------- Display all tasks of the loaded DAG --------------------------- > [0.000000] [sd_task/INFO] Displaying task root > [0.000000] [sd_task/INFO] - state: schedulable not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: COMP_SEQ > [0.000000] [sd_task/INFO] - amount: 0 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 0 > [0.000000] [sd_task/INFO] - post-dependencies: @@ -15,6 +26,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 0 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskA > [0.000000] [sd_task/INFO] - amount: 10000000129 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -24,6 +36,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 1 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskA > [0.000000] [sd_task/INFO] - amount: 10000000131 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -33,6 +46,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 2 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskA > [0.000000] [sd_task/INFO] - amount: 10000000121 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -42,6 +56,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 3 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskA > [0.000000] [sd_task/INFO] - amount: 10000000231 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -51,6 +66,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 4 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskB > [0.000000] [sd_task/INFO] - amount: 10000000005 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -60,16 +76,18 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 5 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskB > [0.000000] [sd_task/INFO] - amount: 10000000046 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 2 > [0.000000] [sd_task/INFO] - pre-dependencies: -> [0.000000] [sd_task/INFO] root->5 > [0.000000] [sd_task/INFO] 4->5 +> [0.000000] [sd_task/INFO] root->5 > [0.000000] [sd_task/INFO] - post-dependencies: > [0.000000] [sd_task/INFO] 6 > [0.000000] [sd_task/INFO] Displaying task 6 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskB > [0.000000] [sd_task/INFO] - amount: 10000000092 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -79,16 +97,18 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 7 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskB > [0.000000] [sd_task/INFO] - amount: 10000000041 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: > [0.000000] [sd_task/INFO] 6->7 > [0.000000] [sd_task/INFO] - post-dependencies: -> [0.000000] [sd_task/INFO] 7->end > [0.000000] [sd_task/INFO] 7->8 +> [0.000000] [sd_task/INFO] 7->end > [0.000000] [sd_task/INFO] Displaying task 8 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskC > [0.000000] [sd_task/INFO] - amount: 10000000250 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -98,6 +118,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 9 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskC > [0.000000] [sd_task/INFO] - amount: 10000000079 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -107,6 +128,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 2->3 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10002 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -116,6 +138,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 6->7 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10005 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -125,6 +148,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task root->5 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10014000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -134,6 +158,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 1->2 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10004 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -143,6 +168,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 7->end > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10014000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -152,6 +178,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 0->1 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: oi > [0.000000] [sd_task/INFO] - amount: 10001 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -161,6 +188,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 4->5 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10029 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -170,6 +198,7 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task 7->8 > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -179,11 +208,12 @@ $ $SG_TEST_EXENV ./dot_test ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag.dot > [0.000000] [sd_task/INFO] Displaying task end > [0.000000] [sd_task/INFO] - state: not scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation -> [0.000000] [sd_task/INFO] - amount: 0 +> [0.000000] [sd_task/INFO] - tracing category: COMP_SEQ +> [0.000000] [sd_task/INFO] - amount: 10000000129 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 2 > [0.000000] [sd_task/INFO] - pre-dependencies: -> [0.000000] [sd_task/INFO] 9 > [0.000000] [sd_task/INFO] 7->end +> [0.000000] [sd_task/INFO] 9 > [0.000000] [test/INFO] ------------------- Schedule tasks --------------------------- > [0.000000] [test/INFO] ------------------- Run the schedule --------------------------- > [60.002281] [test/INFO] ------------------- Produce the trace file--------------------------- @@ -217,19 +247,29 @@ $ cat ${srcdir:=.}/dag.trace > [18.001520] C1-01 recv C1-00 10029.262823 # 4->5 > [48.001901] C1-03 send C1-04 10000.234049 # 7->8 > [48.002281] C1-04 recv C1-03 10000.234049 # 7->8 -> [60.002281] C2-05 compute 0.000000 # end +> [60.002281] C2-05 compute 10000000129.452715 # end $ rm -f dag.trace ! expect signal SIGABRT $ $SG_TEST_EXENV ./simulate_dot --log=no_loc "--log=sd_dotparse.thres:verbose" ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag_with_bad_schedule.dot > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07 +> [0.000000] [sd_dotparse/WARNING] 'end' node is explicitly declared in the DOT file. Update it > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, there are not enough computers +> [0.000000] [sd_dotparse/WARNING] 0->1 already exists > [0.000000] [sd_dotparse/WARNING] is not an integer > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, the task 1 is not correctly scheduled +> [0.000000] [sd_dotparse/WARNING] 1->2 already exists > [0.000000] [sd_dotparse/VERBOSE] The task 0 starts on the computer 1 at the position : 1 like the task 2 +> [0.000000] [sd_dotparse/WARNING] 2->3 already exists > [0.000000] [sd_dotparse/WARNING] is not an integer > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, the task 3 is not correctly scheduled +> [0.000000] [sd_dotparse/WARNING] 4->5 already exists +> [0.000000] [sd_dotparse/WARNING] 6->7 already exists +> [0.000000] [sd_dotparse/WARNING] 7->end already exists +> [0.000000] [sd_dotparse/WARNING] 7->8 already exists +> [0.000000] [sd_dotparse/WARNING] 'root' node is explicitly declared in the DOT file. Update it +> [0.000000] [sd_dotparse/WARNING] root->5 already exists > [0.000000] [sd_dotparse/WARNING] is not an integer > [0.000000] [sd_dotparse/WARNING] is not an integer > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, the task root is not correctly scheduled @@ -238,19 +278,31 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc "--log=sd_dotparse.thres:verbose" $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag_with_good_schedule.dot > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07 +> [0.000000] [sd_dotparse/WARNING] 'end' node is explicitly declared in the DOT file. Update it +> [0.000000] [sd_dotparse/WARNING] 'root' node is explicitly declared in the DOT file. Update it +> [0.000000] [sd_dotparse/WARNING] 0->2 already exists +> [0.000000] [sd_dotparse/WARNING] 1->2 already exists +> [0.000000] [sd_dotparse/WARNING] 2->3 already exists +> [0.000000] [sd_dotparse/WARNING] root->5 already exists +> [0.000000] [sd_dotparse/WARNING] 4->5 already exists +> [0.000000] [sd_dotparse/WARNING] 6->7 already exists +> [0.000000] [sd_dotparse/WARNING] 7->end already exists +> [0.000000] [sd_dotparse/WARNING] 7->8 already exists > [0.000000] [test/INFO] ------------------- Display all tasks of the loaded DAG --------------------------- > [0.000000] [sd_task/INFO] Displaying task root > [0.000000] [sd_task/INFO] - state: runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: COMP_SEQ > [0.000000] [sd_task/INFO] - amount: 0 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 0 > [0.000000] [sd_task/INFO] - post-dependencies: +> [0.000000] [sd_task/INFO] root->5 > [0.000000] [sd_task/INFO] 0 > [0.000000] [sd_task/INFO] 1 -> [0.000000] [sd_task/INFO] root->5 > [0.000000] [sd_task/INFO] Displaying task 0 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskA > [0.000000] [sd_task/INFO] - amount: 10000000129 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -261,6 +313,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 1 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskA > [0.000000] [sd_task/INFO] - amount: 10000000131 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -271,11 +324,12 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 2 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskA > [0.000000] [sd_task/INFO] - amount: 10000000121 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 3 > [0.000000] [sd_task/INFO] - pre-dependencies: -> [0.000000] [sd_task/INFO] 1->2 > [0.000000] [sd_task/INFO] 0->2 +> [0.000000] [sd_task/INFO] 1->2 > [0.000000] [sd_task/INFO] 0 > [0.000000] [sd_task/INFO] - post-dependencies: > [0.000000] [sd_task/INFO] 2->3 @@ -283,6 +337,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 3 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskA > [0.000000] [sd_task/INFO] - amount: 10000000231 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 2 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -294,6 +349,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 4 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskB > [0.000000] [sd_task/INFO] - amount: 10000000005 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 2 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -305,6 +361,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 5 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskB > [0.000000] [sd_task/INFO] - amount: 10000000046 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 3 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -316,6 +373,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 6 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskB > [0.000000] [sd_task/INFO] - amount: 10000000092 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -326,18 +384,20 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 7 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskB > [0.000000] [sd_task/INFO] - amount: 10000000041 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 2 > [0.000000] [sd_task/INFO] - pre-dependencies: > [0.000000] [sd_task/INFO] 6->7 > [0.000000] [sd_task/INFO] 6 > [0.000000] [sd_task/INFO] - post-dependencies: -> [0.000000] [sd_task/INFO] 7->end > [0.000000] [sd_task/INFO] 7->8 +> [0.000000] [sd_task/INFO] 7->end > [0.000000] [sd_task/INFO] end > [0.000000] [sd_task/INFO] Displaying task 8 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskC > [0.000000] [sd_task/INFO] - amount: 10000000250 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 2 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -348,6 +408,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 9 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation +> [0.000000] [sd_task/INFO] - tracing category: taskC > [0.000000] [sd_task/INFO] - amount: 10000000079 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -357,6 +418,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 2->3 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10002 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -366,6 +428,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 6->7 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10005 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -375,6 +438,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task root->5 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10014000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -384,6 +448,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 1->2 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10004 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -393,6 +458,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 7->end > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10014000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -402,6 +468,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 0->2 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: oi > [0.000000] [sd_task/INFO] - amount: 10001 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -411,6 +478,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 4->5 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10029 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -420,6 +488,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task 7->8 > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: end-to-end communication +> [0.000000] [sd_task/INFO] - tracing category: COMM_E2E > [0.000000] [sd_task/INFO] - amount: 10000 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 1 > [0.000000] [sd_task/INFO] - pre-dependencies: @@ -429,11 +498,12 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${src > [0.000000] [sd_task/INFO] Displaying task end > [0.000000] [sd_task/INFO] - state: scheduled not runnable > [0.000000] [sd_task/INFO] - kind: sequential computation -> [0.000000] [sd_task/INFO] - amount: 0 +> [0.000000] [sd_task/INFO] - tracing category: COMP_SEQ +> [0.000000] [sd_task/INFO] - amount: 10000000129 > [0.000000] [sd_task/INFO] - Dependencies to satisfy: 3 > [0.000000] [sd_task/INFO] - pre-dependencies: -> [0.000000] [sd_task/INFO] 9 > [0.000000] [sd_task/INFO] 7->end +> [0.000000] [sd_task/INFO] 9 > [0.000000] [sd_task/INFO] 7 > [0.000000] [test/INFO] ------------------- Run the schedule --------------------------- > [18.000866] [test/INFO] ------------------- Produce the trace file--------------------------- @@ -467,7 +537,7 @@ $ cat ${srcdir:=.}/dag_with_good_schedule.trace > [8.000450] C2-05 recv C2-05 10029.262823 # 4->5 > [14.000485] C2-05 send C2-06 10000.234049 # 7->8 > [14.000865] C2-06 recv C2-05 10000.234049 # 7->8 -> [18.000866] C2-05 compute 0.000000 # end +> [18.000866] C2-05 compute 10000000129.452715 # end $ rm -f ${srcdir:=.}/dag_with_good_schedule.trace @@ -475,6 +545,16 @@ $ rm -f ${srcdir:=.}/dag_with_good_schedule.trace ! expect signal SIGABRT $ $SG_TEST_EXENV ./dot_test --log=no_loc ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag_with_cycle.dot > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07 +> [0.000000] [sd_dotparse/WARNING] 'end' node is explicitly declared in the DOT file. Update it +> [0.000000] [sd_dotparse/WARNING] 0->2 already exists +> [0.000000] [sd_dotparse/WARNING] 1->2 already exists +> [0.000000] [sd_dotparse/WARNING] 2->3 already exists +> [0.000000] [sd_dotparse/WARNING] 4->5 already exists +> [0.000000] [sd_dotparse/WARNING] 6->7 already exists +> [0.000000] [sd_dotparse/WARNING] 7->end already exists +> [0.000000] [sd_dotparse/WARNING] 7->8 already exists +> [0.000000] [sd_dotparse/WARNING] 'root' node is explicitly declared in the DOT file. Update it +> [0.000000] [sd_dotparse/WARNING] root->5 already exists > [0.000000] [sd_daxparse/WARNING] the task root is not marked > [0.000000] [sd_daxparse/WARNING] the task 0 is in a cycle > [0.000000] [sd_daxparse/WARNING] the task 1 is in a cycle diff --git a/examples/simdag/simdag_trace.c b/examples/simdag/simdag_trace.c index a39a9b8d47..7452e70eb4 100644 --- a/examples/simdag/simdag_trace.c +++ b/examples/simdag/simdag_trace.c @@ -62,9 +62,9 @@ int main(int argc, char **argv) TRACE_category ("taskA"); TRACE_category ("taskB"); TRACE_category ("taskC"); - SD_task_set_category (taskA, "taskA"); - SD_task_set_category (taskB, "taskB"); - SD_task_set_category (taskC, "taskC"); + TRACE_sd_set_task_category (taskA, "taskA"); + TRACE_sd_set_task_category (taskB, "taskB"); + TRACE_sd_set_task_category (taskC, "taskC"); /* if everything is ok, no exception is forwarded or rethrown by main() */ diff --git a/examples/simdag/test_simdag_fail.tesh b/examples/simdag/test_simdag_fail.tesh index 9d87dfce86..a8fabd3827 100644 --- a/examples/simdag/test_simdag_fail.tesh +++ b/examples/simdag/test_simdag_fail.tesh @@ -9,6 +9,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/sd_fail > [10.000000] [sd_task/INFO] Displaying task Poor task > [10.000000] [sd_task/INFO] - state: not runnable failed > [10.000000] [sd_task/INFO] - kind: sequential computation +> [10.000000] [sd_task/INFO] - tracing category: COMP_SEQ > [10.000000] [sd_task/INFO] - amount: 20000000000 > [10.000000] [sd_task/INFO] - Dependencies to satisfy: 0 > [10.000000] [sd_fail/INFO] Task 'Poor task' has failed. 20000000000 flops remain to be done @@ -17,6 +18,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/sd_fail > [50.000000] [sd_task/INFO] Displaying task Poor task > [50.000000] [sd_task/INFO] - state: not runnable done > [50.000000] [sd_task/INFO] - kind: sequential computation +> [50.000000] [sd_task/INFO] - tracing category: COMP_SEQ > [50.000000] [sd_task/INFO] - amount: 20000000000 > [50.000000] [sd_task/INFO] - Dependencies to satisfy: 0 > [50.000000] [sd_fail/INFO] Task 'Poor task' start time: 10.000000, finish time: 50.000000 diff --git a/examples/simdag/test_simdag_tracing.tesh b/examples/simdag/test_simdag_tracing.tesh index 34b8439e71..b41312661a 100644 --- a/examples/simdag/test_simdag_tracing.tesh +++ b/examples/simdag/test_simdag_tracing.tesh @@ -248,12 +248,16 @@ $ tail -n +3 ./simgrid.trace > 16 0 7 0 topology 21 22 > 15 0 8 0 topology 21 23 > 16 0 8 0 topology 8 23 -> 1 9 3 btaskA "0.800026 0.545312 0.857926" -> 1 10 1 ptaskA "0.800026 0.545312 0.857926" -> 1 11 3 btaskB "0.904944 0.089118 0.069832" -> 1 12 1 ptaskB "0.904944 0.089118 0.069832" -> 1 13 3 btaskC "0.696799 0.247098 0.497311" -> 1 14 1 ptaskC "0.696799 0.247098 0.497311" +> 1 9 3 bCOMP_SEQ "0.800026 0.545312 0.857926" +> 1 10 1 pCOMP_SEQ "0.800026 0.545312 0.857926" +> 1 11 3 bCOMM_E2E "0.904944 0.089118 0.069832" +> 1 12 1 pCOMM_E2E "0.904944 0.089118 0.069832" +> 1 13 3 btaskA "0.696799 0.247098 0.497311" +> 1 14 1 ptaskA "0.696799 0.247098 0.497311" +> 1 15 3 btaskB "0.623917 0.040883 0.634111" +> 1 16 1 ptaskB "0.623917 0.040883 0.634111" +> 1 17 3 btaskC "0.832485 0.956278 0.337734" +> 1 18 1 ptaskC "0.832485 0.956278 0.337734" > 7 8.800300 1 10 > 7 8.800300 1 1 > 7 8.800300 1 3 diff --git a/include/instr/instr.h b/include/instr/instr.h index 3ff225ee22..29facc4ea4 100644 --- a/include/instr/instr.h +++ b/include/instr/instr.h @@ -23,6 +23,8 @@ XBT_PUBLIC(void) TRACE_category(const char *category); XBT_PUBLIC(void) TRACE_category_with_color (const char *category, const char *color); XBT_PUBLIC(xbt_dynar_t) TRACE_get_categories (void); XBT_PUBLIC(void) TRACE_smpi_set_category(const char *category); +XBT_PUBLIC(void) TRACE_sd_set_task_category(SD_task_t task, + const char *category); /* * Functions to manage tracing marks (used for trace comparison experiments) diff --git a/include/simdag/simdag.h b/include/simdag/simdag.h index 6c9a0834d5..9afe61d509 100644 --- a/include/simdag/simdag.h +++ b/include/simdag/simdag.h @@ -179,8 +179,6 @@ XBT_PUBLIC(void) SD_task_distribute_comp_amdhal(SD_task_t task, int ws_count); XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count, const SD_workstation_t * list); XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...); -XBT_PUBLIC(void) SD_task_set_category (SD_task_t task, const char *category); -XBT_PUBLIC(const char *) SD_task_get_category (SD_task_t task); /** @brief A constant to use in SD_task_schedule to mean that there is no cost. diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index b22e1e8c3c..a856c0bc37 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -357,8 +357,8 @@ XBT_PUBLIC(void *) simcall_process_get_data(smx_process_t process); XBT_PUBLIC(void) simcall_process_set_data(smx_process_t process, void *data); XBT_PUBLIC(smx_host_t) simcall_process_get_host(smx_process_t process); XBT_PUBLIC(const char *) simcall_process_get_name(smx_process_t process); -int simcall_process_get_PID(smx_process_t process); -int simcall_process_get_PPID(smx_process_t process); +XBT_PUBLIC(int) simcall_process_get_PID(smx_process_t process); +XBT_PUBLIC(int) simcall_process_get_PPID(smx_process_t process); XBT_PUBLIC(int) simcall_process_is_suspended(smx_process_t process); XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_process_t host); XBT_PUBLIC(void) simcall_process_set_kill_time(smx_process_t process, double kill_time); diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index 79b590d6d0..1e710f4493 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -92,6 +92,9 @@ XBT_PUBLIC(void) xbt_dynar_insert_at(xbt_dynar_t const dynar, const int idx, const void *src); XBT_PUBLIC(void) xbt_dynar_remove_at(xbt_dynar_t const dynar, const int idx, void *const dst); +XBT_PUBLIC(void) xbt_dynar_remove_n_at(xbt_dynar_t const dynar, + const unsigned int n, const int idx); + XBT_PUBLIC(unsigned int) xbt_dynar_search(xbt_dynar_t const dynar, void *elem); XBT_PUBLIC(signed int) xbt_dynar_search_or_negative(xbt_dynar_t const dynar, void *const elem); diff --git a/src/instr/instr_paje_trace.c b/src/instr/instr_paje_trace.c index 555ac028e8..e3d78b2f0b 100644 --- a/src/instr/instr_paje_trace.c +++ b/src/instr/instr_paje_trace.c @@ -224,15 +224,16 @@ void TRACE_paje_dump_buffer (int force) buffer = xbt_dynar_new (sizeof(paje_event_t), NULL); }else{ paje_event_t event; - while (!xbt_dynar_is_empty(buffer)){ - double head_timestamp = (*(paje_event_t*)xbt_dynar_get_ptr(buffer, 0))->timestamp; + unsigned int cursor; + xbt_dynar_foreach(buffer, cursor, event) { + double head_timestamp = event->timestamp; if (head_timestamp > TRACE_last_timestamp_to_dump){ break; } - xbt_dynar_remove_at (buffer, 0, &event); event->print (event); event->free (event); } + xbt_dynar_remove_n_at(buffer, cursor, 0); } XBT_DEBUG("%s: ends", __FUNCTION__); } diff --git a/src/simdag/instr_sd_task.c b/src/simdag/instr_sd_task.c new file mode 100644 index 0000000000..c4da12eea1 --- /dev/null +++ b/src/simdag/instr_sd_task.c @@ -0,0 +1,80 @@ +/* Copyright (c) 2013. The SimGrid Team. + * All rights reserved. */ + +/* 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 "instr/instr_private.h" +#include "private.h" +#include "simdag/datatypes.h" + +#ifdef HAVE_TRACING + +XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_sd, instr, "SD"); + +void TRACE_sd_set_task_category(SD_task_t task, const char *category){ + + //if user provides a NULL category, task is no longer traced + if (category == NULL) { + xbt_free (task->category); + task->category = NULL; + XBT_DEBUG("SD task %p(%s), category removed", task, task->name); + return; + } + + //set task category + task->category = xbt_strdup (category); + XBT_DEBUG("SD task %p(%s), category %s", task, task->name, task->category); +} + +void TRACE_sd_task_create(SD_task_t task) +{ + static long long counter = 0; + task->counter = counter++; + task->category = NULL; + + XBT_DEBUG("CREATE %p, %lld", task, task->counter); +} + +void TRACE_sd_task_execute_start(SD_task_t task) +{ + if (task->kind == SD_TASK_COMP_PAR_AMDAHL || task->kind == SD_TASK_COMP_SEQ){ + XBT_DEBUG("EXEC,in %p, %lld, %s", task, task->counter, task->category); +// int i; +// for (i = 0; i < task->workstation_nb; i++){ +// container_t workstation_container = +// PJ_container_get (SD_workstation_get_name(task->workstation_list[i])); +// char name[1024]; +// type_t type = PJ_type_get ("power_used", workstation_container->type); +// sprintf(name, "%s_ws_%d", SD_task_get_name(task), i); +// val_t value = PJ_value_new(name, "1 0 1", type); +// new_pajePushState (SD_get_clock(), workstation_container, type, value); +// } + } +} + +void TRACE_sd_task_execute_end(SD_task_t task) +{ + if (task->kind == SD_TASK_COMP_PAR_AMDAHL || task->kind == SD_TASK_COMP_SEQ){ + XBT_DEBUG("EXEC,out %p, %lld, %s", task, task->counter, task->category); +// int i; +// for (i = 0; i < task->workstation_nb; i++){ +// container_t workstation_container = +// PJ_container_get (SD_workstation_get_name(task->workstation_list[i])); +// type_t type = PJ_type_get ("power_used", workstation_container->type); +// new_pajePopState (SD_get_clock(), workstation_container, type); +// } + } +} + +void TRACE_sd_task_destroy(SD_task_t task) +{ + XBT_DEBUG("DESTROY %p, %lld, %s", task, task->counter, task->category); + + //free category + xbt_free(task->category); + task->category = NULL; + return; +} + +#endif /* HAVE_TRACING */ diff --git a/src/simdag/private.h b/src/simdag/private.h index e4025a39d3..e48de288e1 100644 --- a/src/simdag/private.h +++ b/src/simdag/private.h @@ -104,6 +104,7 @@ typedef struct SD_task { double rate; #ifdef HAVE_TRACING + long long int counter; /* task unique identifier for instrumentation */ char *category; /* sd task category for instrumentation */ #endif } s_SD_task_t; @@ -198,5 +199,12 @@ static XBT_INLINE int __SD_task_is_running(SD_task_t task) { return task->state_set == sd_global->running_task_set; } +/********** Tracing **********/ +/* declaration of instrumentation functions from sd_task_instr.c */ +void TRACE_sd_task_create(SD_task_t task); +void TRACE_sd_task_execute_start(SD_task_t task); +void TRACE_sd_task_execute_end(SD_task_t task); +void TRACE_sd_task_destroy(SD_task_t task); + #endif diff --git a/src/simdag/sd_daxloader.c b/src/simdag/sd_daxloader.c index a4364e7a92..9d9d6753b4 100644 --- a/src/simdag/sd_daxloader.c +++ b/src/simdag/sd_daxloader.c @@ -325,7 +325,7 @@ xbt_dynar_t SD_daxload(const char *filename) const char *category = depafter->src->category; if (category){ TRACE_category (category); - SD_task_set_category (newfile, category); + TRACE_sd_set_task_category(newfile, category); } } #endif @@ -341,7 +341,7 @@ xbt_dynar_t SD_daxload(const char *filename) const char *category = depbefore->src->category; if (category){ TRACE_category (category); - SD_task_set_category (newfile, category); + TRACE_sd_set_task_category(newfile, category); } } #endif @@ -363,7 +363,7 @@ xbt_dynar_t SD_daxload(const char *filename) const char *category = depbefore->src->category; if (category){ TRACE_category (category); - SD_task_set_category (newfile, category); + TRACE_sd_set_task_category(newfile, category); } } #endif @@ -418,7 +418,7 @@ void STag_dax__job(void) char *category = A_dax__job_name; if (category){ TRACE_category (category); - SD_task_set_category(current_job, category); + TRACE_sd_set_task_category(current_job, category); } #endif xbt_dict_set(jobs, A_dax__job_id, current_job, NULL); diff --git a/src/simdag/sd_dotloader.c b/src/simdag/sd_dotloader.c index 60b9f7517f..148b4d4781 100644 --- a/src/simdag/sd_dotloader.c +++ b/src/simdag/sd_dotloader.c @@ -105,11 +105,14 @@ static void dot_task_p_free(void *task) static void TRACE_sd_dotloader (SD_task_t task, const char *category) { - if (category){ - if (strlen (category) != 0){ - TRACE_category (category); - SD_task_set_category (task, category); - } + if (category && strlen (category)){ + if (task->category) + XBT_DEBUG("Change the category of %s from %s to %s", + task->name, task->category, category); + else + XBT_DEBUG("Set the category of %s to %s",task->name, category); + TRACE_category (category); + TRACE_sd_set_task_category(task, category); } } @@ -281,7 +284,7 @@ xbt_dynar_t SD_dotload_generic(const char * filename) dag_dot = agread(in_file, NIL(Agdisc_t *)); result = xbt_dynar_new(sizeof(SD_task_t), dot_task_p_free); - files = xbt_dict_new_homogeneous(&dot_task_free); + files = xbt_dict_new_homogeneous(NULL); jobs = xbt_dict_new_homogeneous(NULL); computers = xbt_dict_new_homogeneous(NULL); root_task = SD_task_create_comp_seq("root", NULL, 0); @@ -309,47 +312,23 @@ xbt_dynar_t SD_dotload_generic(const char * filename) SD_task_t file; char *name; xbt_dict_foreach(files, cursor, name, file) { - unsigned int cpt1, cpt2; - SD_task_t newfile = NULL; - SD_dependency_t depbefore, depafter; + XBT_DEBUG("Considering file '%s' stored in the dictionnary", + file->name); if (xbt_dynar_is_empty(file->tasks_before)) { - xbt_dynar_foreach(file->tasks_after, cpt2, depafter) { - SD_task_t newfile = - SD_task_create_comm_e2e(file->name, NULL, file->amount); - SD_task_dependency_add(NULL, NULL, root_task, newfile); - SD_task_dependency_add(NULL, NULL, newfile, depafter->dst); - xbt_dynar_push(result, &newfile); - } + XBT_DEBUG("file '%s' has no source. Add dependency from 'root'", + file->name); + SD_task_dependency_add(NULL, NULL, root_task, file); } else if (xbt_dynar_is_empty(file->tasks_after)) { - xbt_dynar_foreach(file->tasks_before, cpt2, depbefore) { - SD_task_t newfile = - SD_task_create_comm_e2e(file->name, NULL, file->amount); - SD_task_dependency_add(NULL, NULL, depbefore->src, newfile); - SD_task_dependency_add(NULL, NULL, newfile, end_task); - xbt_dynar_push(result, &newfile); - } - } else { - xbt_dynar_foreach(file->tasks_before, cpt1, depbefore) { - xbt_dynar_foreach(file->tasks_after, cpt2, depafter) { - if (depbefore->src == depafter->dst) { - XBT_WARN - ("File %s is produced and consumed by task %s. This loop dependency will prevent the execution of the task.", - file->name, depbefore->src->name); - } - newfile = - SD_task_create_comm_e2e(file->name, NULL, file->amount); - SD_task_dependency_add(NULL, NULL, depbefore->src, newfile); - SD_task_dependency_add(NULL, NULL, newfile, depafter->dst); - xbt_dynar_push(result, &newfile); - } - } + XBT_DEBUG("file '%s' has no destination. Add dependency to 'end'", + file->name); + SD_task_dependency_add(NULL, NULL, file, end_task); } + xbt_dynar_push(result, &file); } /* Push end task last */ xbt_dynar_push(result, &end_task); - /* Free previous copy of the files */ xbt_dict_free(&files); fclose(in_file); if (!acyclic_graph_detail(result)) { @@ -376,6 +355,15 @@ void dot_add_parallel_task(Agnode_t * dag_node) XBT_DEBUG("See ", name, agget(dag_node, (char *) "size"), amount, alpha); + if (!strcmp(name, "root")){ + XBT_WARN("'root' node is explicitly declared in the DOT file. Ignore it"); + return; + } + if (!strcmp(name, "end")){ + XBT_WARN("'end' node is explicitly declared in the DOT file. Ignore it"); + return; + } + current_job = xbt_dict_get_or_null(jobs, name); if (current_job == NULL) { current_job = @@ -417,12 +405,29 @@ void dot_add_task(Agnode_t * dag_node) XBT_DEBUG("See ", name, agget(dag_node, (char *) "size"), runtime); + + if (!strcmp(name, "root")){ + XBT_WARN("'root' node is explicitly declared in the DOT file. Update it"); + root_task->amount = runtime; +#ifdef HAVE_TRACING + TRACE_sd_dotloader (root_task, agget (dag_node, (char*)"category")); +#endif + } + + if (!strcmp(name, "end")){ + XBT_WARN("'end' node is explicitly declared in the DOT file. Update it"); + end_task->amount = runtime; +#ifdef HAVE_TRACING + TRACE_sd_dotloader (end_task, agget (dag_node, (char*)"category")); +#endif + } + current_job = xbt_dict_get_or_null(jobs, name); - if (current_job == NULL) { + if (!current_job) { current_job = SD_task_create_comp_seq(name, NULL , runtime); #ifdef HAVE_TRACING - TRACE_sd_dotloader (current_job, agget (dag_node, (char*)"category")); + TRACE_sd_dotloader (current_job, agget (dag_node, (char*)"category")); #endif xbt_dict_set(jobs, name, current_job, NULL); xbt_dynar_push(result, ¤t_job); @@ -511,7 +516,8 @@ void dot_add_input_dependencies(SD_task_t current_job, Agedge_t * edge, char *name = xbt_malloc((strlen(name_head)+strlen(name_tail)+6)*sizeof(char)); sprintf(name, "%s->%s", name_tail, name_head); double size = dot_parse_double(agget(edge, (char *) "size")); - XBT_DEBUG("size : %e, get size : %s", size, agget(edge, (char *) "size")); + XBT_DEBUG("add input -- edge: %s, size : %e, get size : %s", + name, size, agget(edge, (char *) "size")); if (size > 0) { file = xbt_dict_get_or_null(files, name); @@ -524,8 +530,10 @@ void dot_add_input_dependencies(SD_task_t current_job, Agedge_t * edge, #ifdef HAVE_TRACING TRACE_sd_dotloader (file, agget (edge, (char*)"category")); #endif + XBT_DEBUG("add input -- adding %s to the dict as new file", name); xbt_dict_set(files, name, file, NULL); } else { + XBT_WARN("%s already exists", name); if (SD_task_get_amount(file) != size) { XBT_WARN("Ignoring file %s size redefinition from %.0f to %.0f", name, SD_task_get_amount(file), size); @@ -553,7 +561,8 @@ void dot_add_output_dependencies(SD_task_t current_job, Agedge_t * edge, char *name = xbt_malloc((strlen(name_head)+strlen(name_tail)+6)*sizeof(char)); sprintf(name, "%s->%s", name_tail, name_head); double size = dot_parse_double(agget(edge, (char *) "size")); - XBT_DEBUG("size : %e, get size : %s", size, agget(edge, (char *) "size")); + XBT_DEBUG("add_output -- edge: %s, size : %e, get size : %s", + name, size, agget(edge, (char *) "size")); if (size > 0) { file = xbt_dict_get_or_null(files, name); @@ -566,8 +575,10 @@ void dot_add_output_dependencies(SD_task_t current_job, Agedge_t * edge, #ifdef HAVE_TRACING TRACE_sd_dotloader (file, agget (edge, (char*)"category")); #endif + XBT_DEBUG("add output -- adding %s to the dict as new file", name); xbt_dict_set(files, name, file, NULL); } else { + XBT_WARN("%s already exists", name); if (SD_task_get_amount(file) != size) { XBT_WARN("Ignoring file %s size redefinition from %.0f to %.0f", name, SD_task_get_amount(file), size); diff --git a/src/simdag/sd_task.c b/src/simdag/sd_task.c index 058e3bfb25..744e562da7 100644 --- a/src/simdag/sd_task.c +++ b/src/simdag/sd_task.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011. The SimGrid Team. +/* Copyright (c) 2006 - 2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -91,7 +91,7 @@ SD_task_t SD_task_create(const char *name, void *data, double amount) sd_global->task_number++; #ifdef HAVE_TRACING - task->category = NULL; + TRACE_sd_task_create(task); #endif return task; @@ -125,6 +125,12 @@ SD_task_t SD_task_create_comm_e2e(const char *name, void *data, SD_task_t res = SD_task_create_sized(name, data, amount, 2); res->communication_amount[2] = amount; res->kind = SD_TASK_COMM_E2E; + +#ifdef HAVE_TRACING + TRACE_category("COMM_E2E"); + TRACE_sd_set_task_category(res, "COMM_E2E"); +#endif + return res; } @@ -149,7 +155,13 @@ SD_task_t SD_task_create_comp_seq(const char *name, void *data, SD_task_t res = SD_task_create_sized(name, data, amount, 1); res->computation_amount[0] = amount; res->kind = SD_TASK_COMP_SEQ; - return res; + +#ifdef HAVE_TRACING + TRACE_category("COMP_SEQ"); + TRACE_sd_set_task_category(res, "COMP_SEQ"); +#endif + +return res; } /** @brief create a parallel computation task that can then be auto-scheduled @@ -178,6 +190,12 @@ SD_task_t SD_task_create_comp_par_amdahl(const char *name, void *data, SD_task_t res = SD_task_create(name, data, amount); res->alpha = alpha; res->kind = SD_TASK_COMP_PAR_AMDAHL; + +#ifdef HAVE_TRACING + TRACE_category("COMP_PAR_AMDAHL"); + TRACE_sd_set_task_category(res, "COMP_PAR_AMDAHL"); +#endif + return res; } @@ -206,6 +224,12 @@ SD_task_t SD_task_create_comm_par_mxn_1d_block(const char *name, void *data, SD_task_t res = SD_task_create(name, data, amount); res->workstation_list=NULL; res->kind = SD_TASK_COMM_PAR_MXN_1D_BLOCK; + +#ifdef HAVE_TRACING + TRACE_category("COMM_PAR_MXN_1D_BLOCK"); + TRACE_sd_set_task_category(res, "COMM_PAR_MXN_1D_BLOCK"); +#endif + return res; } @@ -240,7 +264,7 @@ void SD_task_destroy(SD_task_t task) xbt_free(task->computation_amount); #ifdef HAVE_TRACING - if (task->category) xbt_free(task->category); + TRACE_sd_task_destroy(task); #endif xbt_mallocator_release(sd_global->task_mallocator,task); @@ -525,6 +549,12 @@ void SD_task_dump(SD_task_t task) XBT_INFO(" - (unknown kind %d)", task->kind); } } + +#ifdef HAVE_TRACING + if (task->category) + XBT_INFO(" - tracing category: %s", task->category); +#endif + XBT_INFO(" - amount: %.0f", SD_task_get_amount(task)); if (task->kind == SD_TASK_COMP_PAR_AMDAHL) XBT_INFO(" - alpha: %.2f", task->alpha); @@ -1669,50 +1699,3 @@ void SD_task_schedulel(SD_task_t task, int count, ...) SD_task_schedulev(task, count, list); free(list); } - -/** - * \brief Sets the tracing category of a task. - * - * This function should be called after the creation of a - * SimDAG task, to define the category of that task. The first - * parameter must contain a task that was created with the - * function #SD_task_create. The second parameter must contain - * a category that was previously declared with the function - * #TRACE_category. - * - * \param task The task to be considered - * \param category the name of the category to be associated to the task - * - * \see SD_task_get_category, TRACE_category, TRACE_category_with_color - */ -void SD_task_set_category (SD_task_t task, const char *category) -{ -#ifdef HAVE_TRACING - if (!TRACE_is_enabled()) return; - if (task == NULL) return; - if (category == NULL){ - if (task->category) xbt_free (task->category); - task->category = NULL; - }else{ - task->category = xbt_strdup (category); - } -#endif -} - -/** - * \brief Gets the current tracing category of a task. - * - * \param task The task to be considered - * - * \see SD_task_set_category - * - * \return Returns the name of the tracing category of the given task, NULL otherwise - */ -const char *SD_task_get_category (SD_task_t task) -{ -#ifdef HAVE_TRACING - return task->category; -#else - return NULL; -#endif -} diff --git a/src/surf/storage_private.h b/src/surf/storage_private.h index c62f265fe8..30792454a0 100644 --- a/src/surf/storage_private.h +++ b/src/surf/storage_private.h @@ -1,9 +1,8 @@ -/* - * storage_private.h - * - * Created on: 2 mars 2012 - * Author: navarro - */ +/* Copyright (c) 2009, 2013. The SimGrid Team. + * All rights reserved. */ + +/* 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. */ #ifndef STORAGE_PRIVATE_H_ #define STORAGE_PRIVATE_H_ diff --git a/src/xbt/dynar.c b/src/xbt/dynar.c index 0fa7f41328..720b376b89 100644 --- a/src/xbt/dynar.c +++ b/src/xbt/dynar.c @@ -425,6 +425,45 @@ xbt_dynar_remove_at(xbt_dynar_t const dynar, dynar->used--; } +/** @brief Remove a slice of the dynar, sliding the rest of the values to the left + * + * This function removes an n-sized slice that starts at element idx. It is equivalent + * to xbt_dynar_remove_at with a NULL object argument if n equals to 1. + * + * Each of the removed elements is freed using the free_f function passed at dynar + * creation. + */ +void +xbt_dynar_remove_n_at(xbt_dynar_t const dynar, + const unsigned int n, const int idx) +{ + unsigned long nb_shift; + unsigned long offset; + unsigned long cur; + + if (!n) return; + + _sanity_check_dynar(dynar); + _check_inbound_idx(dynar, idx); + _check_inbound_idx(dynar, idx + n - 1); + + if (dynar->free_f) { + for (cur = idx; cur < idx + n; cur++) { + dynar->free_f(_xbt_dynar_elm(dynar, cur)); + } + } + + nb_shift = dynar->used - n - idx; + + if (nb_shift) { + offset = nb_shift * dynar->elmsize; + memmove(_xbt_dynar_elm(dynar, idx), _xbt_dynar_elm(dynar, idx + n), + offset); + } + + dynar->used -= n; +} + /** @brief Returns the position of the element in the dynar * * Raises not_found_error if not found. If you have less than 2 millions elements, diff --git a/tools/check_dist_archive b/tools/check_dist_archive index 22c717b547..ca1f75e5ba 100755 --- a/tools/check_dist_archive +++ b/tools/check_dist_archive @@ -86,7 +86,7 @@ diffcmd() { colordiff=$(type -p colordiff) colorless() { - if [ -n "$colordiff" ]; then + if [ -x "$colordiff" ]; then "$colordiff" | less -R -F else less -F