Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add formatting to out fortran energy tests.
authordegomme <augustin.degomme@unibas.ch>
Tue, 23 May 2017 16:35:02 +0000 (18:35 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Tue, 23 May 2017 16:35:13 +0000 (18:35 +0200)
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
examples/smpi/energy/f77/sef.f
examples/smpi/energy/f90/energy.tesh
examples/smpi/energy/f90/sef90.f90

index b6a69d8..3ea74d9 100644 (file)
@@ -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
 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
 > [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
index 1c00d59..b4aba21 100644 (file)
 
       t = MPI_Wtime()
 
 
       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
          call smpi_set_host_pstate(i)
          t = MPI_Wtime()
          p = smpi_get_host_current_power_peak()
       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()
 
          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)
       end do
 
       call MPI_Finalize(ierr)
index deff318..aa6cd21 100644 (file)
@@ -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
 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
 > [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
index 14e3a71..ebd5485 100644 (file)
@@ -28,24 +28,28 @@ program main
 
   t = MPI_Wtime()
 
 
   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)
   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()
   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()
 
      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)
   end do
 
   call MPI_Finalize(ierr)