1 /* Copyright (c) 2009-2010, 2012-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "xbt/asserts.h"
13 XBT_LOG_NEW_DEFAULT_CATEGORY(test_trace_integration,
14 "Messages specific for this msg example");
16 int test_trace(int argc, char *argv[]);
18 /** test the trace integration cpu model */
19 int test_trace(int argc, char *argv[])
22 double task_comp_size = 2800;
23 double task_prio = 1.0;
27 ("Wrong number of arguments!\nUsage:\n\t1) task computational size in FLOPS\n\t2 task priority\n");
31 task_comp_size = atof(argv[1]);
32 task_prio = atof(argv[2]);
34 XBT_INFO("Testing the trace integration cpu model: CpuTI");
35 XBT_INFO("Task size: %f", task_comp_size);
36 XBT_INFO("Task prio: %f", task_prio);
38 /* Create and execute a single task. */
39 task = MSG_task_create("proc 0", task_comp_size, 0, NULL);
40 MSG_task_set_priority(task, task_prio);
41 MSG_task_execute(task);
42 MSG_task_destroy(task);
44 XBT_INFO("Test finished");
51 int main(int argc, char *argv[])
53 msg_error_t res = MSG_OK;
55 /* Verify if the platform xml file was passed by command line. */
56 MSG_init(&argc, argv);
58 printf("Usage: %s test_trace_integration_model.xml\n", argv[0]);
62 /* Register SimGrid process function. */
63 MSG_function_register("test_trace", test_trace);
64 /* Use the same file for platform and deployment. */
65 MSG_create_environment(argv[1]);
66 MSG_launch_application(argv[2]);
67 /* Run the example. */