1 /* s4u::Engine Simulation Engine and global functions. */
3 /* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "simgrid/simix.h"
10 #include "simgrid/s4u/engine.hpp"
12 XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface");
13 using namespace simgrid;
15 double s4u::Engine::getClock() {
16 return SIMIX_get_clock();
19 s4u::Engine::Engine(int *argc, char **argv) {
20 SIMIX_global_init(argc, argv);
23 void s4u::Engine::loadPlatform(const char *platf) {
24 SIMIX_create_environment(platf);
27 void s4u::Engine::register_function(const char*name, int (*code)(int,char**)) {
28 SIMIX_function_register(name,code);
30 void s4u::Engine::register_default(int (*code)(int,char**)) {
31 SIMIX_function_register_default(code);
33 void s4u::Engine::loadDeployment(const char *deploy) {
34 SIMIX_launch_application(deploy);
37 void s4u::Engine::run() {