examples/msg/app-pingpong/app-pingpong
examples/msg/maestro-set/maestro-set
examples/msg/simulation.trace
+examples/msg/process-create/process-create
examples/msg/process-startkilltime/process-startkilltime
examples/msg/process-suspend/process-suspend
examples/msg/app-token-ring/app-token-ring
examples/msg/trace-link-user-variables/trace-link-user-variables
examples/msg/trace-masterworker/trace-masterworker
examples/msg/trace-process-migration/trace-process-migration
-examples/msg/trace-simple/trace-simple
examples/msg/trace-platform/trace-platform
examples/msg/trace-user-variables/trace-user-variables
examples/s4u/basic/s4u_basic
foreach(x actions-comm actions-storage app-masterworker app-pingpong app-pmm app-token-ring async-wait async-waitall
async-waitany cloud-capping cloud-masterworker cloud-migration cloud-multicore cloud-simple
cloud-two-tasks dht-chord dht-pastry energy-consumption energy-onoff energy-pstate energy-ptask energy-vm
- platform-failures io-file io-remote io-storage task-priority process-kill process-migration
+ platform-failures io-file io-remote io-storage task-priority process-create process-kill process-migration
process-suspend platform-properties maestro-set process-startkilltime synchro-semaphore trace-categories
trace-link-srcdst-user-variables trace-link-user-variables trace-masterworker trace-platform
- trace-process-migration trace-simple trace-user-variables)
+ trace-process-migration trace-user-variables)
add_executable (${x} ${x}/${x}.c)
target_link_libraries(${x} simgrid)
set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
foreach(x actions-comm actions-storage app-masterworker app-pingpong app-pmm app-token-ring async-wait async-waitall
async-waitany cloud-capping cloud-masterworker cloud-migration cloud-multicore cloud-simple cloud-two-tasks
dht-chord dht-pastry energy-consumption energy-onoff energy-pstate energy-ptask energy-vm platform-failures
- io-file io-remote io-storage task-priority process-kill process-migration process-suspend
+ io-file io-remote io-storage task-priority process-create process-kill process-migration process-suspend
platform-properties maestro-set process-startkilltime synchro-semaphore trace-categories
trace-link-srcdst-user-variables trace-link-user-variables trace-masterworker trace-platform
- trace-process-migration trace-simple trace-user-variables)
+ trace-process-migration trace-user-variables)
add_executable (${x} ${x}/${x}.c)
target_link_libraries(${x} simgrid)
set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
@section msg_ex_process Acting on Processes
+ - <b>Creating processes</b>.
+ @ref examples/msg/process-create/process-create.c \n
+ Most processes are started from the deployment XML file, but they
+ can also be used with the @ref MSG_process_create() function.
+
- <b>Suspend and Resume processes</b>.
@ref examples/msg/process-suspend/process-suspend.c \n
Processes can be suspended and resumed during their executions
You can specify a start time and a kill time in the deployment
file. See all *_d.xml files in this directory.
-TODO: add an example using @ref MSG_process_create()
-
@section msg_ex_tracing Tracing and visualization features
Tracing can be activated by various configuration options which
are illustrated in these example. See also the
@ref tracing_tracing_options "full list of options related to tracing".
- - <b>Basic example</b>. @ref examples/msg/trace-simple/trace-simple.c \n
- In this very simple program, each process creates, executes,
- and destroy a task. Recommanded options:
- @verbatim --cfg=tracing:yes --cfg=tracing/uncategorized:yes @endverbatim
+It is interesting to run the process-create example with the following
+options to see the task executions:
- <b>Platform tracing</b>.
@ref examples/msg/trace-platform/trace-platform.c \n
@example examples/msg/async-waitall/async-waitall.c
@example examples/msg/async-waitall/async-waitany.c
+@example examples/msg/process-create/process-create.c
@example examples/msg/process-suspend/process-suspend.c
@example examples/msg/process-kill/process-kill.c
@example examples/msg/process-migration/process-migration.c
@example examples/msg/process-startkilltime/process-startkilltime.c
-@example examples/msg/trace-simple/trace-simple.c
@example examples/msg/trace-platform/trace-platform.c
@example examples/msg/trace-categories/trace-categories.c
@example examples/msg/trace-masterworker/trace-masterworker.c
#include "simgrid/msg.h"
-static int simple_func(int argc, char *argv[])
+/* Main function of the process I want to start manually */
+static int process_function(int argc, char *argv[])
{
msg_task_t task = MSG_task_create("task", 100, 0, NULL);
MSG_task_execute (task);
xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
MSG_create_environment(argv[1]);
- MSG_process_create("simple_func", simple_func, NULL, MSG_get_host_by_name("Tremblay"));
- MSG_process_create("simple_func", simple_func, NULL, MSG_get_host_by_name("Fafard"));
+ MSG_process_create("simple_func", process_function, NULL, MSG_get_host_by_name("Tremblay"));
+ MSG_process_create("simple_func", process_function, NULL, MSG_get_host_by_name("Fafard"));
MSG_main();
return 0;
--- /dev/null
+#! ./tesh
+
+p Start remote processes
+$ $SG_TEST_EXENV ${bindir:=.}/process-create$EXEEXT
+++ /dev/null
-#! ./tesh
-
-p Simple tracing example
-$ $SG_TEST_EXENV ${bindir:=.}/trace-simple$EXEEXT --cfg=tracing:yes --cfg=tracing/filename:trace-simple.trace --cfg=tracing/uncategorized:yes ${srcdir:=.}/small_platform.xml
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'trace-simple.trace'
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes'
-
-$ tail -n +3 trace-simple.trace
-> %EventDef PajeDefineContainerType 0
-> % Alias string
-> % Type string
-> % Name string
-> %EndEventDef
-> %EventDef PajeDefineVariableType 1
-> % Alias string
-> % Type string
-> % Name string
-> % Color color
-> %EndEventDef
-> %EventDef PajeDefineStateType 2
-> % Alias string
-> % Type string
-> % Name string
-> %EndEventDef
-> %EventDef PajeDefineEventType 3
-> % Alias string
-> % Type string
-> % Name string
-> %EndEventDef
-> %EventDef PajeDefineLinkType 4
-> % Alias string
-> % Type string
-> % StartContainerType string
-> % EndContainerType string
-> % Name string
-> %EndEventDef
-> %EventDef PajeDefineEntityValue 5
-> % Alias string
-> % Type string
-> % Name string
-> % Color color
-> %EndEventDef
-> %EventDef PajeCreateContainer 6
-> % Time date
-> % Alias string
-> % Type string
-> % Container string
-> % Name string
-> %EndEventDef
-> %EventDef PajeDestroyContainer 7
-> % Time date
-> % Type string
-> % Name string
-> %EndEventDef
-> %EventDef PajeSetVariable 8
-> % Time date
-> % Type string
-> % Container string
-> % Value double
-> %EndEventDef
-> %EventDef PajeAddVariable 9
-> % Time date
-> % Type string
-> % Container string
-> % Value double
-> %EndEventDef
-> %EventDef PajeSubVariable 10
-> % Time date
-> % Type string
-> % Container string
-> % Value double
-> %EndEventDef
-> %EventDef PajeSetState 11
-> % Time date
-> % Type string
-> % Container string
-> % Value string
-> %EndEventDef
-> %EventDef PajePushState 12
-> % Time date
-> % Type string
-> % Container string
-> % Value string
-> %EndEventDef
-> %EventDef PajePopState 13
-> % Time date
-> % Type string
-> % Container string
-> %EndEventDef
-> %EventDef PajeResetState 14
-> % Time date
-> % Type string
-> % Container string
-> %EndEventDef
-> %EventDef PajeStartLink 15
-> % Time date
-> % Type string
-> % Container string
-> % Value string
-> % StartContainer string
-> % Key string
-> %EndEventDef
-> %EventDef PajeEndLink 16
-> % Time date
-> % Type string
-> % Container string
-> % Value string
-> % EndContainer string
-> % Key string
-> %EndEventDef
-> %EventDef PajeNewEvent 17
-> % Time date
-> % Type string
-> % Container string
-> % Value string
-> %EndEventDef
-> 0 1 0 HOST
-> 6 0 1 1 0 "Tremblay"
-> 1 2 1 power "1 1 1"
-> 1 3 1 power_used "0.5 0.5 0.5"
-> 6 0 2 1 0 "Jupiter"
-> 6 0 3 1 0 "Fafard"
-> 6 0 4 1 0 "Ginette"
-> 6 0 5 1 0 "Bourassa"
-> 0 4 0 LINK
-> 6 0 6 4 0 "6"
-> 1 5 4 bandwidth "1 1 1"
-> 1 6 4 latency "1 1 1"
-> 1 7 4 bandwidth_used "0.5 0.5 0.5"
-> 6 0 7 4 0 "3"
-> 6 0 8 4 0 "7"
-> 6 0 9 4 0 "9"
-> 6 0 10 4 0 "2"
-> 6 0 11 4 0 "8"
-> 6 0 12 4 0 "1"
-> 6 0 13 4 0 "4"
-> 6 0 14 4 0 "0"
-> 6 0 15 4 0 "5"
-> 6 0 16 4 0 "loopback"
-> 4 8 0 4 4 0-LINK4-LINK4
-> 4 9 0 1 4 0-HOST1-LINK4
-> 4 10 0 4 1 0-LINK4-HOST1
-> 8 0 2 1 98095000.000000
-> 8 0 2 2 76296000.000000
-> 8 0 2 3 76296000.000000
-> 8 0 2 4 48492000.000000
-> 8 0 2 5 48492000.000000
-> 8 0 5 6 41279125.000000
-> 8 0 6 6 0.000060
-> 8 0 5 7 34285625.000000
-> 8 0 6 7 0.000514
-> 8 0 5 8 11618875.000000
-> 8 0 6 8 0.000190
-> 8 0 5 9 7209750.000000
-> 8 0 6 9 0.001462
-> 8 0 5 10 118682500.000000
-> 8 0 6 10 0.000137
-> 8 0 5 11 8158000.000000
-> 8 0 6 11 0.000271
-> 8 0 5 12 34285625.000000
-> 8 0 6 12 0.000514
-> 8 0 5 13 10099625.000000
-> 8 0 6 13 0.000480
-> 8 0 5 14 41279125.000000
-> 8 0 6 14 0.000060
-> 8 0 5 15 27946250.000000
-> 8 0 6 15 0.000278
-> 8 0 5 16 498000000.000000
-> 8 0 6 16 0.000015
-> 15 0 8 0 topology 13 0
-> 16 0 8 0 topology 7 0
-> 15 0 8 0 topology 6 1
-> 16 0 8 0 topology 8 1
-> 15 0 9 0 topology 1 2
-> 16 0 9 0 topology 13 2
-> 15 0 9 0 topology 1 3
-> 16 0 9 0 topology 9 3
-> 15 0 10 0 topology 9 4
-> 16 0 10 0 topology 2 4
-> 15 0 8 0 topology 10 5
-> 16 0 8 0 topology 14 5
-> 15 0 8 0 topology 12 6
-> 16 0 8 0 topology 11 6
-> 15 0 8 0 topology 9 7
-> 16 0 8 0 topology 13 7
-> 15 0 10 0 topology 8 8
-> 16 0 10 0 topology 5 8
-> 15 0 8 0 topology 14 9
-> 16 0 8 0 topology 12 9
-> 15 0 10 0 topology 15 10
-> 16 0 10 0 topology 4 10
-> 15 0 8 0 topology 10 11
-> 16 0 8 0 topology 15 11
-> 15 0 8 0 topology 7 12
-> 16 0 8 0 topology 15 12
-> 15 0 10 0 topology 11 13
-> 16 0 10 0 topology 3 13
-> 15 0 8 0 topology 7 14
-> 16 0 8 0 topology 10 14
-> 15 0 8 0 topology 12 15
-> 16 0 8 0 topology 6 15
-> 15 0 8 0 topology 11 16
-> 16 0 8 0 topology 6 16
-> 8 0 3 1 0.000000
-> 9 0 3 1 98095000.000000
-> 10 0 3 1 98095000.000000
-> 8 0 3 3 0.000000
-> 9 0 3 3 76296000.000000
-> 10 0 3 3 76296000.000000
-> 9 0 3 1 98095000.000000
-> 9 0 3 3 76296000.000000
-> 10 0.000001 3 1 98095000.000000
-> 10 0.000001 3 3 76296000.000000
-> 7 0.000001 1 3
-> 7 0.000001 1 1
-> 7 0.000001 4 16
-> 7 0.000001 4 14
-> 7 0.000001 4 12
-> 7 0.000001 4 10
-> 7 0.000001 4 7
-> 7 0.000001 4 13
-> 7 0.000001 4 15
-> 7 0.000001 4 6
-> 7 0.000001 4 8
-> 7 0.000001 4 11
-> 7 0.000001 4 9
-> 7 0.000001 1 5
-> 7 0.000001 1 2
-> 7 0.000001 1 4
-
-$ rm -f trace-simple.trace