Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add tesh files to test all new collectives
[simgrid.git] / src / smpi / colls / alltoall-rdb.c
index 406d98d..edee61a 100644 (file)
@@ -33,7 +33,7 @@ int smpi_coll_tuned_alltoall_rdb(void *send_buff, int send_count,
   int dst_tree_root, rank_tree_root, send_offset, recv_offset;
   int rank, num_procs, j, k, dst, curr_size, max_size;
   int last_recv_count, tmp_mask, tree_root, num_procs_completed;
   int dst_tree_root, rank_tree_root, send_offset, recv_offset;
   int rank, num_procs, j, k, dst, curr_size, max_size;
   int last_recv_count, tmp_mask, tree_root, num_procs_completed;
-  int tag = 1, mask = 1, success = 1, failure = 0, i = 0;
+  int tag = 1, mask = 1, i = 0;
 
   char *tmp_buff;
   char *send_ptr = (char *) send_buff;
 
   char *tmp_buff;
   char *send_ptr = (char *) send_buff;
@@ -50,12 +50,7 @@ int smpi_coll_tuned_alltoall_rdb(void *send_buff, int send_count,
 
   max_size = num_procs * recv_increment;
 
 
   max_size = num_procs * recv_increment;
 
-  tmp_buff = (char *) malloc(max_size);
-  if (!tmp_buff) {
-    printf("alltoall-rdb:56: cannot allocate memory\n");
-    MPI_Finalize();
-    exit(failure);
-  }
+  tmp_buff = (char *) xbt_malloc(max_size);
 
   curr_size = send_count * num_procs;
 
 
   curr_size = send_count * num_procs;
 
@@ -149,5 +144,5 @@ int smpi_coll_tuned_alltoall_rdb(void *send_buff, int send_count,
                  recv_ptr + (i * recv_count * extent),
                  recv_count, recv_type, rank, tag, comm, &status);
   free(tmp_buff);
                  recv_ptr + (i * recv_count * extent),
                  recv_count, recv_type, rank, tag, comm, &status);
   free(tmp_buff);
-  return success;
+  return MPI_SUCCESS;
 }
 }