Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
end of simplification of dependencies
[simgrid.git] / include / smpi / smpi.h
index 11afb63..0b73451 100644 (file)
@@ -9,12 +9,14 @@
 
 #include <unistd.h>
 #include <sys/time.h>
+#if _POSIX_TIMERS
+#include <time.h>
+#endif
 
 #include <stddef.h>
 #include <xbt/misc.h>
 #include <xbt/function_types.h>
 
-
 #ifdef _WIN32
 #define MPI_CALL(type,name,args) \
   type name args; \
@@ -804,6 +806,10 @@ XBT_PUBLIC(int)  smpi_get_host_pstate(void);
 XBT_PUBLIC(double) smpi_get_host_consumed_energy(void);
 
 XBT_PUBLIC(int) smpi_usleep(useconds_t usecs);
+#if _POSIX_TIMERS > 0
+XBT_PUBLIC(int) smpi_nanosleep(const struct timespec *tp, struct timespec * t);
+XBT_PUBLIC(int) smpi_clock_gettime(clockid_t clk_id, struct timespec *tp);
+#endif
 XBT_PUBLIC(unsigned int) smpi_sleep(unsigned int secs);
 XBT_PUBLIC(int) smpi_gettimeofday(struct timeval *tv, void* tz);
 XBT_PUBLIC(unsigned long long) smpi_rastro_resolution (void);
@@ -812,6 +818,17 @@ XBT_PUBLIC(void) smpi_sample_1(int global, const char *file, int line, int iters
 XBT_PUBLIC(int) smpi_sample_2(int global, const char *file, int line);
 XBT_PUBLIC(void) smpi_sample_3(int global, const char *file, int line);
 
+/** 
+ * Functions for call location tracing. These functions will be
+ * called from the user's application! (With the __FILE__ and __LINE__ values
+ * passed as parameters.)
+ */
+XBT_PUBLIC(void) smpi_trace_set_call_location(const char *file, int line);
+/** Fortran binding **/
+XBT_PUBLIC(void) smpi_trace_set_call_location_(const char *file, int* line);
+/** Fortran binding + -fsecond-underscore **/
+XBT_PUBLIC(void) smpi_trace_set_call_location__(const char *file, int* line);
+
 #define SMPI_SAMPLE_LOCAL(iters,thres) for(smpi_sample_1(0, __FILE__, __LINE__, iters, thres); \
                                            smpi_sample_2(0, __FILE__, __LINE__);      \
                                            smpi_sample_3(0, __FILE__, __LINE__))
@@ -887,6 +904,10 @@ static void __attribute__((destructor)) __postfini_##name(void) { \
 
 #define SMPI_VARGET_GLOBAL(name) name[smpi_process_index()]
 
+/** 
+ * This is used for the old privatization method, i.e., on old
+ * machines that do not yet support privatization via mmap
+ */
 #define SMPI_VARINIT_STATIC(name,type)                      \
 static type *name = NULL;                                   \
 if(!name) {                                                 \
@@ -909,5 +930,6 @@ if(!name) {                                         \
 
 #define SMPI_VARGET_STATIC(name) name[smpi_process_index()]
 
+
 SG_END_DECL()
 #endif