2 /* Create a log channel to have nice outputs. */
5 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
6 "Messages specific for this msg example");
7 #define MAX_ITER 200000
10 int node(int argc, char **argv);
11 MSG_error_t test_all(const char *, const char *);
12 int main(int argc, char *argv[]);
14 int node(int argc, char** argv)
19 for(i=0; i < MAX_ITER; i++){
20 task = MSG_task_create("test", 100000000, 1, NULL);
22 for(j=0; j < WORK; j++);
24 MSG_task_execute(task);
25 XBT_INFO("Task successfully executed");
26 MSG_task_destroy(task);
33 MSG_error_t test_all(const char *platform_file,
34 const char *application_file)
36 MSG_error_t res = MSG_OK;
38 /* MSG_config("workstation/model","KCCFLN05"); */
39 { /* Simulation setting */
40 MSG_set_channel_number(0);
41 MSG_create_environment(platform_file);
43 { /* Application deployment */
44 MSG_function_register("node", node);
45 MSG_launch_application(application_file);
49 XBT_INFO("Simulation time %g", MSG_get_clock());
51 } /* end_of_test_all */
55 int main(int argc, char *argv[])
57 MSG_error_t res = MSG_OK;
59 MSG_global_init(&argc, argv);
61 printf("Usage: %s platform_file deployment_file\n", argv[0]);
62 printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
65 res = test_all(argv[1], argv[2]);