A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix distcheck, and cosmetics.
[simgrid.git]
/
examples
/
smpi
/
energy
/
f77
/
sef.f
diff --git
a/examples/smpi/energy/f77/sef.f
b/examples/smpi/energy/f77/sef.f
index
51a6ea2
..
f8d96c3
100644
(file)
--- a/
examples/smpi/energy/f77/sef.f
+++ b/
examples/smpi/energy/f77/sef.f
@@
-1,4
+1,4
@@
-! Copyright (c) 2013-201
4
. The SimGrid Team.
+! Copyright (c) 2013-201
9
. The SimGrid Team.
! All rights reserved.
! This program is free software; you can redistribute it and/or modify it
! All rights reserved.
! This program is free software; you can redistribute it and/or modify it
@@
-13,36
+13,53
@@
double precision p, t, e
call MPI_Init(ierr)
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)
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()
pstates = smpi_get_host_nb_pstates()
t = MPI_Wtime()
- print
*, '[', t, '] [rank ', rank, ']
',
+ print
'(1a,F15.8,1a,i2,1a,i2,1a)', '[', t, '] [rank ', rank, ']
',
& pstates, ' pstates available'
do i = 0, pstates - 1
p = smpi_get_host_power_peak_at(i)
& pstates, ' pstates available'
do i = 0, pstates - 1
p = smpi_get_host_power_peak_at(i)
- print *, '[', t, '] [rank ', rank, '] Power: ', p
+ print '(1a,F15.8,1a,i2,1a,F15.4)', '[', t, '] [rank ',
+ & rank, '] Power: ', p
end do
do i = 0, pstates - 1
end do
do i = 0, pstates - 1
- call smpi_set_host_p
ower_peak_at
(i)
+ call smpi_set_host_p
state
(i)
t = MPI_Wtime()
p = smpi_get_host_current_power_peak()
t = MPI_Wtime()
p = smpi_get_host_current_power_peak()
- print
*, '[', t, '] [rank ', rank, '] Current pstate: ', i
,
- & '; Current power: ', p
+ print
'(1a,F15.8,1a,i2,1a,i2,1a,F15.4)', '[', t, '] [rank '
,
+ &
rank,'] Current pstate: ', i,
'; Current power: ', p
e = 1e9
call smpi_execute_flops(e)
t = MPI_Wtime()
e = smpi_get_host_consumed_energy()
e = 1e9
call smpi_execute_flops(e)
t = MPI_Wtime()
e = smpi_get_host_consumed_energy()
- print
*, '[', t, '] [rank ', rank, ']
',
- & ' Energy consumed (Joules): ', e
+ print
'(1a,F15.8,1a,i2,1a,1a,F15.4)', '[', t, '] [rank
',
+ &
rank, ']',
' Energy consumed (Joules): ', e
end do
end do
+ flush(6)
+
call MPI_Finalize(ierr)
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
end program main