endif()
ADD_TEST(smpi-energy ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/energy.tesh)
+ if(SMPI_F2C)
+ ADD_TEST(smpi-energy-f77 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f77/energy.tesh)
+ ADD_TEST(smpi-energy-f90 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f90/energy.tesh)
+ endif()
if(HAVE_TRACING)
ADD_TEST(smpi-tracing-ptp ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/tracing/smpi_traced.tesh)
examples/smpi/CMakeLists.txt
examples/smpi/MM/CMakeLists.txt
examples/smpi/energy/CMakeLists.txt
+ examples/smpi/energy/f77/CMakeLists.txt
+ examples/smpi/energy/f90/CMakeLists.txt
examples/xbt/CMakeLists.txt
)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/MM)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/energy)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f77)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f90)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/xbt)
--- /dev/null
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND SMPI_F2C)
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+
+ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+ add_executable(sef sef.f)
+ target_link_libraries(sef simgrid)
+endif()
+
+set(tesh_files
+ ${tesh_files}
+ ${CMAKE_CURRENT_SOURCE_DIR}/energy.tesh
+ PARENT_SCOPE
+ )
+set(xml_files
+ ${xml_files}
+ PARENT_SCOPE
+ )
+set(examples_src
+ ${examples_src}
+ ${CMAKE_CURRENT_SOURCE_DIR}/sef.f
+ PARENT_SCOPE
+ )
+set(bin_files
+ ${bin_files}
+ PARENT_SCOPE
+ )
+set(txt_files
+ ${txt_files}
+ PARENT_SCOPE
+ )
--- /dev/null
+p Test smpi bindings for dvfs functions (Fortran 77 example)
+$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/platform.xml --cfg=smpi/cpu_threshold:-1 ${bindir:=.}/f77/sef
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1'
+> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [ 0.] [rank 0] 3pstates available
+> [ 0.] [rank 1] 1pstates available
+> [ 0.] [rank 0] Power: 100000000.
+> [ 0.] [rank 1] Power: 100000000.
+> [ 0.] [rank 0] Power: 50000000.
+> [ 0.] [rank 0] Power: 20000000.
+> [ 0.] [rank 1] Current pstate: 0; Current power: 100000000.
+> [ 0.] [rank 0] Current pstate: 0; Current power: 100000000.
+> [ 10.] [rank 1]Energy consumed (Joules): 2000.
+> [ 10.] [rank 0]Energy consumed (Joules): 2000.
+> [ 10.] [rank 0] Current pstate: 1; Current power: 50000000.
+> [ 30.] [rank 0]Energy consumed (Joules): 5400.
+> [ 30.] [rank 0] Current pstate: 2; Current power: 20000000.
+> [ 80.] [rank 0]Energy consumed (Joules): 12900.
--- /dev/null
+ program main
+ include 'mpif.h'
+
+ integer ierr
+ integer rank, pstates
+ integer i
+ double precision p, t, e
+
+ call MPI_Init(ierr)
+ call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
+
+ pstates = smpi_get_host_nb_pstates()
+
+ t = MPI_Wtime()
+
+ print *, '[', 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
+ end do
+
+ do i = 0, pstates - 1
+ call smpi_set_host_power_peak_at(i)
+ t = MPI_Wtime()
+ p = smpi_get_host_current_power_peak()
+ print *, '[', 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
+ end do
+
+ call MPI_Finalize(ierr)
+
+ end program main
--- /dev/null
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND SMPI_F2C)
+ set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
+
+ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+ add_executable(sef90 sef90.f90)
+ target_link_libraries(sef90 simgrid)
+endif()
+
+set(tesh_files
+ ${tesh_files}
+ ${CMAKE_CURRENT_SOURCE_DIR}/energy.tesh
+ PARENT_SCOPE
+ )
+set(xml_files
+ ${xml_files}
+ PARENT_SCOPE
+ )
+set(examples_src
+ ${examples_src}
+ ${CMAKE_CURRENT_SOURCE_DIR}/sef90.f90
+ PARENT_SCOPE
+ )
+set(bin_files
+ ${bin_files}
+ PARENT_SCOPE
+ )
+set(txt_files
+ ${txt_files}
+ PARENT_SCOPE
+ )
--- /dev/null
+p Test smpi bindings for dvfs functions (Fortran 90 example)
+$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/platform.xml --cfg=smpi/cpu_threshold:-1 ${bindir:=.}/f90/sef90
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1'
+> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [ 0.0000000000000000 ] [rank 0 ] 3 pstates available
+> [ 0.0000000000000000 ] [rank 1 ] 1 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 0 ] Power: 20000000.000000000
+> [ 0.0000000000000000 ] [rank 1 ] Current pstate: 0 ; Current power: 100000000.00000000
+> [ 0.0000000000000000 ] [rank 0 ] Current pstate: 0 ; Current power: 100000000.00000000
+> [ 10.000000000000000 ] [rank 1 ] Energy consumed (Joules): 2000.0000000000000
+> [ 10.000000000000000 ] [rank 0 ] Energy consumed (Joules): 2000.0000000000000
+> [ 10.000000000000000 ] [rank 0 ] Current pstate: 1 ; Current power: 50000000.000000000
+> [ 30.000000000000000 ] [rank 0 ] Energy consumed (Joules): 5400.0000000000000
+> [ 30.000000000000000 ] [rank 0 ] Current pstate: 2 ; Current power: 20000000.000000000
+> [ 80.000000000000000 ] [rank 0 ] Energy consumed (Joules): 12900.000000000000
--- /dev/null
+program main
+ use mpi
+
+ integer ierr
+ integer rank, pstates
+ integer i
+ double precision p, t, e
+
+ call MPI_Init(ierr)
+ call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
+
+ pstates = smpi_get_host_nb_pstates()
+
+ t = MPI_Wtime()
+
+ print *, '[', 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
+ end do
+
+ do i = 0, pstates - 1
+ call smpi_set_host_power_peak_at(i)
+ t = MPI_Wtime()
+ p = smpi_get_host_current_power_peak()
+ print *, '[', 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
+ end do
+
+ call MPI_Finalize(ierr)
+
+end program main