Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
indent to avoid GCC6 warning madness
[simgrid.git] / src / smpi / colls / smpi_mvapich2_selector_stampede.h
index 65796c2..28baf73 100644 (file)
@@ -49,6 +49,8 @@ static void init_mv2_alltoall_tables_stampede(){
   int agg_table_sum = 0;
   mv2_alltoall_tuning_table **table_ptrs = NULL;
   mv2_alltoall_num_ppn_conf = 3;
+  if(smpi_coll_cleanup_callback==NULL)
+    smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
   mv2_alltoall_thresholds_table = xbt_malloc(sizeof(mv2_alltoall_tuning_table *)
       * mv2_alltoall_num_ppn_conf);
   table_ptrs = xbt_malloc(sizeof(mv2_alltoall_tuning_table *)
@@ -593,6 +595,8 @@ MV2_Gather_function_ptr MV2_Gather_intra_node_function = NULL;
 
 static void init_mv2_gather_tables_stampede(){
 
+  if(smpi_coll_cleanup_callback==NULL)
+    smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
   mv2_size_gather_tuning_table=7;
   mv2_gather_thresholds_table = xbt_malloc(mv2_size_gather_tuning_table*
       sizeof (mv2_gather_tuning_table));
@@ -678,6 +682,8 @@ mv2_allgatherv_tuning_table *mv2_allgatherv_thresholds_table = NULL;
 
 
 static void init_mv2_allgatherv_tables_stampede(){
+  if(smpi_coll_cleanup_callback==NULL)
+    smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
   mv2_size_allgatherv_tuning_table = 6;
   mv2_allgatherv_thresholds_table = xbt_malloc(mv2_size_allgatherv_tuning_table *
       sizeof (mv2_allgatherv_tuning_table));
@@ -824,6 +830,8 @@ static  int MPIR_Allreduce_reduce_shmem_MV2( void *sendbuf,
 
 
 static void init_mv2_allreduce_tables_stampede(){
+  if(smpi_coll_cleanup_callback==NULL)
+    smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
   mv2_size_allreduce_tuning_table = 8;
   mv2_allreduce_thresholds_table = xbt_malloc(mv2_size_allreduce_tuning_table *
       sizeof (mv2_allreduce_tuning_table));
@@ -1022,9 +1030,11 @@ int mv2_intra_node_knomial_factor = 4;
 
 static void init_mv2_bcast_tables_stampede(){
  //Stampede,
-        mv2_size_bcast_tuning_table=8;
-        mv2_bcast_thresholds_table = xbt_malloc(mv2_size_bcast_tuning_table *
-                                                 sizeof (mv2_bcast_tuning_table));
+  if(smpi_coll_cleanup_callback==NULL)
+    smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+  mv2_size_bcast_tuning_table=8;
+  mv2_bcast_thresholds_table = xbt_malloc(mv2_size_bcast_tuning_table *
+  sizeof (mv2_bcast_tuning_table));
 
   mv2_bcast_tuning_table mv2_tmp_bcast_thresholds_table[]={
     {
@@ -1259,8 +1269,8 @@ int mv2_size_reduce_tuning_table = 0;
 mv2_reduce_tuning_table *mv2_reduce_thresholds_table = NULL;
 
 
-int mv2_reduce_intra_knomial_factor = 2;
-int mv2_reduce_inter_knomial_factor = 2;
+int mv2_reduce_intra_knomial_factor = -1;
+int mv2_reduce_inter_knomial_factor = -1;
 
 int (*MV2_Reduce_function)( void *sendbuf,
     void *recvbuf,
@@ -1288,6 +1298,8 @@ int (*MV2_Reduce_intra_function)( void *sendbuf,
 
 
 static void init_mv2_reduce_tables_stampede(){
+  if(smpi_coll_cleanup_callback==NULL)
+    smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
   /*Stampede*/
   mv2_size_reduce_tuning_table = 8;
   mv2_reduce_thresholds_table = xbt_malloc(mv2_size_reduce_tuning_table *
@@ -1530,6 +1542,8 @@ static  int MPIR_Reduce_Scatter_Basic_MV2(void *sendbuf,
 
 
 static void init_mv2_reduce_scatter_tables_stampede(){
+  if(smpi_coll_cleanup_callback==NULL)
+    smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
   mv2_size_red_scat_tuning_table = 6;
   mv2_red_scat_thresholds_table = xbt_malloc(mv2_size_red_scat_tuning_table *
       sizeof (mv2_red_scat_tuning_table));
@@ -1654,7 +1668,9 @@ int MPIR_Scatter_mcst_wrap_MV2(void *sendbuf,
 
 
 static void init_mv2_scatter_tables_stampede(){
-  {
+    if(smpi_coll_cleanup_callback==NULL)
+      smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
+
     int agg_table_sum = 0;
     int i;
     mv2_scatter_tuning_table **table_ptrs = NULL;
@@ -1961,6 +1977,6 @@ static void init_mv2_scatter_tables_stampede(){
                 * mv2_size_scatter_tuning_table[i]));
     }
     xbt_free(table_ptrs);
-  }
+  
 }