This is meant to ease comparison with reference, as free format may differ with various compilers.
And output is also nicer.
p Test smpi bindings for dvfs functions (Fortran 77 example)
$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/simulate-computation:no ${bindir:=.}/f77/sef --cfg=plugin:Energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
-> [ 0.0000000000000000 ] [rank 0 ] 3 pstates available
-> [ 0.0000000000000000 ] [rank 1 ] 3 pstates available
-> [ 0.0000000000000000 ] [rank 0 ] Power: 100000000.00000000
-> [ 0.0000000000000000 ] [rank 1 ] Power: 100000000.00000000
-> [ 0.0000000000000000 ] [rank 0 ] Power: 50000000.000000000
-> [ 0.0000000000000000 ] [rank 1 ] Power: 50000000.000000000
-> [ 0.0000000000000000 ] [rank 0 ] Power: 20000000.000000000
-> [ 0.0000000000000000 ] [rank 1 ] Power: 20000000.000000000
-> [ 0.0000000000000000 ] [rank 0 ] Current pstate: 0 ; Current power: 100000000.00000000
-> [ 0.0000000000000000 ] [rank 1 ] Current pstate: 0 ; Current power: 100000000.00000000
-> [ 10.000000000000000 ] [rank 0 ] Energy consumed (Joules): 1200.0000000000000
-> [ 10.000000000000000 ] [rank 1 ] Energy consumed (Joules): 1200.0000000000000
-> [ 10.000000000000000 ] [rank 0 ] Current pstate: 1 ; Current power: 50000000.000000000
-> [ 10.000000000000000 ] [rank 1 ] Current pstate: 1 ; Current power: 50000000.000000000
-> [ 30.000000000000000 ] [rank 0 ] Energy consumed (Joules): 3400.0000000000000
-> [ 30.000000000000000 ] [rank 1 ] Energy consumed (Joules): 3400.0000000000000
-> [ 30.000000000000000 ] [rank 0 ] Current pstate: 2 ; Current power: 20000000.000000000
-> [ 30.000000000000000 ] [rank 1 ] Current pstate: 2 ; Current power: 20000000.000000000
-> [ 80.000000000000000 ] [rank 0 ] Energy consumed (Joules): 8650.0000000000000
-> [ 80.000000000000000 ] [rank 1 ] Energy consumed (Joules): 8650.0000000000000
+> [ 0.00000000] [rank 0] 3 pstates available
+> [ 0.00000000] [rank 1] 3 pstates available
+> [ 0.00000000] [rank 0] Power: 100000000.0000
+> [ 0.00000000] [rank 1] Power: 100000000.0000
+> [ 0.00000000] [rank 0] Power: 50000000.0000
+> [ 0.00000000] [rank 1] Power: 50000000.0000
+> [ 0.00000000] [rank 0] Power: 20000000.0000
+> [ 0.00000000] [rank 1] Power: 20000000.0000
+> [ 0.00000000] [rank 0] Current pstate: 0; Current power: 100000000.0000
+> [ 0.00000000] [rank 1] Current pstate: 0; Current power: 100000000.0000
+> [ 10.00000000] [rank 0] Energy consumed (Joules): 1200.0000
+> [ 10.00000000] [rank 1] Energy consumed (Joules): 1200.0000
+> [ 10.00000000] [rank 0] Current pstate: 1; Current power: 50000000.0000
+> [ 10.00000000] [rank 1] Current pstate: 1; Current power: 50000000.0000
+> [ 30.00000000] [rank 0] Energy consumed (Joules): 3400.0000
+> [ 30.00000000] [rank 1] Energy consumed (Joules): 3400.0000
+> [ 30.00000000] [rank 0] Current pstate: 2; Current power: 20000000.0000
+> [ 30.00000000] [rank 1] Current pstate: 2; Current power: 20000000.0000
+> [ 80.00000000] [rank 0] Energy consumed (Joules): 8650.0000
+> [ 80.00000000] [rank 1] Energy consumed (Joules): 8650.0000
> [80.000000] [surf_energy/INFO] Total energy consumption: 25300.000000 Joules (used hosts: 17300.000000 Joules; unused/idle hosts: 8000.000000)
> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 8650.000000 Joules
> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost2: 8650.000000 Joules
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)
- 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
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
+ 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()
- 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
call MPI_Finalize(ierr)
p Test smpi bindings for dvfs functions (Fortran 90 example)
! output sort 1
$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/simulate-computation:no ${bindir:=.}/f90/sef90 --cfg=plugin:Energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
-> [ 0.0000000000000000 ] [rank 0 ] 3 pstates available
-> [ 0.0000000000000000 ] [rank 1 ] 3 pstates available
-> [ 0.0000000000000000 ] [rank 0 ] Power: 100000000.00000000
-> [ 0.0000000000000000 ] [rank 1 ] Power: 100000000.00000000
-> [ 0.0000000000000000 ] [rank 0 ] Power: 50000000.000000000
-> [ 0.0000000000000000 ] [rank 1 ] Power: 50000000.000000000
-> [ 0.0000000000000000 ] [rank 0 ] Power: 20000000.000000000
-> [ 0.0000000000000000 ] [rank 1 ] Power: 20000000.000000000
-> [ 0.0000000000000000 ] [rank 0 ] Current pstate: 0 ; Current power: 100000000.00000000
-> [ 0.0000000000000000 ] [rank 1 ] Current pstate: 0 ; Current power: 100000000.00000000
-> [ 10.000000000000000 ] [rank 0 ] Energy consumed (Joules): 1200.0000000000000
-> [ 10.000000000000000 ] [rank 1 ] Energy consumed (Joules): 1200.0000000000000
-> [ 10.000000000000000 ] [rank 0 ] Current pstate: 1 ; Current power: 50000000.000000000
-> [ 10.000000000000000 ] [rank 1 ] Current pstate: 1 ; Current power: 50000000.000000000
-> [ 30.000000000000000 ] [rank 0 ] Energy consumed (Joules): 3400.0000000000000
-> [ 30.000000000000000 ] [rank 1 ] Energy consumed (Joules): 3400.0000000000000
-> [ 30.000000000000000 ] [rank 0 ] Current pstate: 2 ; Current power: 20000000.000000000
-> [ 30.000000000000000 ] [rank 1 ] Current pstate: 2 ; Current power: 20000000.000000000
-> [ 80.000000000000000 ] [rank 0 ] Energy consumed (Joules): 8650.0000000000000
-> [ 80.000000000000000 ] [rank 1 ] Energy consumed (Joules): 8650.0000000000000
+> [ 0.00000000] [rank 0] 3 pstates available
+> [ 0.00000000] [rank 1] 3 pstates available
+> [ 0.00000000] [rank 0] Power: 100000000.0000
+> [ 0.00000000] [rank 1] Power: 100000000.0000
+> [ 0.00000000] [rank 0] Power: 50000000.0000
+> [ 0.00000000] [rank 1] Power: 50000000.0000
+> [ 0.00000000] [rank 0] Power: 20000000.0000
+> [ 0.00000000] [rank 1] Power: 20000000.0000
+> [ 0.00000000] [rank 0] Current pstate: 0; Current power: 100000000.0000
+> [ 0.00000000] [rank 1] Current pstate: 0; Current power: 100000000.0000
+> [ 10.00000000] [rank 0] Energy consumed (Joules): 1200.0000
+> [ 10.00000000] [rank 1] Energy consumed (Joules): 1200.0000
+> [ 10.00000000] [rank 0] Current pstate: 1; Current power: 50000000.0000
+> [ 10.00000000] [rank 1] Current pstate: 1; Current power: 50000000.0000
+> [ 30.00000000] [rank 0] Energy consumed (Joules): 3400.0000
+> [ 30.00000000] [rank 1] Energy consumed (Joules): 3400.0000
+> [ 30.00000000] [rank 0] Current pstate: 2; Current power: 20000000.0000
+> [ 30.00000000] [rank 1] Current pstate: 2; Current power: 20000000.0000
+> [ 80.00000000] [rank 0] Energy consumed (Joules): 8650.0000
+> [ 80.00000000] [rank 1] Energy consumed (Joules): 8650.0000
> [80.000000] [surf_energy/INFO] Total energy consumption: 25300.000000 Joules (used hosts: 17300.000000 Joules; unused/idle hosts: 8000.000000)
> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 8650.000000 Joules
> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost2: 8650.000000 Joules
t = MPI_Wtime()
- print *, '[', t, '] [rank ', rank, ']', pstates, 'pstates available'
+ 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)
- 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
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
+ 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()
- print *, '[', t, '] [rank ', rank, '] Energy consumed (Joules): ', e
+ print '(1a,F15.8,1a,i2,1a,F15.4)', '[', t, '] [rank ', &
+ rank, '] Energy consumed (Joules): ', e
end do
call MPI_Finalize(ierr)