Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Parameters were in wrong order.
[simgrid.git] / examples / smpi / energy / f77 / sef.f
1 ! Copyright (c) 2013-2014. The SimGrid Team.
2 ! All rights reserved.
3
4 ! This program is free software; you can redistribute it and/or modify it
5 ! under the terms of the license (GNU LGPL) which comes with this package.
6
7       program main
8       include 'mpif.h'
9
10       integer ierr
11       integer rank, pstates
12       integer i
13       double precision p, t, e
14
15       call MPI_Init(ierr)
16       call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
17
18       pstates = smpi_get_host_nb_pstates()
19
20       t = MPI_Wtime()
21
22       print *, '[', t, '] [rank ', rank, ']',
23      &     pstates, ' pstates available'
24
25       do i = 0, pstates - 1
26          p = smpi_get_host_power_peak_at(i)
27          print *, '[', t, '] [rank ', rank, '] Power: ', p
28       end do
29
30       do i = 0, pstates - 1
31          call smpi_set_host_power_peak_at(i)
32          t = MPI_Wtime()
33          p = smpi_get_host_current_power_peak()
34          print *, '[', t, '] [rank ', rank, '] Current pstate: ', i,
35      &        '; Current power: ', p
36
37          e = 1e9
38          call smpi_execute_flops(e)
39
40          t = MPI_Wtime()
41          e = smpi_get_host_consumed_energy()
42          print *, '[', t, '] [rank ', rank, ']',
43      &        ' Energy consumed (Joules): ', e
44       end do
45
46       call MPI_Finalize(ierr)
47
48       end program main