1 ! Copyright (c) 2013-2014. The SimGrid Team.
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.
13 double precision p, t, e
16 if (ierr .ne. MPI_SUCCESS) then
17 print *, 'MPI_Init failed:', ierr
20 call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
21 if (ierr .ne. MPI_SUCCESS) then
22 print *, 'MPI_Comm_rank failed:', ierr
23 call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
27 pstates = smpi_get_host_nb_pstates()
31 print '(1a,F15.8,1a,i2,1a,i2,1a)', '[', t, '] [rank ', rank, '] ',
32 & pstates, ' pstates available'
35 p = smpi_get_host_power_peak_at(i)
36 print '(1a,F15.8,1a,i2,1a,F15.4)', '[', t, '] [rank ',
37 & rank, '] Power: ', p
41 call smpi_set_host_pstate(i)
43 p = smpi_get_host_current_power_peak()
44 print '(1a,F15.8,1a,i2,1a,i2,1a,F15.4)', '[', t, '] [rank ',
45 & rank,'] Current pstate: ', i,'; Current power: ', p
48 call smpi_execute_flops(e)
51 e = smpi_get_host_consumed_energy()
52 print '(1a,F15.8,1a,i2,1a,1a,F15.4)', '[', t, '] [rank ',
53 & rank, ']',' Energy consumed (Joules): ', e
58 call MPI_Finalize(ierr)
59 if (ierr .ne. MPI_SUCCESS) then
60 print *, 'MPI_Finalize failed:', ierr
61 call MPI_Abort(MPI_COMM_WORLD, 1, ierr)