Logo AND Algorithmique Numérique Distribuée

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