Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New XBT module: file
[simgrid.git] / teshsuite / bug-17132 / bug-17132.c
index cecb3e4..9cd6985 100644 (file)
@@ -1,3 +1,9 @@
+/* Copyright (c) 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. */
+
 #include "xbt/log.h"
 #include <stdio.h>
 #include <mpi.h>
@@ -12,6 +18,9 @@ int main(int argc, char ** argv)
 
   MPI_Init(&argc, &argv);
 
+  int rank;
+  MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+
   double *a = malloc(sizeof(double) * M);
   double *b = malloc(sizeof(double) * N);
 
@@ -33,6 +42,10 @@ int main(int argc, char ** argv)
   // Commenting out this barrier fixes it!!
   MPI_Barrier(MPI_COMM_WORLD);
 
+  if(rank==0) {
+    printf("Walltime = %g\n",MPI_Wtime());
+  }
+
   MPI_Finalize();
   free(a);
   free(b);