Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add another ompi bcast algo
[simgrid.git] / src / smpi / colls / smpi_openmpi_selector.c
index 946370a..5d7d5af 100644 (file)
@@ -32,7 +32,7 @@ int smpi_coll_tuned_allreduce_ompi(void *sbuf, void *rbuf, int count,
                                                                    op, comm));
     } 
 
-    if( /*smpi_op_is_commute(op) && */(count > comm_size) ) {
+    if( smpi_op_is_commute(op) && (count > comm_size) ) {
         const size_t segment_size = 1 << 20; /* 1 MB */
         if ((comm_size * segment_size >= block_dsize)) {
             //FIXME: ok, these are not the right algorithms, try to find closer ones
@@ -41,7 +41,7 @@ int smpi_coll_tuned_allreduce_ompi(void *sbuf, void *rbuf, int count,
                                               op, comm);
         } else {
            // return (smpi_coll_tuned_allreduce_intra_ring_segmented (sbuf, rbuf, 
-           return (smpi_coll_tuned_allreduce_rab2 (sbuf, rbuf,
+           return (smpi_coll_tuned_allreduce_ompi_ring_segmented (sbuf, rbuf,
                                                                     count, dtype, 
                                                                     op, comm 
                                                                     /*segment_size*/));
@@ -129,20 +129,20 @@ int smpi_coll_tuned_bcast_ompi(void *buff, int count,
 {
     /* Decision function based on MX results for 
        messages up to 36MB and communicator sizes up to 64 nodes */
-    //const size_t small_message_size = 2048;
+    const size_t small_message_size = 2048;
     const size_t intermediate_message_size = 370728;
-    //const double a_p16  = 3.2118e-6; /* [1 / byte] */
-    //const double b_p16  = 8.7936;   
-    //const double a_p64  = 2.3679e-6; /* [1 / byte] */
-    //const double b_p64  = 1.1787;     
-    //const double a_p128 = 1.6134e-6; /* [1 / byte] */
-    //const double b_p128 = 2.1102;
-
-    //int communicator_size;
+    const double a_p16  = 3.2118e-6; /* [1 / byte] */
+    const double b_p16  = 8.7936;   
+    const double a_p64  = 2.3679e-6; /* [1 / byte] */
+    const double b_p64  = 1.1787;     
+    const double a_p128 = 1.6134e-6; /* [1 / byte] */
+    const double b_p128 = 2.1102;
+
+    int communicator_size;
     //int segsize = 0;
     size_t message_size, dsize;
 
-    //communicator_size = smpi_comm_size(comm);
+    communicator_size = smpi_comm_size(comm);
 
     /* else we need data size for decision function */
     dsize = smpi_datatype_size(datatype);
@@ -150,52 +150,45 @@ int smpi_coll_tuned_bcast_ompi(void *buff, int count,
 
     /* Handle messages of small and intermediate size, and 
        single-element broadcasts */
-    if ((message_size < /*small_message_size*/intermediate_message_size) || (count <= 1)) {
+    if ((message_size < small_message_size) || (count <= 1)) {
         /* Binomial without segmentation */
-        //segsize = 0;
         return  smpi_coll_tuned_bcast_binomial_tree (buff, count, datatype, 
-                                                      root, comm/*
-                                                      segsize*/);
+                                                      root, comm);
 
-    } /*else if (message_size < intermediate_message_size) {
+    } else if (message_size < intermediate_message_size) {
         // SplittedBinary with 1KB segments
-        segsize = 1024;
-        return smpi_coll_tuned_bcast_split_bintree(buff, count, datatype, 
-                                                         root, comm
-                                                         segsize);
+        return smpi_coll_tuned_bcast_ompi_split_bintree(buff, count, datatype, 
+                                                         root, comm);
 
-    } 
-     Handle large message sizes 
+    }
+     //Handle large message sizes 
     else if (communicator_size < (a_p128 * message_size + b_p128)) {
-         Pipeline with 128KB segments 
-        segsize = 1024  << 7;
-        return smpi_coll_tuned_bcast_flattree_pipeline (buff, count, datatype, 
-                                                     root, comm, module,
-                                                     segsize);
+        //Pipeline with 128KB segments 
+        //segsize = 1024  << 7;
+        return smpi_coll_tuned_bcast_ompi_pipeline (buff, count, datatype, 
+                                                     root, comm);
+                                                     
 
     } else if (communicator_size < 13) {
         // Split Binary with 8KB segments 
-        segsize = 1024 << 3;
-        return smpi_coll_tuned_bcast_intra_split_bintree(buff, count, datatype, 
-                                                         root, comm, module,
-                                                         segsize);
+        return smpi_coll_tuned_bcast_ompi_split_bintree(buff, count, datatype, 
+                                                         root, comm);
        
     } else if (communicator_size < (a_p64 * message_size + b_p64)) {
         // Pipeline with 64KB segments 
-        segsize = 1024 << 6;
-        return smpi_coll_tuned_bcast_intra_pipeline (buff, count, datatype, 
-                                                     root, comm, module,
-                                                     segsize);
+        //segsize = 1024 << 6;
+        return smpi_coll_tuned_bcast_ompi_pipeline (buff, count, datatype, 
+                                                     root, comm);
+                                                     
 
     } else if (communicator_size < (a_p16 * message_size + b_p16)) {
-         Pipeline with 16KB segments 
+        //Pipeline with 16KB segments 
         //segsize = 1024 << 4;
-        return smpi_coll_tuned_bcast_flattree_pipeline (buff, count, datatype, 
-                                                     root, comm, module,
-                                                     segsize);
-
-    }*/
+        return smpi_coll_tuned_bcast_ompi_pipeline (buff, count, datatype, 
+                                                     root, comm);
+                                                     
 
+    }
     /* Pipeline with 8KB segments */
     //segsize = 1024 << 3;
     return smpi_coll_tuned_bcast_flattree_pipeline (buff, count, datatype,