Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
potential fixes
[simgrid.git] / src / smpi / colls / smpi_mpich_selector.c
index d999646..5ecdb86 100644 (file)
@@ -1,6 +1,6 @@
 /* selector for collective algorithms based on mpich decision logic */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -167,7 +167,7 @@ int smpi_coll_tuned_alltoall_mpich( void *sbuf, int scount,
                                                     comm);
 
     } else if (block_dsize < medium_size) {
-        return smpi_coll_tuned_alltoall_simple(sbuf, scount, sdtype, 
+        return smpi_coll_tuned_alltoall_basic_linear(sbuf, scount, sdtype, 
                                                            rbuf, rcount, rdtype, 
                                                            comm);
     }else if (communicator_size%2){
@@ -176,7 +176,7 @@ int smpi_coll_tuned_alltoall_mpich( void *sbuf, int scount,
                                                            comm);
     }
 
-    return smpi_coll_tuned_alltoall_ompi_pairwise (sbuf, scount, sdtype,
+    return smpi_coll_tuned_alltoall_ring (sbuf, scount, sdtype,
                                                     rbuf, rcount, rdtype,
                                                     comm);
 }
@@ -598,18 +598,16 @@ int smpi_coll_tuned_allgatherv_mpich(void *sbuf, int scount,
                                                )
 {
     int communicator_size, pow2_size,i;
-    size_t dsize, total_dsize;
+    size_t total_dsize;
 
     communicator_size = smpi_comm_size(comm);
 
     /* Determine complete data size */
-    dsize=smpi_datatype_size(sdtype);
-    total_dsize = dsize * scount * communicator_size;   
-
     total_dsize = 0;
     for (i=0; i<communicator_size; i++)
         total_dsize += rcounts[i];
-    if (total_dsize == 0) return MPI_SUCCESS;
+    if (total_dsize == 0)
+      return MPI_SUCCESS;
     
     for (pow2_size  = 1; pow2_size < communicator_size; pow2_size <<=1); 
 
@@ -696,8 +694,12 @@ int smpi_coll_tuned_scatter_mpich(void *sbuf, int scount,
       scount=rcount;
       sdtype=rdtype;
   }
-        return smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype, 
+  int ret= smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype,
                                                        rbuf, rcount, rdtype, 
                                                        root, comm);
+  if(smpi_comm_rank(comm)!=root){
+      xbt_free(sbuf);
+  }
+  return ret;
 }