dht-pastry energy-consumption energy-onoff energy-pstate energy-ptask energy-vm platform-failures
io-file io-remote io-storage task-priority
plugin-hostload
- process-create process-daemon process-join process-kill process-migration process-suspend
+ process-create process-daemon process-join process-migration process-suspend
platform-properties process-startkilltime synchro-semaphore trace-categories
trace-route-user-variables trace-link-user-variables trace-masterworker trace-platform
trace-process-migration trace-host-user-variables)
foreach(x app-chainsend app-masterworker app-pingpong app-token-ring
async-wait async-waitall async-waitany cloud-capping cloud-masterworker cloud-migration cloud-simple
cloud-two-tasks dht-pastry dht-kademlia platform-failures io-file io-remote io-storage task-priority
- process-create process-daemon process-join process-kill process-migration process-startkilltime process-suspend
+ process-create process-daemon process-join process-migration process-startkilltime process-suspend
platform-properties synchro-semaphore)
ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/${x} ${x}.tesh)
endforeach()
Processes can be suspended and resumed during their executions
thanks to the @ref MSG_process_suspend and @ref MSG_process_resume functions.
- - <b>Kill processes</b>.
- @ref examples/msg/process-kill/process-kill.c \n
- Processes can forcefully stop other processes with the @ref MSG_process_kill function.
- <b>Migrating processes</b>.
@ref examples/msg/process-migration/process-migration.c \n
@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
# C examples
foreach(x actions-comm actions-storage cloud-sharing get_sender host_on_off host_on_off_recv host_on_off_processes
- process-yield
+ process-kill process-yield
trace_integration)
add_executable (${x} ${x}/${x}.c)
target_link_libraries(${x} simgrid)
${CMAKE_CURRENT_SOURCE_DIR}/actions-comm/actions-comm_split_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/actions-storage/actions-storage_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/app-bittorrent_d.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/process-yield/process-yield_d.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/process-kill/process-kill_d.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/process-yield/process-yield_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml
${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml
${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1.5-hbp1.5.xml
foreach(x get_sender host_on_off host_on_off_processes host_on_off_recv
task_destroy_cancel task_listen_from task_progress
- process-yield
+ process-kill process-yield
trace_integration)
ADD_TESH_FACTORIES(tesh-msg-${x} "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh)
endforeach()
MSG_process_suspend(MSG_process_self()); /* - First suspend itself */
XBT_INFO("OK, OK. Let's work"); /* - Then is resumed and start to execute a task */
MSG_task_execute(MSG_task_create("work", 1e9, 0, NULL));
- XBT_INFO("Bye!"); /* - But will never reach the end of it */
+ XBT_INFO("Bye!"); /* - But will never reach the end of it */
return 0;
}
return 0;
}
-static int killer(int argc, char *argv[])
+static int killer(int argc, char* argv[])
{
- XBT_INFO("Hello!"); /* - First start a victim process */
+ XBT_INFO("Hello!"); /* - First start a victim process */
msg_process_t victimA = MSG_process_create("victim A", victimA_fun, NULL, MSG_host_by_name("Fafard"));
msg_process_t victimB = MSG_process_create("victim B", victimB_fun, NULL, MSG_host_by_name("Bourassa"));
MSG_process_sleep(10.0);
return 0;
}
-int main(int argc, char *argv[])
+int main(int argc, char* argv[])
{
MSG_init(&argc, argv);
xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
- MSG_create_environment(argv[1]); /* - Load the platform description */
+ MSG_create_environment(argv[1]); /* - Load the platform description */
/* - Create and deploy killer process, that will create the victim process */
MSG_process_create("killer", killer, NULL, MSG_host_by_name("Tremblay"));
p Testing a MSG_process_kill function
-$ $SG_TEST_EXENV ${bindir:=.}/process-kill ${srcdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/process-kill ${srcdir:=.}/../../../examples/platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (1:killer@Tremblay) Hello!
> [ 0.000000] (2:victim A@Fafard) Hello!
> [ 0.000000] (2:victim A@Fafard) Suspending myself