* 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. */
* 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. */
-/* Create a log channel to have nice outputs. */
-#include "xbt/log.h"
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
- "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
- * - <b>migration/migration.c</b> Demonstrates how to use the @ref
- * MSG_process_migrate function to let processes change the host they
- * run on after their start.
+ * - <b>migration/migration.c</b> Demonstrates how to use the @ref MSG_process_migrate function to let processes
+ * change the host they run on after their start.
XBT_INFO("Yeah, found something to do");
task = MSG_task_create("job", 98095000, 0, NULL);
MSG_task_execute(task);
XBT_INFO("Yeah, found something to do");
task = MSG_task_create("job", 98095000, 0, NULL);
MSG_task_execute(task);
XBT_INFO("I've been moved on this new host: %s", MSG_host_get_name(h));
XBT_INFO("Uh, nothing to do here. Stopping now");
return 0;
XBT_INFO("I've been moved on this new host: %s", MSG_host_get_name(h));
XBT_INFO("Uh, nothing to do here. Stopping now");
return 0;
/* This function move the emigrant on Jacquelin */
static int policeman(int argc, char *argv[])
{
/* This function move the emigrant on Jacquelin */
static int policeman(int argc, char *argv[])
{
xbt_mutex_acquire(mutex);
XBT_INFO("Wait a bit before migrating the emigrant.");
while (process_to_migrate == NULL) xbt_cond_wait(cond, mutex);
xbt_mutex_acquire(mutex);
XBT_INFO("Wait a bit before migrating the emigrant.");
while (process_to_migrate == NULL) xbt_cond_wait(cond, mutex);
int main(int argc, char *argv[])
{
msg_error_t res = MSG_OK;
int main(int argc, char *argv[])
{
msg_error_t res = MSG_OK;
- if (argc < 3) {
- XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]);
- XBT_CRITICAL("example: %s msg_platform.xml msg_deployment_suspend.xml\n",
- argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n", argv[0], argv[0]);
MSG_function_register("emigrant", emigrant);
MSG_function_register("policeman", policeman);
MSG_launch_application(argv[2]);
MSG_function_register("emigrant", emigrant);
MSG_function_register("policeman", policeman);
MSG_launch_application(argv[2]);