Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix tests with timers by properly detecting POSIX_TIMERS
authordegomme <augustin.degomme@unibas.ch>
Tue, 3 Apr 2018 21:23:55 +0000 (23:23 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Tue, 3 Apr 2018 21:23:55 +0000 (23:23 +0200)
include/smpi/smpi_helpers.h
teshsuite/smpi/timers/timers.c

index 9f6f0b5..d6e828e 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MPI_HELPERS_H
 #define MPI_HELPERS_H
 
 #ifndef MPI_HELPERS_H
 #define MPI_HELPERS_H
 
+#include <unistd.h>
 #include <sys/time.h> /* Load it before the define next line to not mess with the system headers */
 
 #define sleep(x) smpi_sleep(x)
 #include <sys/time.h> /* Load it before the define next line to not mess with the system headers */
 
 #define sleep(x) smpi_sleep(x)
index ad0cab5..a347934 100644 (file)
@@ -49,7 +49,7 @@ int main(int argc, char* argv[])
   clock_gettime(CLOCK_REALTIME, &tp1);
   clock_gettime(CLOCK_REALTIME, &tp2);
   if (tp1.tv_sec != tp2.tv_sec || tp1.tv_nsec != tp2.tv_nsec)
   clock_gettime(CLOCK_REALTIME, &tp1);
   clock_gettime(CLOCK_REALTIME, &tp2);
   if (tp1.tv_sec != tp2.tv_sec || tp1.tv_nsec != tp2.tv_nsec)
-    printf("Error, two consecutive calls to gettimeofday did not return same time (with running power to 0)\n");
+    printf("Error, two consecutive calls to clock_gettime did not return same time (with running power to 0)\n");
 
   // nanosleep for 100ns
   clock_gettime(CLOCK_REALTIME, &tp1);
 
   // nanosleep for 100ns
   clock_gettime(CLOCK_REALTIME, &tp1);