Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / teshsuite / s4u / trace-integration / trace-integration.cpp
1 /* Copyright (c) 2009-2023. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #include "simgrid/s4u.hpp"
8
9 XBT_LOG_NEW_DEFAULT_CATEGORY(test_trace_integration, "Messages specific for this example");
10
11 /** test the trace integration cpu model */
12 static void test_trace(std::vector<std::string> args)
13 {
14   xbt_assert(args.size() == 3,
15              "Wrong number of arguments!\nUsage: %s <task computational size in FLOPS> <task priority>",
16              args[0].c_str());
17
18   double task_comp_size = std::stod(args[1]);
19   double task_prio      = std::stod(args[2]);
20
21   XBT_INFO("Testing the trace integration cpu model: CpuTI");
22   XBT_INFO("Task size: %f", task_comp_size);
23   XBT_INFO("Task prio: %f", task_prio);
24
25   /* Create and execute a single task. */
26   simgrid::s4u::ExecPtr exec = simgrid::s4u::this_actor::exec_init(task_comp_size);
27   exec->set_priority(task_prio)->wait();
28   XBT_INFO("Test finished");
29 }
30
31 int main(int argc, char* argv[])
32 {
33   simgrid::s4u::Engine e(&argc, argv);
34   xbt_assert(argc > 2, "Usage: %s test_trace_integration_model.xml deployment.xml\n", argv[0]);
35
36   e.register_function("test_trace", test_trace);
37   e.load_platform(argv[1]);
38   e.load_deployment(argv[2]);
39   e.run();
40   return 0;
41 }