Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / smpi / colls / bcast-binomial-tree.c
index ae67cfc..955a814 100644 (file)
@@ -1,4 +1,10 @@
-#include "colls.h"
+/* Copyright (c) 2013-2014. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "colls_private.h"
 
 /*****************************************************************************
 
@@ -68,10 +74,10 @@ smpi_coll_tuned_bcast_binomial_tree(void *buff, int count,
                                     MPI_Comm comm)
 {
   int src, dst, rank, num_procs, mask, relative_rank;
-  int tag = 1, success = 0;
+  int tag = COLL_TAG_BCAST;
 
-  MPI_Comm_rank(comm, &rank);
-  MPI_Comm_size(comm, &num_procs);
+  rank = smpi_comm_rank(comm);
+  num_procs = smpi_comm_size(comm);
 
   relative_rank = (rank >= root) ? rank - root : rank - root + num_procs;
 
@@ -81,7 +87,7 @@ smpi_coll_tuned_bcast_binomial_tree(void *buff, int count,
       src = rank - mask;
       if (src < 0)
         src += num_procs;
-      MPI_Recv(buff, count, data_type, src, tag, comm, MPI_STATUS_IGNORE);
+      smpi_mpi_recv(buff, count, data_type, src, tag, comm, MPI_STATUS_IGNORE);
       break;
     }
     mask <<= 1;
@@ -93,10 +99,10 @@ smpi_coll_tuned_bcast_binomial_tree(void *buff, int count,
       dst = rank + mask;
       if (dst >= num_procs)
         dst -= num_procs;
-      MPI_Send(buff, count, data_type, dst, tag, comm);
+      smpi_mpi_send(buff, count, data_type, dst, tag, comm);
     }
     mask >>= 1;
   }
 
-  return success;
+  return MPI_SUCCESS;
 }