Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
potential fixes
authorAugustin Degomme <degomme@idpann.imag.fr>
Wed, 6 Nov 2013 14:42:17 +0000 (15:42 +0100)
committerAugustin Degomme <degomme@idpann.imag.fr>
Wed, 6 Nov 2013 20:14:30 +0000 (21:14 +0100)
src/smpi/colls/scatter-ompi.c
src/smpi/smpi_base.c

index c65b6f9..9d30811 100644 (file)
@@ -145,13 +145,15 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
            total_send += mycount;
        }
 
            total_send += mycount;
        }
 
-       if (NULL != tempbuf) 
-           free(tempbuf);
+
     } else {
        /* recv from parent on leaf nodes */
        smpi_mpi_recv(ptmp, rcount, rdtype, bmtree->tree_prev,
                                COLL_TAG_SCATTER, comm, &status);
     }
     } else {
        /* recv from parent on leaf nodes */
        smpi_mpi_recv(ptmp, rcount, rdtype, bmtree->tree_prev,
                                COLL_TAG_SCATTER, comm, &status);
     }
+
+    if (NULL != tempbuf)
+      free(tempbuf);
     //!FIXME : store the tree, as done in ompi, instead of calculating it each time ?
     xbt_free(bmtree);
 
     //!FIXME : store the tree, as done in ompi, instead of calculating it each time ?
     xbt_free(bmtree);
 
index 2632bac..a6a3c57 100644 (file)
@@ -86,13 +86,13 @@ static xbt_dynar_t parse_factor(const char *smpi_coef_string)
   char *value = NULL;
   unsigned int iter = 0;
   s_smpi_factor_t fact;
   char *value = NULL;
   unsigned int iter = 0;
   s_smpi_factor_t fact;
+  fact.nb_values=0;
   int i=0;
   xbt_dynar_t smpi_factor, radical_elements, radical_elements2 = NULL;
 
   smpi_factor = xbt_dynar_new(sizeof(s_smpi_factor_t), NULL);
   radical_elements = xbt_str_split(smpi_coef_string, ";");
   xbt_dynar_foreach(radical_elements, iter, value) {
   int i=0;
   xbt_dynar_t smpi_factor, radical_elements, radical_elements2 = NULL;
 
   smpi_factor = xbt_dynar_new(sizeof(s_smpi_factor_t), NULL);
   radical_elements = xbt_str_split(smpi_coef_string, ";");
   xbt_dynar_foreach(radical_elements, iter, value) {
-    fact.nb_values=0;
     radical_elements2 = xbt_str_split(value, ":");
     if (xbt_dynar_length(radical_elements2) <2 || xbt_dynar_length(radical_elements2) > 5)
       xbt_die("Malformed radical for smpi factor!");
     radical_elements2 = xbt_str_split(value, ":");
     if (xbt_dynar_length(radical_elements2) <2 || xbt_dynar_length(radical_elements2) > 5)
       xbt_die("Malformed radical for smpi factor!");
@@ -414,6 +414,7 @@ void smpi_mpi_start(MPI_Request request)
 void smpi_mpi_startall(int count, MPI_Request * requests)
 {
   int i;
 void smpi_mpi_startall(int count, MPI_Request * requests)
 {
   int i;
+  if(requests==NULL) return;
 
   for(i = 0; i < count; i++) {
     smpi_mpi_start(requests[i]);
 
   for(i = 0; i < count; i++) {
     smpi_mpi_start(requests[i]);