From 4a073ae1f3fa87c1517d791028735c0b10d7d0b9 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 9 Jul 2019 19:14:38 +0200 Subject: [PATCH] Kill obsolete Fortran bindings for smpi/dvfs. --- ChangeLog | 3 +- MANIFEST.in | 7 -- examples/smpi/energy/f77/CMakeLists.txt | 10 --- examples/smpi/energy/f77/energy.tesh | 27 -------- examples/smpi/energy/f77/sef.f | 65 ------------------ examples/smpi/energy/f90/CMakeLists.txt | 10 --- examples/smpi/energy/f90/energy.tesh | 27 -------- examples/smpi/energy/f90/sef90.f90 | 64 ------------------ include/smpi/mpif.h.in | 14 ---- src/smpi/internals/smpi_bench.cpp | 13 ---- src/smpi/internals/smpi_dvfs.cpp | 90 ------------------------- tools/cmake/DefinePackages.cmake | 3 - 12 files changed, 2 insertions(+), 331 deletions(-) delete mode 100644 examples/smpi/energy/f77/CMakeLists.txt delete mode 100644 examples/smpi/energy/f77/energy.tesh delete mode 100644 examples/smpi/energy/f77/sef.f delete mode 100644 examples/smpi/energy/f90/CMakeLists.txt delete mode 100644 examples/smpi/energy/f90/energy.tesh delete mode 100644 examples/smpi/energy/f90/sef90.f90 delete mode 100644 src/smpi/internals/smpi_dvfs.cpp diff --git a/ChangeLog b/ChangeLog index 587d8bd800..11be8636b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,8 @@ SimGrid (3.23.3) NOT RELEASED YET (v3.24 expected September 23. 7:50 UTC) - +SMPI: + - Fortran bindings for DVFS have been removed. ---------------------------------------------------------------------------- diff --git a/MANIFEST.in b/MANIFEST.in index fa35cdbc9e..c8f1138965 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -432,10 +432,6 @@ include examples/smpi/ampi_test/ampi_test.cpp include examples/smpi/ampi_test/ampi_test.tesh include examples/smpi/energy/energy.c include examples/smpi/energy/energy.tesh -include examples/smpi/energy/f77/energy.tesh -include examples/smpi/energy/f77/sef.f -include examples/smpi/energy/f90/energy.tesh -include examples/smpi/energy/f90/sef90.f90 include examples/smpi/energy/hostfile include examples/smpi/gemm/gemm.c include examples/smpi/gemm/gemm.tesh @@ -1903,8 +1899,6 @@ include examples/python/async-waitany/async-waitany_d.xml include examples/s4u/CMakeLists.txt include examples/smpi/CMakeLists.txt include examples/smpi/NAS/CMakeLists.txt -include examples/smpi/energy/f77/CMakeLists.txt -include examples/smpi/energy/f90/CMakeLists.txt include examples/smpi/mc/non_deterministic.tesh include examples/smpi/mc/only_send_deterministic.tesh include examples/smpi/replay_multiple/CMakeLists.txt @@ -2482,7 +2476,6 @@ include src/smpi/internals/instr_smpi.cpp include src/smpi/internals/smpi_actor.cpp include src/smpi/internals/smpi_bench.cpp include src/smpi/internals/smpi_deployment.cpp -include src/smpi/internals/smpi_dvfs.cpp include src/smpi/internals/smpi_global.cpp include src/smpi/internals/smpi_host.cpp include src/smpi/internals/smpi_memory.cpp diff --git a/examples/smpi/energy/f77/CMakeLists.txt b/examples/smpi/energy/f77/CMakeLists.txt deleted file mode 100644 index 1f95dc76cd..0000000000 --- a/examples/smpi/energy/f77/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -if(enable_smpi AND SMPI_FORTRAN) - set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff") - add_executable (sef EXCLUDE_FROM_ALL sef.f) - target_link_libraries(sef simgrid) - add_dependencies(tests sef) - ADD_TESH_FACTORIES(smpi-energy-f77 "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/energy --cd ${CMAKE_BINARY_DIR}/examples/smpi/energy ${CMAKE_HOME_DIRECTORY}/examples/smpi/energy/f77/energy.tesh) -endif() - -set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/energy.tesh PARENT_SCOPE) -set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/sef.f PARENT_SCOPE) diff --git a/examples/smpi/energy/f77/energy.tesh b/examples/smpi/energy/f77/energy.tesh deleted file mode 100644 index 3b4e9e100b..0000000000 --- a/examples/smpi/energy/f77/energy.tesh +++ /dev/null @@ -1,27 +0,0 @@ -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:host_energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/wtime:0 -> [ 0.00000000] [rank 0] 3 pstates available -> [ 0.00000000] [rank 0] Power: 100000000.0000 -> [ 0.00000000] [rank 0] Power: 50000000.0000 -> [ 0.00000000] [rank 0] Power: 20000000.0000 -> [ 0.00000000] [rank 1] 3 pstates available -> [ 0.00000000] [rank 1] Power: 100000000.0000 -> [ 0.00000000] [rank 1] Power: 50000000.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): 2000.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): 5400.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): 12900.0000 -> [80.000000] [surf_energy/INFO] Total energy consumption: 29550.000000 Joules (used hosts: 21550.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: 12900.000000 Joules -> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost3: 8000.000000 Joules diff --git a/examples/smpi/energy/f77/sef.f b/examples/smpi/energy/f77/sef.f deleted file mode 100644 index f8d96c3112..0000000000 --- a/examples/smpi/energy/f77/sef.f +++ /dev/null @@ -1,65 +0,0 @@ -! Copyright (c) 2013-2019. The SimGrid Team. -! All rights reserved. - -! This program is free software; you can redistribute it and/or modify it -! under the terms of the license (GNU LGPL) which comes with this package. - - program main - include 'mpif.h' - - integer ierr - integer rank, pstates - integer i - double precision p, t, e - - call MPI_Init(ierr) - if (ierr .ne. MPI_SUCCESS) then - print *, 'MPI_Init failed:', ierr - stop 1 - endif - call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr) - if (ierr .ne. MPI_SUCCESS) then - print *, 'MPI_Comm_rank failed:', ierr - call MPI_Abort(MPI_COMM_WORLD, 1, ierr) - stop 1 - endif - - pstates = smpi_get_host_nb_pstates() - - t = MPI_Wtime() - - 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 '(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 '(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 '(1a,F15.8,1a,i2,1a,1a,F15.4)', '[', t, '] [rank ', - & rank, ']',' Energy consumed (Joules): ', e - end do - - flush(6) - - call MPI_Finalize(ierr) - if (ierr .ne. MPI_SUCCESS) then - print *, 'MPI_Finalize failed:', ierr - call MPI_Abort(MPI_COMM_WORLD, 1, ierr) - stop 1 - endif - - end program main diff --git a/examples/smpi/energy/f90/CMakeLists.txt b/examples/smpi/energy/f90/CMakeLists.txt deleted file mode 100644 index 9a107d53f3..0000000000 --- a/examples/smpi/energy/f90/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -if(enable_smpi AND SMPI_FORTRAN) - set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90") - add_executable (sef90 EXCLUDE_FROM_ALL sef90.f90) - target_link_libraries(sef90 simgrid mpi) - add_dependencies(tests sef90) - ADD_TESH_FACTORIES(smpi-energy-f90 "thread;ucontext;raw;boost" --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() - -set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/energy.tesh PARENT_SCOPE) -set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/sef90.f90 PARENT_SCOPE) diff --git a/examples/smpi/energy/f90/energy.tesh b/examples/smpi/energy/f90/energy.tesh deleted file mode 100644 index 1b759d4785..0000000000 --- a/examples/smpi/energy/f90/energy.tesh +++ /dev/null @@ -1,27 +0,0 @@ -p Test smpi bindings for dvfs functions (Fortran 90 example) - -$ ../../../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:host_energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/wtime:0 -> [ 0.00000000] [rank 0] 3 pstates available -> [ 0.00000000] [rank 0] Power: 100000000.0000 -> [ 0.00000000] [rank 0] Power: 50000000.0000 -> [ 0.00000000] [rank 0] Power: 20000000.0000 -> [ 0.00000000] [rank 1] 3 pstates available -> [ 0.00000000] [rank 1] Power: 100000000.0000 -> [ 0.00000000] [rank 1] Power: 50000000.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): 2000.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): 5400.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): 12900.0000 -> [80.000000] [surf_energy/INFO] Total energy consumption: 29550.000000 Joules (used hosts: 21550.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: 12900.000000 Joules -> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost3: 8000.000000 Joules diff --git a/examples/smpi/energy/f90/sef90.f90 b/examples/smpi/energy/f90/sef90.f90 deleted file mode 100644 index 245dfa9b8d..0000000000 --- a/examples/smpi/energy/f90/sef90.f90 +++ /dev/null @@ -1,64 +0,0 @@ -! Copyright (c) 2013-2019. The SimGrid Team. -! All rights reserved. - -! This program is free software; you can redistribute it and/or modify it -! under the terms of the license (GNU LGPL) which comes with this package. - -program main - use mpi - - integer ierr - integer rank, pstates - integer i - double precision p, t, e - - call MPI_Init(ierr) - if (ierr .ne. MPI_SUCCESS) then - print *, 'MPI_Init failed:', ierr - stop 1 - endif - call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr) - if (ierr .ne. MPI_SUCCESS) then - print *, 'MPI_Comm_rank failed:', ierr - call MPI_Abort(MPI_COMM_WORLD, 1, ierr) - stop 1 - endif - - pstates = smpi_get_host_nb_pstates() - - t = MPI_Wtime() - - 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 '(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 '(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 '(1a,F15.8,1a,i2,1a,F15.4)', '[', t, '] [rank ', & - rank, '] Energy consumed (Joules): ', e - end do - - flush(6) - - call MPI_Finalize(ierr) - if (ierr .ne. MPI_SUCCESS) then - print *, 'MPI_Finalize failed:', ierr - call MPI_Abort(MPI_COMM_WORLD, 1, ierr) - stop 1 - endif - -end program main diff --git a/include/smpi/mpif.h.in b/include/smpi/mpif.h.in index 96f726cb96..d30387a447 100644 --- a/include/smpi/mpif.h.in +++ b/include/smpi/mpif.h.in @@ -271,18 +271,4 @@ double precision MPI_WTIME double precision MPI_WTICK - - external smpi_execute_flops - external smpi_execute - external smpi_get_host_power_peak_at - external smpi_get_host_current_power_peak - external smpi_get_host_nb_pstates - external smpi_set_host_pstate - external smpi_get_host_consumed_energy - - double precision smpi_get_host_power_peak_at - double precision smpi_get_host_current_power_peak - integer smpi_get_host_nb_pstates - integer smpi_get_host_pstate - double precision smpi_get_host_consumed_energy @MODULE_MPIF_OUT@ diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index af6cf7817b..a10ac85fc9 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -38,19 +38,6 @@ double smpi_host_speed; SharedMallocType smpi_cfg_shared_malloc = SharedMallocType::GLOBAL; double smpi_total_benched_time = 0; -extern "C" XBT_PUBLIC void smpi_execute_flops_(double* flops); - -void smpi_execute_flops_(double *flops) -{ - smpi_execute_flops(*flops); -} - -extern "C" XBT_PUBLIC void smpi_execute_(double* duration); -void smpi_execute_(double *duration) -{ - smpi_execute(*duration); -} - void smpi_execute_flops(double flops) { xbt_assert(flops >= 0, "You're trying to execute a negative amount of flops (%f)!", flops); XBT_DEBUG("Handle real computation time: %f flops", flops); diff --git a/src/smpi/internals/smpi_dvfs.cpp b/src/smpi/internals/smpi_dvfs.cpp deleted file mode 100644 index 1347c247a8..0000000000 --- a/src/smpi/internals/smpi_dvfs.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -#include - -// FIXME: this plugin should be separated from the core -#include "simgrid/s4u/Host.hpp" -#include -#include - -#include - -#include "src/internal_config.h" - -#if SMPI_FORTRAN - -// FIXME: rework these bindings, or kill them completely - -#if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__) -typedef int integer; -#else -typedef long int integer; -#endif -typedef double doublereal; - -/** - * @brief Return the speed of the processor (in flop/s) at a given pstate - * - * @param pstate_index pstate to test - * @return Returns the processor speed associated with pstate_index - */ -extern "C" XBT_PUBLIC doublereal smpi_get_host_power_peak_at_(integer* pstate_index); -doublereal smpi_get_host_power_peak_at_(integer *pstate_index) -{ - return static_cast(sg_host_self()->get_pstate_speed(static_cast(*pstate_index))); -} - -/** - * @brief Return the current speed of the processor (in flop/s) - * - * @return Returns the current processor speed - */ -extern "C" XBT_PUBLIC doublereal smpi_get_host_current_power_peak_(); -doublereal smpi_get_host_current_power_peak_() -{ - return static_cast(sg_host_self()->get_speed()); -} - -/** - * @brief Return the number of pstates defined for the current host - */ -extern "C" XBT_PUBLIC integer smpi_get_host_nb_pstates_(); -integer smpi_get_host_nb_pstates_() -{ - return static_cast(sg_host_self()->get_pstate_count()); -} - -/** - * @brief Sets the pstate at which the processor should run - * - * @param pstate_index pstate to switch to - */ -extern "C" XBT_PUBLIC void smpi_set_host_pstate_(integer* pstate_index); -void smpi_set_host_pstate_(integer *pstate_index) -{ - sg_host_set_pstate(sg_host_self(), (static_cast(*pstate_index))); -} - -/** - * @brief Gets the pstate at which the processor currently running - */ -extern "C" XBT_PUBLIC integer smpi_get_host_pstate_(); -integer smpi_get_host_pstate_() -{ - return static_cast(sg_host_get_pstate(sg_host_self())); -} -/** - * @brief Return the total energy consumed by a host (in Joules) - * - * @return Returns the consumed energy - */ -extern "C" XBT_PUBLIC doublereal smpi_get_host_consumed_energy_(); -doublereal smpi_get_host_consumed_energy_() -{ - return static_cast(sg_host_get_consumed_energy(sg_host_self())); -} - -#endif diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 11bd51d1e2..143ca4be77 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -217,7 +217,6 @@ set(SMPI_SRC src/smpi/internals/smpi_memory.cpp src/smpi/internals/smpi_shared.cpp src/smpi/internals/smpi_deployment.cpp - src/smpi/internals/smpi_dvfs.cpp src/smpi/internals/smpi_global.cpp src/smpi/internals/smpi_host.cpp src/smpi/internals/smpi_replay.cpp @@ -992,8 +991,6 @@ set(CMAKEFILES_TXT examples/smpi/smpi_msg_masterslave/CMakeLists.txt examples/smpi/replay_multiple/CMakeLists.txt examples/smpi/replay_multiple_manual_deploy/CMakeLists.txt - examples/smpi/energy/f77/CMakeLists.txt - examples/smpi/energy/f90/CMakeLists.txt examples/python/CMakeLists.txt examples/deprecated/java/CMakeLists.txt examples/deprecated/msg/CMakeLists.txt -- 2.20.1