X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2de79bc865dabba07eab819a75ed61b7860d999a..f2df13795e01302813a6aef10825ec7e922ce530:/examples/smpi/energy/f77/sef.f diff --git a/examples/smpi/energy/f77/sef.f b/examples/smpi/energy/f77/sef.f index a1588bef20..a4c464448e 100644 --- a/examples/smpi/energy/f77/sef.f +++ b/examples/smpi/energy/f77/sef.f @@ -1,3 +1,9 @@ +! Copyright (c) 2013-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. + program main include 'mpif.h' @@ -7,14 +13,23 @@ 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() t = MPI_Wtime() print *, '[', t, '] [rank ', rank, ']', - & pstates, 'pstates available' + & pstates, ' pstates available' do i = 0, pstates - 1 p = smpi_get_host_power_peak_at(i) @@ -34,9 +49,14 @@ t = MPI_Wtime() e = smpi_get_host_consumed_energy() print *, '[', t, '] [rank ', rank, ']', - & 'Energy consumed (Joules): ', e + & ' Energy consumed (Joules): ', e 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