Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix 32 bits builds.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 7 Nov 2013 09:54:16 +0000 (10:54 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 7 Nov 2013 10:02:52 +0000 (11:02 +0100)
f2c defines integer as long int on 32 bits systems.

include/smpi/smpi.h
src/smpi/smpi_dvfs.c

index be167eb..3901734 100644 (file)
@@ -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(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);
 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);
 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);
 
 XBT_PUBLIC(unsigned int) smpi_sleep(unsigned int secs);
 XBT_PUBLIC(int) smpi_gettimeofday(struct timeval *tv);
index 352e548..4a71979 100644 (file)
@@ -11,9 +11,6 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_dvfs, smpi,
                                 "Logging specific to SMPI (experimental DVFS support)");
 
 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
  *
 /**
  * \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);
 }
 
   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
  */
 /**
  * \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());
 }
 {
   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
  */
 /**
  * \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());
 }
 {
   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);
 }
 
   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
  */
 /**
  * \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());
 }
 {
   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