Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Convert xbt_cfg_set_as_string -> simgrid::config::set_as_string
[simgrid.git] / include / smpi / smpi_helpers.h
1 #ifndef MPI_HELPERS_H
2 #define MPI_HELPERS_H
3
4 #ifndef _GNU_SOURCE
5 #define _GNU_SOURCE
6 #endif
7
8 #include <unistd.h>
9 #include <sys/time.h> /* Load it before the define next line to not mess with the system headers */
10 #if _POSIX_TIMERS
11 #include <time.h>
12 #endif
13
14 int smpi_usleep(useconds_t usecs);
15 #if _POSIX_TIMERS > 0
16 int smpi_nanosleep(const struct timespec* tp, struct timespec* t);
17 int smpi_clock_gettime(clockid_t clk_id, struct timespec* tp);
18 #endif
19 unsigned int smpi_sleep(unsigned int secs);
20 int smpi_gettimeofday(struct timeval* tv, struct timezone* tz);
21
22 struct option;
23 int smpi_getopt_long (int argc,  char *const *argv,  const char *options,  const struct option *long_options, int *opt_index);
24 int smpi_getopt (int argc,  char *const *argv,  const char *options);
25
26 #define sleep(x) smpi_sleep(x)
27 #define usleep(x) smpi_usleep(x)
28 #define gettimeofday(x, y) smpi_gettimeofday(x, 0)
29 #if _POSIX_TIMERS > 0
30 #define nanosleep(x, y) smpi_nanosleep(x, y)
31 #define clock_gettime(x, y) smpi_clock_gettime(x, y)
32 #endif
33
34 #define getopt(x,y,z) smpi_getopt(x,y,z)
35 #define getopt_long(x,y,z,a,b) smpi_getopt_long(x,y,z,a,b)
36
37 #endif