Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add Fortran bindigns for smpi+dvfs.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 6 Nov 2013 23:12:02 +0000 (00:12 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 7 Nov 2013 08:21:32 +0000 (09:21 +0100)
include/smpi/mpif.h.in
include/smpi/smpi.h
src/smpi/smpi_bench.c
src/smpi/smpi_dvfs.c

index c6a96a2..213fe84 100644 (file)
 
       double precision MPI_WTIME
       double precision MPI_WTICK
 
       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_power_peak_at
+      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
+      double precision smpi_get_host_consumed_energy
index 3901734..be167eb 100644 (file)
@@ -685,11 +685,15 @@ 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);
-XBT_PUBLIC(double) smpi_get_host_current_power_peak(void);
-XBT_PUBLIC(int) smpi_get_host_nb_pstates(void);
+#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(void) smpi_set_host_power_peak_at(int pstate_index);
 XBT_PUBLIC(void) smpi_set_host_power_peak_at(int pstate_index);
-XBT_PUBLIC(double) smpi_get_host_consumed_energy(void);
+#define smpi_get_host_consumed_energy() smpi_get_host_consumed_energy_()
 
 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 cc313b7..b0f25dc 100644 (file)
@@ -126,6 +126,18 @@ void smpi_bench_destroy(void)
   xbt_dict_free(&calls);
 }
 
   xbt_dict_free(&calls);
 }
 
+XBT_PUBLIC(void) smpi_execute_flops_(double *flops);
+void smpi_execute_flops_(double *flops)
+{
+  smpi_execute_flops(*flops);
+}
+
+XBT_PUBLIC(void) smpi_execute_(double *duration);
+void smpi_execute_(double *duration)
+{
+  smpi_execute(*duration);
+}
+
 void smpi_execute_flops(double flops) {
   smx_action_t action;
   smx_host_t host;
 void smpi_execute_flops(double flops) {
   smx_action_t action;
   smx_host_t host;
index b5aee9a..352e548 100644 (file)
@@ -11,6 +11,9 @@
 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
  *
@@ -22,12 +25,17 @@ 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());
 }
@@ -35,7 +43,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());
 }
@@ -50,12 +58,17 @@ 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());
 }