#! ./tesh
p Test the loader of DAG written in the DOT format

! expect return 2
$ $SG_TEST_EXENV ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc  "--log=sd_dotparse.thres:verbose" ${srcdir:=.}/../platforms/two_clusters.xml ${srcdir:=.}/schedule-dotload/dag_with_bad_schedule.dot
> [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
> [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, task 'end' can not be scheduled on -1 hosts
> [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, task '1' can not be scheduled on 0 hosts
> [0.000000] [sd_dotparse/VERBOSE] Task '0' wants to start on performer '1' at the same position '1' as task '2'
> [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, task '3' can not be scheduled on -1 hosts
> [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, task 'root' can not be scheduled on -1 hosts
> [0.000000] [sd_dotparse/WARNING] The scheduling is ignored
> [0.000000] [test/CRITICAL] The dot file with the provided scheduling is wrong, more information with the option : --log=sd_dotparse.thres:verbose

$ $SG_TEST_EXENV ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc ${srcdir:=.}/../platforms/two_clusters.xml ${srcdir:=.}/schedule-dotload/dag_with_good_schedule.dot
> [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
> [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]   - amount: 0
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 0
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [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]   - amount: 10000000129
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     root
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     2
> [0.000000] [sd_task/INFO]     0->2
> [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]   - amount: 10000000131
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     root
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     4
> [0.000000] [sd_task/INFO]     1->2
> [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]   - amount: 10000000121
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 3
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     0
> [0.000000] [sd_task/INFO]     0->2
> [0.000000] [sd_task/INFO]     1->2
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     3
> [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]   - amount: 10000000231
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 2
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     2
> [0.000000] [sd_task/INFO]     2->3
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     4
> [0.000000] [sd_task/INFO]     8
> [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]   - amount: 10000000005
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 2
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     1
> [0.000000] [sd_task/INFO]     3
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     5
> [0.000000] [sd_task/INFO]     4->5
> [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]   - amount: 10000000046
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 3
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     4
> [0.000000] [sd_task/INFO]     root->5
> [0.000000] [sd_task/INFO]     4->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: scheduled not runnable
> [0.000000] [sd_task/INFO]   - kind: sequential computation
> [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]     5
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     7
> [0.000000] [sd_task/INFO]     6->7
> [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]   - amount: 10000000041
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 2
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     6
> [0.000000] [sd_task/INFO]     6->7
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     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: scheduled not runnable
> [0.000000] [sd_task/INFO]   - kind: sequential computation
> [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]     3
> [0.000000] [sd_task/INFO]     7->8
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     9
> [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]   - amount: 10000000079
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     8
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     end
> [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]   - amount: 10014000
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     root
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     5
> [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]   - amount: 10001
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     0
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     2
> [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]   - amount: 10004
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     1
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     2
> [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]   - amount: 10002
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     2
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     3
> [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]   - amount: 10029
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     4
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     5
> [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]   - amount: 10005
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     6
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     7
> [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]   - amount: 10000
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     7
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     8
> [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]   - amount: 10014000
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 1
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     7
> [0.000000] [sd_task/INFO]   - post-dependencies:
> [0.000000] [sd_task/INFO]     end
> [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: 10000000129
> [0.000000] [sd_task/INFO]   - Dependencies to satisfy: 3
> [0.000000] [sd_task/INFO]   - pre-dependencies:
> [0.000000] [sd_task/INFO]     7
> [0.000000] [sd_task/INFO]     9
> [0.000000] [sd_task/INFO]     7->end
> [0.000000] [test/INFO] ------------------- Run the schedule ---------------------------
> [100.003561] [test/INFO] ------------------- Produce the trace file---------------------------
> [100.003561] [test/INFO] Producing the trace of the run into dag_with_good_schedule.trace

$ cat ${srcdir:=.}/schedule-dotload/dag_with_good_schedule.trace
> [0.000000->0.000000] node-0.acme.org compute 0.000000 flops # root
> [0.000000->10.000000] node-1.acme.org compute 10000000129.452715 flops # 0
> [0.000000->10.000000] node-0.acme.org compute 10000000131.133657 flops # 1
> [10.000760->20.000760] node-1.acme.org compute 10000000121.124870 flops # 2
> [20.001440->30.001441] node-1.acme.org compute 10000000230.608025 flops # 3
> [30.001441->40.001441] node-0.acme.org compute 10000000004.994019 flops # 4
> [40.002121->50.002121] node-0.acme.org compute 10000000046.016401 flops # 5
> [50.002121->60.002121] node-0.acme.org compute 10000000091.598791 flops # 6
> [60.002801->70.002801] node-0.acme.org compute 10000000040.679438 flops # 7
> [70.003561->80.003561] node-1.acme.org compute 10000000250.490017 flops # 8
> [80.003561->90.003561] node-1.acme.org compute 10000000079.267649 flops # 9
> [0.000000 -> 0.080712] node-0.acme.org -> node-0.acme.org transfer of 10014000 bytes # root->5
> [10.000000 -> 10.000760] node-1.acme.org -> node-1.acme.org transfer of 10001 bytes # 0->2
> [10.000000 -> 10.000760] node-0.acme.org -> node-1.acme.org transfer of 10004 bytes # 1->2
> [20.000760 -> 20.001440] node-1.acme.org -> node-1.acme.org transfer of 10002 bytes # 2->3
> [40.001441 -> 40.002121] node-0.acme.org -> node-0.acme.org transfer of 10029 bytes # 4->5
> [60.002121 -> 60.002801] node-0.acme.org -> node-0.acme.org transfer of 10005 bytes # 6->7
> [70.002801 -> 70.003561] node-0.acme.org -> node-1.acme.org transfer of 10000 bytes # 7->8
> [70.002801 -> 70.083593] node-0.acme.org -> node-0.acme.org transfer of 10014000 bytes # 7->end
> [90.003561->100.003561] node-0.acme.org compute 10000000129.452715 flops # end

$ rm -f ${srcdir:=.}/schedule-dotload/dag_with_good_schedule.trace

