From 1cf252a37e8e724c4be9154d8ac16891284fb862 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 7 Nov 2013 10:54:16 +0100 Subject: [PATCH] Fix 32 bits builds. f2c defines integer as long int on 32 bits systems. (cherry picked from commit 612d201268a4154815e62436f30da3e6323486ee) --- include/smpi/smpi.h | 10 +++----- src/smpi/smpi_dvfs.c | 55 +++++++++++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index be167eb546..3901734b77 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -685,15 +685,11 @@ XBT_PUBLIC(void) smpi_exit(int); XBT_PUBLIC(void) smpi_execute_flops(double flops); XBT_PUBLIC(void) smpi_execute(double duration); -XBT_PUBLIC(double) smpi_get_host_current_power_peak_(void); -XBT_PUBLIC(int) smpi_get_host_nb_pstates_(void); -XBT_PUBLIC(double) smpi_get_host_consumed_energy_(void); - XBT_PUBLIC(double) smpi_get_host_power_peak_at(int pstate_index); -#define smpi_get_host_current_power_peak() smpi_get_host_current_power_peak_() -#define smpi_get_host_nb_pstates() smpi_get_host_nb_pstates_() +XBT_PUBLIC(double) smpi_get_host_current_power_peak(void); +XBT_PUBLIC(int) smpi_get_host_nb_pstates(void); XBT_PUBLIC(void) smpi_set_host_power_peak_at(int pstate_index); -#define smpi_get_host_consumed_energy() smpi_get_host_consumed_energy_() +XBT_PUBLIC(double) smpi_get_host_consumed_energy(void); XBT_PUBLIC(unsigned int) smpi_sleep(unsigned int secs); XBT_PUBLIC(int) smpi_gettimeofday(struct timeval *tv); diff --git a/src/smpi/smpi_dvfs.c b/src/smpi/smpi_dvfs.c index 352e548efc..4a71979cd6 100644 --- a/src/smpi/smpi_dvfs.c +++ b/src/smpi/smpi_dvfs.c @@ -11,9 +11,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_dvfs, smpi, "Logging specific to SMPI (experimental DVFS support)"); -XBT_PUBLIC(double) smpi_get_host_power_peak_at_(int *pstate_index); -XBT_PUBLIC(void) smpi_set_host_power_peak_at_(int *pstate_index); - /** * \brief Return the speed of the processor (in flop/s) at a given pstate * @@ -25,17 +22,12 @@ double smpi_get_host_power_peak_at(int pstate_index) return simcall_host_get_power_peak_at(SIMIX_host_self(), pstate_index); } -double smpi_get_host_power_peak_at_(int *pstate_index) -{ - return smpi_get_host_power_peak_at(*pstate_index); -} - /** * \brief Return the current speed of the processor (in flop/s) * * \return Returns the current processor speed */ -double smpi_get_host_current_power_peak_(void) +double smpi_get_host_current_power_peak(void) { return simcall_host_get_current_power_peak(SIMIX_host_self()); } @@ -43,7 +35,7 @@ double smpi_get_host_current_power_peak_(void) /** * \brief Return the number of pstates defined for host */ -int smpi_get_host_nb_pstates_(void) +int smpi_get_host_nb_pstates(void) { return simcall_host_get_nb_pstates(SIMIX_host_self()); } @@ -58,17 +50,48 @@ void smpi_set_host_power_peak_at(int pstate_index) simcall_host_set_power_peak_at(SIMIX_host_self(), pstate_index); } -void smpi_set_host_power_peak_at_(int *pstate_index) -{ - smpi_set_host_power_peak_at(*pstate_index); -} - /** * \brief Return the total energy consumed by a host (in Joules) * * \return Returns the consumed energy */ -double smpi_get_host_consumed_energy_(void) +double smpi_get_host_consumed_energy(void) { return simcall_host_get_consumed_energy(SIMIX_host_self()); } + +#include "smpi/smpif.h" + +#ifdef SMPI_F2C + +XBT_PUBLIC(doublereal) smpi_get_host_power_peak_at_(integer *pstate_index); +doublereal smpi_get_host_power_peak_at_(integer *pstate_index) +{ + return (doublereal)smpi_get_host_power_peak_at((int)*pstate_index); +} + +XBT_PUBLIC(doublereal) smpi_get_host_current_power_peak_(void); +doublereal smpi_get_host_current_power_peak_(void) +{ + return smpi_get_host_current_power_peak(); +} + +XBT_PUBLIC(integer) smpi_get_host_nb_pstates_(void); +integer smpi_get_host_nb_pstates_(void) +{ + return (integer)smpi_get_host_nb_pstates(); +} + +XBT_PUBLIC(void) smpi_set_host_power_peak_at_(integer *pstate_index); +void smpi_set_host_power_peak_at_(integer *pstate_index) +{ + smpi_set_host_power_peak_at((int)*pstate_index); +} + +XBT_PUBLIC(doublereal) smpi_get_host_consumed_energy_(void); +doublereal smpi_get_host_consumed_energy_(void) +{ + return (doublereal)smpi_get_host_consumed_energy(); +} + +#endif -- 2.20.1