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")
#* ****************************************************************************************** *#
set(SIMDAG_SRC
+ src/simdag/instr_sd_task.c
src/simdag/sd_daxloader.c
src/simdag/sd_global.c
src/simdag/sd_link.c
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}/
)
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 `<name>` 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_<NAME>(targ1 arg1, targ2 arg2, targ3 arg3){
+ return simcall_BODY_<NAME>(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 `<name>` 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_<NAME>, <name>, 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_<name>` in the
+corresponding src/simix/smx_*.c file:
+
+~~~~{.c}
+tret SIMIX_pre_<name>(smx_simcall_t simcall, targ1 arg1, targ2 arg2, targ3 arg3) {
+ SIMIX_<NAME>(arg1, arg2, arg3);
+}
+
+tret SIMIX_<name>(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
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
#! ./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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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---------------------------
> [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
$ $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:
> [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:
> [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
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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:
> [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---------------------------
> [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
! 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
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() */
> [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
> [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
> 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
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)
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.
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);
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);
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__);
}
--- /dev/null
+/* 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 */
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;
{
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
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
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
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
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);
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);
}
}
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);
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)) {
XBT_DEBUG("See <job id=%s amount=%s %.0f alpha=%.2f>", 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 =
XBT_DEBUG("See <job id=%s runtime=%s %.0f>", 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);
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);
#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);
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);
#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);
-/* 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
sd_global->task_number++;
#ifdef HAVE_TRACING
- task->category = NULL;
+ TRACE_sd_task_create(task);
#endif
return task;
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;
}
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
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;
}
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;
}
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);
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);
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
-}
-/*
- * 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_
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,
colordiff=$(type -p colordiff)
colorless() {
- if [ -n "$colordiff" ]; then
+ if [ -x "$colordiff" ]; then
"$colordiff" | less -R -F
else
less -F