Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
9a07509921985ee3c03e295fc2ee2b2d68e5ffb9
[simgrid.git] / include / smpi / smpi_helpers.h
1 /* Copyright (c) 2018-2019. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SMPI_HELPERS_H
7 #define SMPI_HELPERS_H
8
9 #ifndef _GNU_SOURCE
10 #define _GNU_SOURCE
11 #endif
12
13 #include <smpi/smpi_helpers_internal.h>
14 #ifndef TRACE_CALL_LOCATION /* Defined by smpicc on the command line */
15 #define sleep(x) smpi_sleep(x)
16 #define usleep(x) smpi_usleep(x)
17 #else
18 #define sleep(x) ({ smpi_trace_set_call_location(__FILE__,__LINE__); smpi_sleep(x); })
19 #define usleep(x) ({ smpi_trace_set_call_location(__FILE__,__LINE__); smpi_usleep(x); })
20 #endif
21
22 #define gettimeofday(x, y) smpi_gettimeofday((x), 0)
23 #if _POSIX_TIMERS > 0
24 #ifndef TRACE_CALL_LOCATION /* Defined by smpicc on the command line */
25 #define nanosleep(x, y) smpi_nanosleep((x), (y))
26 #else
27 #define nanosleep(x) ({ smpi_trace_set_call_location(__FILE__,__LINE__); smpi_nanosleep(x); })
28 #endif
29 #define clock_gettime(x, y) smpi_clock_gettime((x), (y))
30 #endif
31
32 #define getopt(x, y, z) smpi_getopt((x), (y), (z))
33 #define getopt_long(x, y, z, a, b) smpi_getopt_long((x), (y), (z), (a), (b))
34 #define getopt_long_only(x, y, z, a, b) smpi_getopt_long_only((x), (y), (z), (a), (b))
35 #ifndef SAMPI_OVERRIDEN_MALLOC
36 #define malloc(x) smpi_shared_malloc_intercept(x, __FILE__, __LINE__)
37 #define calloc(x,y) smpi_shared_calloc_intercept(x,y, __FILE__, __LINE__)
38 #define free(x) smpi_shared_free(x)
39 #endif
40 #endif