Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Eradicate gras further.
[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, 2008, 2009, 2010. 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 char *xbt_os_procname_data = NULL;
15
16 static int xbt_fake_pid(void)
17 {
18   return 0;
19 }
20
21 int_f_void_t xbt_getpid = xbt_fake_pid;
22
23 /*
24  * Time elapsed since the beginning of the simulation.
25  */
26 double xbt_time()
27 {
28   /* FIXME: check if we should use the request mechanism or not */
29   return SIMIX_get_clock();
30 }
31
32 /*
33  * Freeze the process for the specified amount of time
34  */
35 void xbt_sleep(double sec)
36 {
37   simcall_process_sleep(sec);
38 }
39
40 const char *xbt_procname(void)
41 {
42   return SIMIX_process_self_get_name();
43 }
44
45 const char *xbt_os_procname(void)
46 {
47   return xbt_os_procname_data;
48 }