Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Whitespace cleanup.
[simgrid.git] / src / xbt / xbt_virtu.c
1 /* virtu - virtualization layer for XBT to choose between GRAS and MSG implementation */
2
3 /* Copyright (c) 2007-2010, 2012. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #include "xbt/misc.h"
10 #include "xbt/virtu.h"
11 #include "xbt/function_types.h"
12 #include "simgrid/simix.h"
13
14 static int xbt_fake_pid(void)
15 {
16   return 0;
17 }
18
19 int_f_void_t xbt_getpid = xbt_fake_pid;
20
21 /*
22  * Time elapsed since the beginning of the simulation.
23  */
24 double xbt_time()
25 {
26   /* FIXME: check if we should use the request mechanism or not */
27   return SIMIX_get_clock();
28 }
29
30 /*
31  * Freeze the process for the specified amount of time
32  */
33 void xbt_sleep(double sec)
34 {
35   simcall_process_sleep(sec);
36 }
37
38 const char *xbt_procname(void)
39 {
40   return SIMIX_process_self_get_name();
41 }