From 73cbfa99f18cbf27ece76baf22e68baf49da4001 Mon Sep 17 00:00:00 2001 From: degomme Date: Tue, 23 May 2017 18:35:02 +0200 Subject: [PATCH 1/1] Add formatting to out fortran energy tests. This is meant to ease comparison with reference, as free format may differ with various compilers. And output is also nicer. --- examples/smpi/energy/f77/energy.tesh | 40 ++++++++++++++-------------- examples/smpi/energy/f77/sef.f | 13 ++++----- examples/smpi/energy/f90/energy.tesh | 40 ++++++++++++++-------------- examples/smpi/energy/f90/sef90.f90 | 12 ++++++--- 4 files changed, 55 insertions(+), 50 deletions(-) diff --git a/examples/smpi/energy/f77/energy.tesh b/examples/smpi/energy/f77/energy.tesh index b6a69d88ef..3ea74d9370 100644 --- a/examples/smpi/energy/f77/energy.tesh +++ b/examples/smpi/energy/f77/energy.tesh @@ -1,26 +1,26 @@ 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 diff --git a/examples/smpi/energy/f77/sef.f b/examples/smpi/energy/f77/sef.f index 1c00d59bd7..b4aba21ddc 100644 --- a/examples/smpi/energy/f77/sef.f +++ b/examples/smpi/energy/f77/sef.f @@ -28,28 +28,29 @@ 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) diff --git a/examples/smpi/energy/f90/energy.tesh b/examples/smpi/energy/f90/energy.tesh index deff318e24..aa6cd218ba 100644 --- a/examples/smpi/energy/f90/energy.tesh +++ b/examples/smpi/energy/f90/energy.tesh @@ -1,26 +1,26 @@ 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 diff --git a/examples/smpi/energy/f90/sef90.f90 b/examples/smpi/energy/f90/sef90.f90 index 14e3a71af8..ebd5485a69 100644 --- a/examples/smpi/energy/f90/sef90.f90 +++ b/examples/smpi/energy/f90/sef90.f90 @@ -28,24 +28,28 @@ program main 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) -- 2.20.1