AMPI #1631: add extension API to reset LB database 78/2778/2
authorSam White <white67@illinois.edu>
Thu, 13 Jul 2017 02:55:54 +0000 (21:55 -0500)
committerSam White <white67@illinois.edu>
Thu, 13 Jul 2017 21:29:22 +0000 (16:29 -0500)
Change-Id: I22e73111007c8756241c1c0a432b391c8ec4ac8e

README.ampi
doc/ampi/manual.tex
src/libs/ck-libs/ampi/ampi.C
src/libs/ck-libs/ampi/ampi.h
src/libs/ck-libs/ampi/ampif.C

index 939563f27666e41d509d8e98bd75d76bc6350b49..b8a1a24ec1b9446145af0f40bd3093531c7320d8 100644 (file)
@@ -91,6 +91,7 @@ prefixed with AMPI_:
     * AMPI_Load_set_value sets the calling rank's load to the given user value.
     * AMPI_Load_start_measure starts load balance information collection.
     * AMPI_Load_stop_measure stops load balance information collection.
+    * AMPI_Load_reset_measure clears the load balance database.
     * AMPI_Migrate_to_pe migrates the calling rank to the given PE.
     * AMPI_Set_migratable sets the migratability of the calling rank.
     * AMPI_Command_argument_count returns the number of command line arguments
index 534aa4a9519a18817c2778eecaa4e63409c67a3c..5a15ab2d89132f62440841bb8acd56499958e02e 100644 (file)
@@ -763,8 +763,9 @@ just actually migrated.
 
 \ampi{} provide routines for starting and stopping load measurements, and for
 users to explicitly set the load value of a rank using the following:
-\texttt{AMPI\_Load\_start\_measure}, \texttt{AMPI\_Load\_stop\_measure}, and
-\texttt{AMPI\_Load\_set\_value}. And since \ampi{} builds on top of \charmpp{},
+\texttt{AMPI\_Load\_start\_measure}, \texttt{AMPI\_Load\_stop\_measure},
+\texttt{AMPI\_Load\_reset\_measure}, and \texttt{AMPI\_Load\_set\_value}.
+And since \ampi{} builds on top of \charmpp{},
 users can experiment with the suite of load balancing strategies included with
 \charmpp{}, as well as write their own strategies based on user-level
 information and heuristics.
index 238942fe049c8b39fe0e514690474ea8cdb9fd05..b612326149cbbab49198341335f6e6d9fb18d6db 100644 (file)
@@ -9356,6 +9356,14 @@ int AMPI_Load_stop_measure(void)
   return MPI_SUCCESS;
 }
 
+CDECL
+int AMPI_Load_reset_measure(void)
+{
+  AMPIAPI("AMPI_Load_reset_measure");
+  LBClearLoads();
+  return MPI_SUCCESS;
+}
+
 CDECL
 int AMPI_Load_set_value(double value)
 {
index 5656db330b6a9d7e0d3d0810544f6116ca14e31b..5d4e0483111ab9133fe7cbc634387509372d5b56 100644 (file)
@@ -1047,6 +1047,7 @@ int AMPI_Info_free(MPI_Info *info);
 int AMPI_Migrate(MPI_Info hints);
 int AMPI_Load_start_measure(void);
 int AMPI_Load_stop_measure(void);
+int AMPI_Load_reset_measure(void);
 int AMPI_Load_set_value(double value);
 int AMPI_Migrate_to_pe(int dest);
 int AMPI_Set_migratable(int mig);
index 785e08d0fd9a8e3718971248a8aa5021016c6a61..9b155245776af2f3129e0048e8f7248b34f9ad7c 100644 (file)
@@ -273,6 +273,7 @@ FDECL {
 #define ampi_migrate FTN_NAME( AMPI_MIGRATE , ampi_migrate )
 #define ampi_load_start_measure FTN_NAME( AMPI_LOAD_START_MEASURE, ampi_load_start_measure )
 #define ampi_load_stop_measure FTN_NAME( AMPI_LOAD_STOP_MEASURE, ampi_load_stop_measure )
+#define ampi_load_reset_measure FTN_NAME( AMPI_LOAD_RESET_MEASURE, ampi_load_reset_measure )
 #define ampi_load_set_value FTN_NAME( AMPI_SET_LOAD_VALUE, ampi_load_set_value )
 #define ampi_evacuate FTN_NAME ( AMPI_EVACUATE , ampi_evacuate )
 #define ampi_migrate_to_pe FTN_NAME( AMPI_MIGRATE_TO_PE , ampi_migrate_to_pe )
@@ -1809,6 +1810,10 @@ void ampi_load_stop_measure(int *ierr) {
   *ierr = AMPI_Load_stop_measure();
 }
 
+void ampi_load_reset_measure(int *ierr) {
+  *ierr = AMPI_Load_reset_measure();
+}
+
 void ampi_load_set_value(double *value, int *ierr) {
   *ierr = AMPI_Load_set_value(*value);
 }