Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add/update copyright notices.
[simgrid.git] / examples / smpi / MM / 2.5D_MM.c
index eb61096..041342e 100644 (file)
@@ -1,3 +1,9 @@
+/* Copyright (c) 2012-2014. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 /*!
  * 2.5D Block Matrix Multiplication example
  *
@@ -7,6 +13,7 @@
 #include "Summa.h"
 #include "2.5D_MM.h"
 #include <stdlib.h>
+#include <stdio.h>
 #include "xbt/log.h"
 #define CHECK_25D 1
 
@@ -195,7 +202,7 @@ double two_dot_five(
     MPI_Barrier(my_world);
   }
   end_time_intern = MPI_Wtime();
-  communication_time += start_time - end_time_intern;
+  communication_time += end_time_intern - start_time;
 
   XBT_INFO( "group %zu NB_block: %zu, NB_groups %zu\n"
               ,group,NB_Block, NB_groups);
@@ -237,10 +244,10 @@ double two_dot_five(
 
   MPI_Barrier(my_world);
   end_time = MPI_Wtime();
-  time = start_time - end_time;
-  double reduce_time = start_time_reduce - end_time_reduce;
-  printf("communication time: %le reduce time: %le nanoseconds, "
-         "total time: %le nanoseconds\n",communication_time,reduce_time,time);
+  time = end_time - start_time;
+  double reduce_time = end_time_reduce - start_time_reduce;
+  printf("communication time: %e reduce time: %e seconds, "
+         "total time: %seconds\n",communication_time,reduce_time,time);
   MPI_Barrier(my_world);
 
 #if CHECK_25D