Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[Energy] Fix broken commit c6fc463d75e4daa67ddf9c460cbc473b1aa9d6ba
[simgrid.git] / examples / smpi / energy / f90 / sef90.f90
index f1db81a..14e3a71 100644 (file)
@@ -13,7 +13,16 @@ program main
   double precision p, t, e
 
   call MPI_Init(ierr)
+  if (ierr .ne. MPI_SUCCESS) then
+     print *, 'MPI_Init failed:', ierr
+     stop 1
+  endif
   call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
+  if (ierr .ne. MPI_SUCCESS) then
+     print *, 'MPI_Comm_rank failed:', ierr
+     call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
+     stop 1
+  endif
 
   pstates = smpi_get_host_nb_pstates()
 
@@ -26,7 +35,7 @@ program main
   end do
 
   do i = 0, pstates - 1
-     call smpi_set_host_power_peak_at(i)
+     call smpi_set_host_pstate(i)
      t = MPI_Wtime()
      p = smpi_get_host_current_power_peak()
      print *, '[', t, '] [rank ', rank, '] Current pstate: ', i, '; Current power: ', p
@@ -40,5 +49,10 @@ program main
   end do
 
   call MPI_Finalize(ierr)
+  if (ierr .ne. MPI_SUCCESS) then
+     print *, 'MPI_Finalize failed:', ierr
+     call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
+     stop 1
+  endif
 
 end program main