Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Fix cleanup of info->types
[simgrid.git] / examples / smpi / energy / se.c
index feaf9e3..ba969e5 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char *argv[])
   size_t sz, x;
 
   if (MPI_Init(&argc, &argv) != MPI_SUCCESS) {
-    printf("MPI initialization failed!\n");
+    fprintf(stderr, "MPI initialization failed!\n");
     exit(EXIT_FAILURE);
   }
 
@@ -44,19 +44,19 @@ int main(int argc, char *argv[])
     } else
       sz = 0;
   }
-  printf("%s%s\n", buf, (sz ? "" : " [...]"));
+  fprintf(stderr, "%s%s\n", buf, (sz ? "" : " [...]"));
 
   for (i = 0; i < pstates; i++) {
     smpi_set_host_power_peak_at(i);
-    printf("[%.6f] [rank %d] Current pstate: %d; Current power: %.0f\n",
-           MPI_Wtime(), rank, i, smpi_get_host_current_power_peak());
+    fprintf(stderr, "[%.6f] [rank %d] Current pstate: %d; Current power: %.0f\n",
+            MPI_Wtime(), rank, i, smpi_get_host_current_power_peak());
 
     SMPI_SAMPLE_FLOPS(1e9) {
       /* imagine here some code running for 1e9 flops... */
     }
 
-    printf("[%.6f] [rank %d] Energy consumed: %g Joules.\n",
-           MPI_Wtime(), rank, smpi_get_host_consumed_energy());
+    fprintf(stderr, "[%.6f] [rank %d] Energy consumed: %g Joules.\n",
+            MPI_Wtime(), rank, smpi_get_host_consumed_energy());
   }
 
   return MPI_Finalize();