Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'dvfs'
authoracarpena <alexandra.carpen-amarie@inria.fr>
Fri, 5 Jul 2013 01:53:41 +0000 (01:53 +0000)
committeracarpena <alexandra.carpen-amarie@inria.fr>
Fri, 5 Jul 2013 01:53:41 +0000 (01:53 +0000)
Added DVFS and energy consumption support.

99 files changed:
ChangeLog
include/msg/msg.h
include/simgrid/simix.h
src/msg/msg_host.c
src/simix/smx_host.c
src/simix/smx_host_private.h
src/simix/smx_smurf_private.h
src/simix/smx_user.c
src/smpi/colls/allgather-2dmesh.c
src/smpi/colls/allgather-3dmesh.c
src/smpi/colls/allgather-NTSLR-NB.c
src/smpi/colls/allgather-NTSLR.c
src/smpi/colls/allgather-SMP-NTS.c
src/smpi/colls/allgather-bruck.c
src/smpi/colls/allgather-loosely-lr.c
src/smpi/colls/allgather-lr.c
src/smpi/colls/allgather-ompi-neighborexchange.c
src/smpi/colls/allgather-pair.c
src/smpi/colls/allgather-rdb.c
src/smpi/colls/allgather-rhv.c
src/smpi/colls/allgather-ring.c
src/smpi/colls/allgather-smp-simple.c
src/smpi/colls/allgather-spreading-simple.c
src/smpi/colls/allgatherv-mpich-rdb.c
src/smpi/colls/allgatherv-ompi-bruck.c
src/smpi/colls/allgatherv-ompi-neighborexchange.c
src/smpi/colls/allgatherv-pair.c
src/smpi/colls/allgatherv-ring.c
src/smpi/colls/allreduce-NTS.c
src/smpi/colls/allreduce-lr.c
src/smpi/colls/allreduce-rab-rdb.c
src/smpi/colls/allreduce-rab-reduce-scatter.c
src/smpi/colls/allreduce-rab-rsag.c
src/smpi/colls/allreduce-rab1.c
src/smpi/colls/allreduce-rdb.c
src/smpi/colls/allreduce-smp-binomial-pipeline.c
src/smpi/colls/allreduce-smp-binomial.c
src/smpi/colls/allreduce-smp-rdb.c
src/smpi/colls/allreduce-smp-rsag-lr.c
src/smpi/colls/allreduce-smp-rsag-rab.c
src/smpi/colls/allreduce-smp-rsag.c
src/smpi/colls/alltoall-2dmesh.c
src/smpi/colls/alltoall-3dmesh.c
src/smpi/colls/alltoall-bruck.c
src/smpi/colls/alltoall-ompi-pairwise.c
src/smpi/colls/alltoall-pair-light-barrier.c
src/smpi/colls/alltoall-pair-mpi-barrier.c
src/smpi/colls/alltoall-pair-one-barrier.c
src/smpi/colls/alltoall-pair.c
src/smpi/colls/alltoall-rdb.c
src/smpi/colls/alltoall-ring-light-barrier.c
src/smpi/colls/alltoall-ring-mpi-barrier.c
src/smpi/colls/alltoall-ring-one-barrier.c
src/smpi/colls/alltoall-ring.c
src/smpi/colls/alltoall-simple.c
src/smpi/colls/alltoallv-bruck.c
src/smpi/colls/alltoallv-ompi-basic-linear.c
src/smpi/colls/alltoallv-pair-light-barrier.c
src/smpi/colls/alltoallv-pair-mpi-barrier.c
src/smpi/colls/alltoallv-pair-one-barrier.c
src/smpi/colls/alltoallv-pair.c
src/smpi/colls/alltoallv-ring-light-barrier.c
src/smpi/colls/alltoallv-ring-mpi-barrier.c
src/smpi/colls/alltoallv-ring-one-barrier.c
src/smpi/colls/alltoallv-ring.c
src/smpi/colls/barrier-ompi.c
src/smpi/colls/bcast-NTSB.c
src/smpi/colls/bcast-NTSL-Isend.c
src/smpi/colls/bcast-NTSL.c
src/smpi/colls/bcast-SMP-binary.c
src/smpi/colls/bcast-SMP-binomial.c
src/smpi/colls/bcast-SMP-linear.c
src/smpi/colls/bcast-arrival-nb.c
src/smpi/colls/bcast-arrival-pattern-aware-wait.c
src/smpi/colls/bcast-arrival-pattern-aware.c
src/smpi/colls/bcast-arrival-scatter.c
src/smpi/colls/bcast-binomial-tree.c
src/smpi/colls/bcast-flattree-pipeline.c
src/smpi/colls/bcast-flattree.c
src/smpi/colls/bcast-ompi-pipeline.c
src/smpi/colls/bcast-ompi-split-bintree.c
src/smpi/colls/bcast-scatter-LR-allgather.c
src/smpi/colls/bcast-scatter-rdb-allgather.c
src/smpi/colls/gather-ompi.c
src/smpi/colls/reduce-NTSL.c
src/smpi/colls/reduce-arrival-pattern-aware.c
src/smpi/colls/reduce-binomial.c
src/smpi/colls/reduce-flat-tree.c
src/smpi/colls/reduce-ompi.c
src/smpi/colls/reduce-scatter-gather.c
src/smpi/colls/reduce_scatter-mpich.c
src/smpi/colls/reduce_scatter-ompi.c
src/smpi/colls/scatter-ompi.c
src/smpi/private.h
src/smpi/smpi_base.c
src/smpi/smpi_comm.c
src/smpi/smpi_pmpi.c
src/smpi/smpi_replay.c
teshsuite/smpi/mpich-test/coll/grouptest.c

index a47f3a3..98b7afe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,7 @@ SimGrid (3.10) NOT RELEASED; urgency=low
  * Dramatically change the way files are handled. API and internals changed, but
    this part of MSG was not considered as production grade either.
  * Add explicit synchronization facilities through semaphores
+ * Add a new function MSG_host_get_process_list()
 
  SMPI:
  * SMPI is now included directly in the libsimgrid as the windows
index 79035dc..fb6508d 100644 (file)
@@ -101,6 +101,7 @@ XBT_PUBLIC(int) MSG_get_host_msgload(msg_host_t host);
 /* int MSG_get_msgload(void); This function lacks specification; discard it */
 XBT_PUBLIC(double) MSG_get_host_speed(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_get_core_number(msg_host_t h);
+XBT_PUBLIC(xbt_swag_t) MSG_host_get_process_list(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_is_avail(msg_host_t h);
 XBT_PUBLIC(void) __MSG_host_destroy(msg_host_priv_t host);
 
index 909c0de..5ac6e2c 100644 (file)
@@ -295,6 +295,7 @@ XBT_PUBLIC(smx_host_t) simcall_host_get_by_name(const char *name);
 XBT_PUBLIC(const char *) simcall_host_get_name(smx_host_t host);
 XBT_PUBLIC(xbt_dict_t) simcall_host_get_properties(smx_host_t host);
 XBT_PUBLIC(int) simcall_host_get_core(smx_host_t host);
+XBT_PUBLIC(xbt_swag_t) simcall_host_get_process_list(smx_host_t host);
 XBT_PUBLIC(double) simcall_host_get_speed(smx_host_t host);
 XBT_PUBLIC(double) simcall_host_get_available_speed(smx_host_t host);
 /* Two possible states, 1 - CPU ON and 0 CPU OFF */
index 6e1e568..7a2c69c 100644 (file)
@@ -204,7 +204,10 @@ double MSG_get_host_speed(msg_host_t h)
 
 
 /** \ingroup m_host_management
- * \brief Return the number of core.
+ * \brief Return the number of cores.
+ *
+ * \param host a host
+ * \return the number of cores
  */
 int MSG_host_get_core_number(msg_host_t h)
 {
@@ -213,6 +216,20 @@ int MSG_host_get_core_number(msg_host_t h)
   return (simcall_host_get_core(h));
 }
 
+/** \ingroup m_host_management
+ * \brief Return the list of processes attached to an host.
+ *
+ * \param host a host
+ * \return a swag with the attached processes
+ */
+xbt_swag_t MSG_host_get_process_list(msg_host_t h)
+{
+  xbt_assert((h != NULL), "Invalid parameters");
+
+  return (simcall_host_get_process_list(h));
+}
+
+
 /** \ingroup m_host_management
  * \brief Returns the value of a given host property
  *
index 4b67596..1882fcb 100644 (file)
@@ -158,6 +158,16 @@ int SIMIX_host_get_core(smx_host_t host){
       get_core(host);
 }
 
+xbt_swag_t SIMIX_pre_host_get_process_list(smx_simcall_t simcall, smx_host_t host){
+  return SIMIX_host_get_process_list(host);
+}
+
+xbt_swag_t SIMIX_host_get_process_list(smx_host_t host){
+  xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+  smx_host_priv_t host_priv = SIMIX_host_priv(host);
+
+  return host_priv->process_list;
+}
 
 
 double SIMIX_pre_host_get_available_speed(smx_simcall_t simcall, smx_host_t host){
index 78abd02..ea66ee6 100644 (file)
@@ -39,6 +39,7 @@ void SIMIX_host_restart_processes(smx_host_t host);
 void SIMIX_host_autorestart(smx_host_t host);
 xbt_dict_t SIMIX_host_get_properties(smx_host_t host);
 int SIMIX_host_get_core(smx_host_t host);
+xbt_swag_t SIMIX_host_get_process_list(smx_host_t host);
 double SIMIX_host_get_speed(smx_host_t host);
 double SIMIX_host_get_available_speed(smx_host_t host);
 int SIMIX_host_get_state(smx_host_t host);
@@ -66,6 +67,7 @@ const char* SIMIX_pre_host_self_get_name(smx_simcall_t);
 const char* SIMIX_pre_host_get_name(smx_simcall_t, smx_host_t);
 xbt_dict_t SIMIX_pre_host_get_properties(smx_simcall_t, smx_host_t);
 int SIMIX_pre_host_get_core(smx_simcall_t, smx_host_t);
+xbt_swag_t SIMIX_pre_host_get_process_list(smx_simcall_t, smx_host_t host);
 double SIMIX_pre_host_get_speed(smx_simcall_t, smx_host_t);
 double SIMIX_pre_host_get_available_speed(smx_simcall_t, smx_host_t);
 int SIMIX_pre_host_get_state(smx_simcall_t, smx_host_t);
index 9ae909c..d92dc3e 100644 (file)
@@ -263,6 +263,7 @@ ACTION(SIMCALL_HOST_GET_BY_NAME, host_get_by_name, WITH_ANSWER, TSPEC(result, sm
 ACTION(SIMCALL_HOST_GET_NAME, host_get_name, WITH_ANSWER, TSTRING(result), TSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_PROPERTIES, host_get_properties, WITH_ANSWER, TSPEC(result, xbt_dict_t), TSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_CORE, host_get_core, WITH_ANSWER, TINT(result), TSPEC(host, smx_host_t)) sep \
+ACTION(SIMCALL_HOST_GET_PROCESS_LIST, host_get_process_list, WITH_ANSWER, TSPEC(result, xbt_swag_t), TSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_SPEED, host_get_speed, WITH_ANSWER, TDOUBLE(result), TSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_AVAILABLE_SPEED, host_get_available_speed, WITH_ANSWER, TDOUBLE(result), TSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_STATE, host_get_state, WITH_ANSWER, TINT(result), TSPEC(host, smx_host_t)) sep \
index 77d8254..81cef92 100644 (file)
@@ -94,6 +94,17 @@ int simcall_host_get_core(smx_host_t host)
   return simcall_BODY_host_get_core(host);
 }
 
+/**
+ * \ingroup simix_host_management
+ * \brief Returns the list of processes attached to the host.
+ *
+ * \param host A SIMIX host
+ * \return the swag of attached processes
+ */
+xbt_swag_t simcall_host_get_process_list(smx_host_t host)
+{
+  return simcall_BODY_host_get_process_list(host);
+}
 
 
 /**
index 4e3a9c7..602d540 100644 (file)
@@ -110,7 +110,7 @@ smpi_coll_tuned_allgather_2dmesh(void *send_buff, int send_count, MPI_Datatype
   int i, src, dst, rank, num_procs;
   int X, Y, send_offset, recv_offset;
   int my_row_base, my_col_base, src_row_base, block_size, num_reqs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index dfd2ace..5a22437 100644 (file)
@@ -97,7 +97,7 @@ int smpi_coll_tuned_allgather_3dmesh(void *send_buff, int send_count,
   int i, src, dst, rank, num_procs, block_size, my_z_base;
   int my_z, X, Y, Z, send_offset, recv_offset;
   int two_dsize, my_row_base, my_col_base, src_row_base, src_z_base, num_reqs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index d0c6ef0..0873395 100644 (file)
@@ -10,7 +10,7 @@ smpi_coll_tuned_allgather_NTSLR_NB(void *sbuf, int scount, MPI_Datatype stype,
   MPI_Status status, status2;
   int i, to, from, rank, size;
   int send_offset, recv_offset;
-  int tag = 500;
+  int tag = COLL_TAG_ALLGATHER;
 
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
index bcaabfd..28ab0b3 100644 (file)
@@ -10,7 +10,7 @@ smpi_coll_tuned_allgather_NTSLR(void *sbuf, int scount, MPI_Datatype stype,
   MPI_Status status;
   int i, to, from, rank, size;
   int send_offset, recv_offset;
-  int tag = 500;
+  int tag = COLL_TAG_ALLGATHER;
 
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
index a6b515a..b511fb9 100644 (file)
@@ -14,7 +14,7 @@ int smpi_coll_tuned_allgather_SMP_NTS(void *sbuf, int scount,
   MPI_Aint rextent, sextent;
   rextent = smpi_datatype_get_extent(rtype);
   sextent = smpi_datatype_get_extent(stype);
-  int tag = 50;
+  int tag = COLL_TAG_ALLGATHER;
   MPI_Request request;
   MPI_Request rrequest_array[128];
 
index 681690a..2b49321 100644 (file)
@@ -72,7 +72,7 @@ int smpi_coll_tuned_allgather_bruck(void *send_buff, int send_count,
 
   // local int variables
   int src, dst, rank, num_procs, count, remainder;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
   int pof2 = 1;
 
   // local string variables
index 6455db1..04c7faf 100644 (file)
@@ -10,7 +10,7 @@ int smpi_coll_tuned_allgather_loosely_lr(void *sbuf, int scount,
                                          MPI_Comm comm)
 {
   int comm_size, rank;
-  int tag = 50;
+  int tag = COLL_TAG_ALLGATHER;
   int i, j, send_offset, recv_offset;
   int intra_rank, inter_rank, inter_comm_size, intra_comm_size;
   int inter_dst, inter_src;
index 7656069..92b28bf 100644 (file)
@@ -10,7 +10,7 @@ smpi_coll_tuned_allgather_lr(void *sbuf, int scount, MPI_Datatype stype,
   MPI_Status status;
   int i, to, from, rank, size;
   int send_offset, recv_offset;
-  int tag = 500;
+  int tag = COLL_TAG_ALLGATHER;
 
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
index 238163e..d416a66 100644 (file)
@@ -57,7 +57,6 @@
  */
  
  #include "colls_private.h"
- #define MCA_COLL_BASE_TAG_ALLGATHER 555
 int 
 smpi_coll_tuned_allgather_ompi_neighborexchange(void *sbuf, int scount,
                                                  MPI_Datatype sdtype,
@@ -134,9 +133,9 @@ smpi_coll_tuned_allgather_ompi_neighborexchange(void *sbuf, int scount,
    tmpsend = (char*)rbuf + rank * rcount * rext;
    /* Sendreceive */
    smpi_mpi_sendrecv(tmpsend, rcount, rdtype, neighbor[0],
-                                  MCA_COLL_BASE_TAG_ALLGATHER,
+                                  COLL_TAG_ALLGATHER,
                                   tmprecv, rcount, rdtype, neighbor[0],
-                                  MCA_COLL_BASE_TAG_ALLGATHER,
+                                  COLL_TAG_ALLGATHER,
                                   comm, MPI_STATUS_IGNORE);
 
    /* Determine initial sending location */
@@ -157,10 +156,10 @@ smpi_coll_tuned_allgather_ompi_neighborexchange(void *sbuf, int scount,
       /* Sendreceive */
       smpi_mpi_sendrecv(tmpsend, 2 * rcount, rdtype, 
                                      neighbor[i_parity], 
-                                     MCA_COLL_BASE_TAG_ALLGATHER,
+                                     COLL_TAG_ALLGATHER,
                                      tmprecv, 2 * rcount, rdtype,
                                      neighbor[i_parity],
-                                     MCA_COLL_BASE_TAG_ALLGATHER,
+                                     COLL_TAG_ALLGATHER,
                                      comm, MPI_STATUS_IGNORE);
 
       send_data_from = recv_data_from[i_parity];
index 0dc4aec..6075723 100644 (file)
@@ -67,7 +67,7 @@ smpi_coll_tuned_allgather_pair(void *send_buff, int send_count,
 
   MPI_Aint extent;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
   MPI_Status status;
 
   char *send_ptr = (char *) send_buff;
index 520819a..26467de 100644 (file)
@@ -14,7 +14,7 @@ smpi_coll_tuned_allgather_rdb(void *sbuf, int send_count,
   int i, j, k, dst, rank, num_procs, send_offset, recv_offset, tree_root;
   int dst_tree_root, rank_tree_root, last_recv_count = 0, num_procs_completed;
   int offset, tmp_mask;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
   int mask = 1;
   int success = 0;
   int curr_count = recv_count;
index c3db821..aceb283 100644 (file)
@@ -15,7 +15,7 @@ smpi_coll_tuned_allgather_rhv(void *sbuf, int send_count,
   int i, dst, send_base_offset, recv_base_offset, send_chunk, recv_chunk,
       send_offset, recv_offset;
   int rank, num_procs;
-  int tag = 50;
+  int tag = COLL_TAG_ALLGATHER;
   int mask;
   int curr_count;
 
index 6108ae5..4634ddc 100644 (file)
@@ -66,7 +66,7 @@ smpi_coll_tuned_allgather_ring(void *send_buff, int send_count,
 
   MPI_Aint extent;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
   MPI_Status status;
 
   char *sendptr = (char *) send_buff;
index 21cab26..1438870 100644 (file)
@@ -14,7 +14,7 @@ int smpi_coll_tuned_allgather_smp_simple(void *send_buf, int scount,
   MPI_Aint rextent, sextent;
   rextent = smpi_datatype_get_extent(rtype);
   sextent = smpi_datatype_get_extent(stype);
-  int tag = 50;
+  int tag = COLL_TAG_ALLGATHER;
   MPI_Status status;
   int i, send_offset, recv_offset;
   int intra_rank, inter_rank;
index 822ab53..c7dfbc9 100644 (file)
@@ -70,7 +70,7 @@ smpi_coll_tuned_allgather_spreading_simple(void *send_buff, int send_count,
   MPI_Request *reqs, *req_ptr;
   MPI_Aint extent;
   int i, src, dst, rank, num_procs, num_reqs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
   MPI_Status status;
   char *recv_ptr = (char *) recv_buff;
 
index 3a65b30..454288d 100644 (file)
@@ -1,7 +1,6 @@
         /* Short or medium size message and power-of-two no. of processes. Use
          * recursive doubling algorithm */   
 #include "colls_private.h"
-#define MPIR_ALLGATHERV_TAG 222
 int smpi_coll_tuned_allgatherv_mpich_rdb ( 
     void *sendbuf,
     int sendcount,
@@ -94,10 +93,10 @@ int smpi_coll_tuned_allgatherv_mpich_rdb (
 
                     smpi_mpi_sendrecv(((char *)tmp_buf + send_offset * recvtype_extent),
                                                  curr_cnt, recvtype, dst,
-                                                 MPIR_ALLGATHERV_TAG,  
+                                                 COLL_TAG_ALLGATHERV,
                                                  ((char *)tmp_buf + recv_offset * recvtype_extent),
                                                  total_count - recv_offset, recvtype, dst,
-                                                 MPIR_ALLGATHERV_TAG,
+                                                 COLL_TAG_ALLGATHERV,
                                                  comm, &status);
                         /* for convenience, recv is posted for a bigger amount
                            than will be sent */
@@ -159,7 +158,7 @@ int smpi_coll_tuned_allgatherv_mpich_rdb (
                             smpi_mpi_send(((char *)tmp_buf + offset),
                                                      last_recv_cnt,
                                                      recvtype, dst,
-                                                     MPIR_ALLGATHERV_TAG, comm);
+                                                     COLL_TAG_ALLGATHERV, comm);
                             /* last_recv_cnt was set in the previous
                                receive. that's the amount of data to be
                                sent now. */
@@ -176,7 +175,7 @@ int smpi_coll_tuned_allgatherv_mpich_rdb (
 
                             smpi_mpi_recv(((char *)tmp_buf + offset * recvtype_extent),
                                                      total_count - offset, recvtype,
-                                                     dst, MPIR_ALLGATHERV_TAG,
+                                                     dst, COLL_TAG_ALLGATHERV,
                                                      comm, &status);
                                 /* for convenience, recv is posted for a
                                    bigger amount than will be sent */
index 420f430..bffcbac 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 #include "colls_private.h"
-#define  MCA_COLL_BASE_TAG_ALLGATHERV 444
 /*
  * ompi_coll_tuned_allgatherv_intra_bruck
  *
@@ -159,9 +158,9 @@ int smpi_coll_tuned_allgatherv_ompi_bruck(void *sbuf, int scount,
 
       /* Sendreceive */
       smpi_mpi_sendrecv(rbuf, 1, new_sdtype, sendto,
-                                     MCA_COLL_BASE_TAG_ALLGATHERV,
+                                     COLL_TAG_ALLGATHERV,
                                      rbuf, 1, new_rdtype, recvfrom,
-                                     MCA_COLL_BASE_TAG_ALLGATHERV,
+                                     COLL_TAG_ALLGATHERV,
                                      comm, MPI_STATUS_IGNORE);
       smpi_datatype_free(&new_sdtype);
       smpi_datatype_free(&new_rdtype);
index f80e681..3692a38 100644 (file)
@@ -59,7 +59,6 @@
  */
  
  #include "colls_private.h"
- #define  MCA_COLL_BASE_TAG_ALLGATHERV 444
  
 int 
 smpi_coll_tuned_allgatherv_ompi_neighborexchange(void *sbuf, int scount,
@@ -142,9 +141,9 @@ smpi_coll_tuned_allgatherv_ompi_neighborexchange(void *sbuf, int scount,
     tmprecv = (char*)rbuf + rdispls[neighbor[0]] * rext;
     tmpsend = (char*)rbuf + rdispls[rank] * rext;
     smpi_mpi_sendrecv(tmpsend, rcounts[rank], rdtype, 
-                                   neighbor[0], MCA_COLL_BASE_TAG_ALLGATHERV,
+                                   neighbor[0], COLL_TAG_ALLGATHERV,
                                    tmprecv, rcounts[neighbor[0]], rdtype, 
-                                   neighbor[0], MCA_COLL_BASE_TAG_ALLGATHERV,
+                                   neighbor[0], COLL_TAG_ALLGATHERV,
                                    comm, MPI_STATUS_IGNORE);
 
 
@@ -194,9 +193,9 @@ smpi_coll_tuned_allgatherv_ompi_neighborexchange(void *sbuf, int scount,
       
         /* Sendreceive */
         smpi_mpi_sendrecv(tmpsend, 1, new_sdtype, neighbor[i_parity],
-                                       MCA_COLL_BASE_TAG_ALLGATHERV,
+                                       COLL_TAG_ALLGATHERV,
                                        tmprecv, 1, new_rdtype, neighbor[i_parity],
-                                       MCA_COLL_BASE_TAG_ALLGATHERV,
+                                       COLL_TAG_ALLGATHERV,
                                        comm, MPI_STATUS_IGNORE);
 
         send_data_from = recv_data_from[i_parity];
index d60e77a..c73366e 100644 (file)
@@ -67,7 +67,7 @@ smpi_coll_tuned_allgatherv_pair(void *send_buff, int send_count,
 
   MPI_Aint extent;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHERV;
   MPI_Status status;
 
   char *send_ptr = (char *) send_buff;
index 4c1e14f..fc7598c 100644 (file)
@@ -66,7 +66,7 @@ smpi_coll_tuned_allgatherv_ring(void *send_buff, int send_count,
 
   MPI_Aint extent;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHERV;
   MPI_Status status;
 
   char *sendptr = (char *) send_buff;
index a8cf48d..51e3aed 100644 (file)
@@ -14,7 +14,7 @@ int
 smpi_coll_tuned_allreduce_NTS(void *sbuf, void *rbuf, int rcount,
                               MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 {
-  int tag = 5000;
+  int tag = COLL_TAG_ALLREDUCE;
   MPI_Status status;
   int rank, i, size, count;
   int send_offset, recv_offset;
index 81cb392..9bb4149 100644 (file)
@@ -17,7 +17,7 @@ int
 smpi_coll_tuned_allreduce_lr(void *sbuf, void *rbuf, int rcount,
                              MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 {
-  int tag = 5000;
+  int tag = COLL_TAG_ALLREDUCE;
   MPI_Status status;
   int rank, i, size, count;
   int send_offset, recv_offset;
index 9d5ee9c..6024607 100644 (file)
@@ -4,7 +4,7 @@ int smpi_coll_tuned_allreduce_rab_rdb(void *sbuff, void *rbuff, int count,
                                       MPI_Datatype dtype, MPI_Op op,
                                       MPI_Comm comm)
 {
-  int nprocs, rank, tag = 543;
+  int nprocs, rank, tag = COLL_TAG_ALLREDUCE;
   int mask, dst, pof2, newrank, rem, newdst, i,
       send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
   MPI_Aint extent;
index 5650ef2..13abd17 100644 (file)
@@ -334,7 +334,7 @@ int smpi_coll_tuned_allreduce_rab_reduce_scatter(void *sbuff, void *rbuff,
                                                  int count, MPI_Datatype dtype,
                                                  MPI_Op op, MPI_Comm comm)
 {
-  int nprocs, rank, type_size, tag = 543;
+  int nprocs, rank, type_size, tag = COLL_TAG_ALLREDUCE;
   int mask, dst, pof2, newrank, rem, newdst, i,
       send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
   MPI_Aint lb, extent;
index 34e23d6..c387a22 100644 (file)
@@ -5,7 +5,7 @@ int smpi_coll_tuned_allreduce_rab_rsag(void *sbuff, void *rbuff, int count,
                                        MPI_Datatype dtype, MPI_Op op,
                                        MPI_Comm comm)
 {
-  int nprocs, rank, tag = 543;
+  int nprocs, rank, tag = COLL_TAG_ALLREDUCE;
   int mask, dst, pof2, newrank, rem, newdst, i,
       send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
   MPI_Aint extent;
index ae72f74..66862da 100644 (file)
@@ -8,7 +8,7 @@ int smpi_coll_tuned_allreduce_rab1(void *sbuff, void *rbuff,
 {
   MPI_Status status;
   MPI_Aint extent;
-  int tag = 4321, rank, nprocs, send_size, newcnt, share;
+  int tag = COLL_TAG_ALLREDUCE, rank, nprocs, send_size, newcnt, share;
   int pof2 = 1, mask, send_idx, recv_idx, dst, send_cnt, recv_cnt;
 
   void *recv, *tmp_buf;
index 44717ad..23e7e30 100644 (file)
@@ -4,7 +4,7 @@
 int smpi_coll_tuned_allreduce_rdb(void *sbuff, void *rbuff, int count,
                                   MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 {
-  int nprocs, rank, tag = 543;
+  int nprocs, rank, tag = COLL_TAG_ALLREDUCE;
   int mask, dst, pof2, newrank, rem, newdst;
   MPI_Aint extent, lb;
   MPI_Status status;
index 93d72bb..68c99f5 100644 (file)
@@ -43,7 +43,7 @@ int smpi_coll_tuned_allreduce_smp_binomial_pipeline(void *send_buf,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
   int num_core = NUM_CORE;
index ed9b68c..77a5abc 100644 (file)
@@ -32,7 +32,7 @@ int smpi_coll_tuned_allreduce_smp_binomial(void *send_buf, void *recv_buf,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   int num_core = NUM_CORE;
   MPI_Status status;
index d208584..b6def2e 100644 (file)
@@ -31,7 +31,7 @@ int smpi_coll_tuned_allreduce_smp_rdb(void *send_buf, void *recv_buf, int count,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
   int num_core = NUM_CORE;
index fd49327..ce90781 100644 (file)
@@ -20,7 +20,7 @@ int smpi_coll_tuned_allreduce_smp_rsag_lr(void *send_buf, void *recv_buf,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
   int num_core = NUM_CORE;
index c98b78d..cec7521 100644 (file)
@@ -23,7 +23,7 @@ int smpi_coll_tuned_allreduce_smp_rsag_rab(void *sbuf, void *rbuf, int count,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
   int num_core = NUM_CORE;
index 24ccaa0..573f5c6 100644 (file)
@@ -19,7 +19,7 @@ int smpi_coll_tuned_allreduce_smp_rsag(void *send_buf, void *recv_buf,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
   int num_core = NUM_CORE;
index 61ea21e..08f4db2 100644 (file)
@@ -60,7 +60,7 @@ int smpi_coll_tuned_alltoall_2dmesh(void *send_buff, int send_count,
   int i, j, src, dst, rank, num_procs, count, num_reqs;
   int X, Y, send_offset, recv_offset;
   int my_row_base, my_col_base, src_row_base, block_size;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index ca10de7..c226927 100644 (file)
@@ -50,7 +50,7 @@ int smpi_coll_tuned_alltoall_3dmesh(void *send_buff, int send_count,
   MPI_Status status, *statuses;
   int i, j, src, dst, rank, num_procs, num_reqs, X, Y, Z, block_size, count;
   int my_z, two_dsize, my_row_base, my_col_base, my_z_base, src_row_base;
-  int src_z_base, send_offset, recv_offset, tag = 1;
+  int src_z_base, send_offset, recv_offset, tag = COLL_TAG_ALLTOALL;
 
   char *tmp_buff1, *tmp_buff2;
 
index d38b3e5..9e3117c 100644 (file)
@@ -30,7 +30,7 @@ smpi_coll_tuned_alltoall_bruck(void *send_buff, int send_count,
 
   int *blocks_length, *disps;
   int i, src, dst, rank, num_procs, count, remainder, block, position;
-  int pack_size, tag = 1, pof2 = 1;
+  int pack_size, tag = COLL_TAG_ALLTOALL, pof2 = 1;
 
 
   char *tmp_buff;
index e23944f..8daee00 100644 (file)
@@ -17,7 +17,6 @@
  */
 
 #include "colls_private.h"
-#define MCA_COLL_BASE_TAG_ALLTOALL 101
 
 int smpi_coll_tuned_alltoall_ompi_pairwise(void *sbuf, int scount, 
                                             MPI_Datatype sdtype,
@@ -53,9 +52,9 @@ int smpi_coll_tuned_alltoall_ompi_pairwise(void *sbuf, int scount,
 
         /* send and receive */
         smpi_mpi_sendrecv( tmpsend, scount, sdtype, sendto, 
-                                        MCA_COLL_BASE_TAG_ALLTOALL,
+                                        COLL_TAG_ALLTOALL,
                                         tmprecv, rcount, rdtype, recvfrom, 
-                                        MCA_COLL_BASE_TAG_ALLTOALL,
+                                        COLL_TAG_ALLTOALL,
                                         comm, MPI_STATUS_IGNORE);
     }
 
index 96cf68d..65ae5f8 100644 (file)
@@ -31,7 +31,7 @@ smpi_coll_tuned_alltoall_pair_light_barrier(void *send_buff, int send_count,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs, next_partner;
-  int tag = 1;     /*, failure = 0; */
+  int tag = COLL_TAG_ALLTOALL;     /*, failure = 0; */
 
   char send_sync = 'a', recv_sync = 'b';
   char *send_ptr = (char *) send_buff;
index f12c3f9..ef36248 100644 (file)
@@ -30,7 +30,7 @@ smpi_coll_tuned_alltoall_pair_mpi_barrier(void *send_buff, int send_count,
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 101;
+  int tag = COLL_TAG_ALLTOALL;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
index 19e693d..0d14d28 100644 (file)
@@ -30,7 +30,7 @@ smpi_coll_tuned_alltoall_pair_one_barrier(void *send_buff, int send_count,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index 24ef5f7..66c4767 100644 (file)
@@ -68,7 +68,7 @@ int smpi_coll_tuned_alltoall_pair(void *send_buff, int send_count,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
index 45b529f..9c0b9cc 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 = 0, tmp_mask, tree_root, num_procs_completed;
-  int tag = 1, mask = 1, i = 0;
+  int tag = COLL_TAG_ALLTOALL, mask = 1, i = 0;
 
   char *tmp_buff;
   char *send_ptr = (char *) send_buff;
index d45912b..df280bb 100644 (file)
@@ -31,7 +31,7 @@ smpi_coll_tuned_alltoall_ring_light_barrier(void *send_buff, int send_count,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs, next_dst, next_src;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
 
   char send_sync = 'a', recv_sync = 'b';
   char *send_ptr = (char *) send_buff;
index e3a3f2d..7b84edb 100644 (file)
@@ -29,7 +29,7 @@ smpi_coll_tuned_alltoall_ring_mpi_barrier(void *send_buff, int send_count,
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index 97b912b..30583fb 100644 (file)
@@ -28,7 +28,7 @@ smpi_coll_tuned_alltoall_ring_one_barrier(void *send_buff, int send_count,
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index 622fd9d..16ba29c 100644 (file)
@@ -28,7 +28,7 @@ smpi_coll_tuned_alltoall_ring(void *send_buff, int send_count,
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 11;
+  int tag = COLL_TAG_ALLTOALL;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index fa50a8c..f6edcdc 100644 (file)
@@ -27,7 +27,7 @@ int smpi_coll_tuned_alltoall_simple(void *send_buff, int send_count,
                                     void *recv_buff, int recv_count,
                                     MPI_Datatype recv_type, MPI_Comm comm)
 {
-  int i, rank, size, nreqs, src, dst, tag = 101;
+  int i, rank, size, nreqs, src, dst, tag = COLL_TAG_ALLTOALL;
   char *psnd;
   char *prcv;
   MPI_Aint sndinc;
index 0296798..3a4183b 100644 (file)
@@ -12,7 +12,7 @@ int smpi_coll_tuned_alltoallv_bruck(void *sendbuf, int *sendcounts, int *senddis
                                    int *recvcounts, int *recvdisps, MPI_Datatype recvtype,
                                    MPI_Comm comm)
 {
-  int system_tag = 777;
+  int system_tag = COLL_TAG_ALLTOALLV;
   int i, rank, size, err, count;
   MPI_Aint lb;
   MPI_Aint sendext = 0;
index f90471d..abc29f5 100644 (file)
@@ -1,6 +1,5 @@
 
 #include "colls_private.h"
-#define MCA_COLL_BASE_TAG_ALLTOALLV 111
 /*  
  * Linear functions are copied from the basic coll module.  For
  * some small number of nodes and/or small data sizes they are just as
@@ -57,7 +56,7 @@ smpi_coll_tuned_alltoallv_ompi_basic_linear(void *sbuf, int *scounts, int *sdisp
         prcv = ((char *) rbuf) + (rdisps[i] * rext);
 
         *preq = smpi_irecv_init(prcv, rcounts[i], rdtype,
-                                      i, MCA_COLL_BASE_TAG_ALLTOALLV, comm
+                                      i, COLL_TAG_ALLTOALLV, comm
                                       );
         preq++;
         ++nreqs;
@@ -72,7 +71,7 @@ smpi_coll_tuned_alltoallv_ompi_basic_linear(void *sbuf, int *scounts, int *sdisp
 
         psnd = ((char *) sbuf) + (sdisps[i] * sext);
         *preq=smpi_isend_init(psnd, scounts[i], sdtype,
-                                      i, MCA_COLL_BASE_TAG_ALLTOALLV, comm
+                                      i, COLL_TAG_ALLTOALLV, comm
                                       );
         preq++;
         ++nreqs;
index 45a864b..60e2647 100644 (file)
@@ -31,7 +31,7 @@ smpi_coll_tuned_alltoallv_pair_light_barrier(void *send_buff, int *send_counts,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs, next_partner;
-  int tag = 1;     /*, failure = 0; */
+  int tag = COLL_TAG_ALLTOALLV;     /*, failure = 0; */
 
   char send_sync = 'a', recv_sync = 'b';
   char *send_ptr = (char *) send_buff;
index 9944493..62b0d71 100644 (file)
@@ -30,7 +30,7 @@ smpi_coll_tuned_alltoallv_pair_mpi_barrier(void *send_buff, int *send_counts, in
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 101;
+  int tag = COLL_TAG_ALLTOALLV;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
index ab1f48e..7bea7e7 100644 (file)
@@ -29,7 +29,7 @@ smpi_coll_tuned_alltoallv_pair_one_barrier(void *send_buff, int *send_counts, in
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALLV;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index 50839df..6692eeb 100644 (file)
@@ -30,7 +30,7 @@ int smpi_coll_tuned_alltoallv_pair(void *send_buff, int *send_counts, int *send_
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALLV;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
index 7a42ab9..d9653e3 100644 (file)
@@ -31,7 +31,7 @@ smpi_coll_tuned_alltoallv_ring_light_barrier(void *send_buff, int *send_counts,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs, next_dst, next_src;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALLV;
 
   char send_sync = 'a', recv_sync = 'b';
   char *send_ptr = (char *) send_buff;
index 273f15c..36af835 100644 (file)
@@ -29,7 +29,7 @@ smpi_coll_tuned_alltoallv_ring_mpi_barrier(void *send_buff, int *send_counts, in
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALLV;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index 8e2d0cd..7f5e795 100644 (file)
@@ -28,7 +28,7 @@ smpi_coll_tuned_alltoallv_ring_one_barrier(void *send_buff, int *send_counts, in
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALLV;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index dcd4b35..dcbb9f4 100644 (file)
@@ -29,7 +29,7 @@ smpi_coll_tuned_alltoallv_ring(void *send_buff, int *send_counts, int *send_disp
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 11;
+  int tag = COLL_TAG_ALLTOALLV;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index 39bdeb1..8a210fe 100644 (file)
@@ -21,7 +21,6 @@
 #include "coll_tuned_topo.h"
 
 
-#define MCA_COLL_BASE_TAG_BARRIER 100
 /*
  * Barrier is ment to be a synchronous operation, as some BTLs can mark 
  * a request done before its passed to the NIC and progress might not be made 
@@ -58,38 +57,38 @@ int smpi_coll_tuned_barrier_ompi_doublering(MPI_Comm comm
 
     if (rank > 0) { /* receive message from the left */
         smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left, 
-                                MCA_COLL_BASE_TAG_BARRIER, comm, 
+                                COLL_TAG_BARRIER, comm,
                                 MPI_STATUS_IGNORE);
     }
 
     /* Send message to the right */
     smpi_mpi_send((void*)NULL, 0, MPI_BYTE, right, 
-                            MCA_COLL_BASE_TAG_BARRIER, 
+                            COLL_TAG_BARRIER,
                              comm);
 
     /* root needs to receive from the last node */
     if (rank == 0) {
         smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left, 
-                                MCA_COLL_BASE_TAG_BARRIER, comm, 
+                                COLL_TAG_BARRIER, comm,
                                 MPI_STATUS_IGNORE);
     }
 
     /* Allow nodes to exit */
     if (rank > 0) { /* post Receive from left */
         smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left, 
-                                MCA_COLL_BASE_TAG_BARRIER, comm, 
+                                COLL_TAG_BARRIER, comm,
                                 MPI_STATUS_IGNORE);
     }
 
     /* send message to the right one */
     smpi_mpi_send((void*)NULL, 0, MPI_BYTE, right, 
-                            MCA_COLL_BASE_TAG_BARRIER, 
+                            COLL_TAG_BARRIER,
                              comm);
  
     /* rank 0 post receive from the last node */
     if (rank == 0) {
         smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left, 
-                                MCA_COLL_BASE_TAG_BARRIER, comm, 
+                                COLL_TAG_BARRIER, comm,
                                 MPI_STATUS_IGNORE);
     }
 
@@ -124,16 +123,16 @@ int smpi_coll_tuned_barrier_ompi_recursivedoubling(MPI_Comm comm
             /* send message to lower ranked node */
             remote = rank - adjsize;
             smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, remote,
-                                                  MCA_COLL_BASE_TAG_BARRIER,
+                                                  COLL_TAG_BARRIER,
                                                   NULL, 0, MPI_BYTE, remote,
-                                                  MCA_COLL_BASE_TAG_BARRIER,
+                                                  COLL_TAG_BARRIER,
                                                   comm, MPI_STATUS_IGNORE);
 
         } else if (rank < (size - adjsize)) {
 
             /* receive message from high level rank */
             smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, rank+adjsize,
-                                    MCA_COLL_BASE_TAG_BARRIER, comm, 
+                                    COLL_TAG_BARRIER, comm,
                                     MPI_STATUS_IGNORE);
 
         }
@@ -149,9 +148,9 @@ int smpi_coll_tuned_barrier_ompi_recursivedoubling(MPI_Comm comm
 
             /* post receive from the remote node */
             smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, remote,
-                                                  MCA_COLL_BASE_TAG_BARRIER,
+                                                  COLL_TAG_BARRIER,
                                                   NULL, 0, MPI_BYTE, remote,
-                                                  MCA_COLL_BASE_TAG_BARRIER,
+                                                  COLL_TAG_BARRIER,
                                                   comm, MPI_STATUS_IGNORE);
         }
     }
@@ -162,7 +161,7 @@ int smpi_coll_tuned_barrier_ompi_recursivedoubling(MPI_Comm comm
             /* send enter message to higher ranked node */
             remote = rank + adjsize;
             smpi_mpi_send((void*)NULL, 0, MPI_BYTE, remote, 
-                                    MCA_COLL_BASE_TAG_BARRIER, 
+                                    COLL_TAG_BARRIER,
                                      comm);
 
         }
@@ -195,9 +194,9 @@ int smpi_coll_tuned_barrier_ompi_bruck(MPI_Comm comm
 
         /* send message to lower ranked node */
         smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, to, 
-                                              MCA_COLL_BASE_TAG_BARRIER,
+                                              COLL_TAG_BARRIER,
                                               NULL, 0, MPI_BYTE, from, 
-                                              MCA_COLL_BASE_TAG_BARRIER,
+                                              COLL_TAG_BARRIER,
                                               comm, MPI_STATUS_IGNORE);
     }
 
@@ -221,9 +220,9 @@ int smpi_coll_tuned_barrier_ompi_two_procs(MPI_Comm comm
     remote = (remote + 1) & 0x1;
 
     smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, remote, 
-                                          MCA_COLL_BASE_TAG_BARRIER, 
+                                          COLL_TAG_BARRIER,
                                           NULL, 0, MPI_BYTE, remote, 
-                                          MCA_COLL_BASE_TAG_BARRIER,
+                                          COLL_TAG_BARRIER,
                                           comm, MPI_STATUS_IGNORE);
     return (MPI_SUCCESS);
 }
@@ -253,11 +252,11 @@ int smpi_coll_tuned_barrier_ompi_basic_linear(MPI_Comm comm)
 
     if (rank > 0) {
         smpi_mpi_send (NULL, 0, MPI_BYTE, 0, 
-                                 MCA_COLL_BASE_TAG_BARRIER,
+                                 COLL_TAG_BARRIER,
                                   comm);
 
         smpi_mpi_recv (NULL, 0, MPI_BYTE, 0, 
-                                 MCA_COLL_BASE_TAG_BARRIER,
+                                 COLL_TAG_BARRIER,
                                  comm, MPI_STATUS_IGNORE);
     }
 
@@ -269,14 +268,14 @@ int smpi_coll_tuned_barrier_ompi_basic_linear(MPI_Comm comm)
         requests = (MPI_Request*)malloc( size * sizeof(MPI_Request) );
         for (i = 1; i < size; ++i) {
             requests[i] = smpi_mpi_irecv(NULL, 0, MPI_BYTE, MPI_ANY_SOURCE,
-                                     MCA_COLL_BASE_TAG_BARRIER, comm
+                                     COLL_TAG_BARRIER, comm
                                      );
         }
         smpi_mpi_waitall( size-1, requests+1, MPI_STATUSES_IGNORE );
 
         for (i = 1; i < size; ++i) {
             requests[i] = smpi_mpi_isend(NULL, 0, MPI_BYTE, i,
-                                     MCA_COLL_BASE_TAG_BARRIER, 
+                                     COLL_TAG_BARRIER,
                                       comm
                                      );
         }
@@ -314,11 +313,11 @@ int smpi_coll_tuned_barrier_ompi_tree(MPI_Comm comm)
         if (!(partner & (jump-1)) && partner < size) {
             if (partner > rank) {
                 smpi_mpi_recv (NULL, 0, MPI_BYTE, partner, 
-                                         MCA_COLL_BASE_TAG_BARRIER, comm,
+                                         COLL_TAG_BARRIER, comm,
                                          MPI_STATUS_IGNORE);
             } else if (partner < rank) {
                 smpi_mpi_send (NULL, 0, MPI_BYTE, partner,
-                                         MCA_COLL_BASE_TAG_BARRIER, 
+                                         COLL_TAG_BARRIER,
                                           comm);
             }
         }
@@ -330,11 +329,11 @@ int smpi_coll_tuned_barrier_ompi_tree(MPI_Comm comm)
         if (!(partner & (jump-1)) && partner < size) {
             if (partner > rank) {
                 smpi_mpi_send (NULL, 0, MPI_BYTE, partner,
-                                         MCA_COLL_BASE_TAG_BARRIER,
+                                         COLL_TAG_BARRIER,
                                           comm);
             } else if (partner < rank) {
                 smpi_mpi_recv (NULL, 0, MPI_BYTE, partner, 
-                                         MCA_COLL_BASE_TAG_BARRIER, comm,
+                                         COLL_TAG_BARRIER, comm,
                                          MPI_STATUS_IGNORE);
             }
         }
index 93ace1d..4ebfc15 100644 (file)
@@ -5,7 +5,7 @@ int bcast_NTSB_segment_size_in_byte = 8192;
 int smpi_coll_tuned_bcast_NTSB(void *buf, int count, MPI_Datatype datatype,
                                int root, MPI_Comm comm)
 {
-  int tag = 5000;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   int rank, size;
   int i;
index 89f8f5c..ecdcdc7 100644 (file)
@@ -8,7 +8,7 @@ static int bcast_NTSL_segment_size_in_byte = 8192;
 int smpi_coll_tuned_bcast_NTSL_Isend(void *buf, int count, MPI_Datatype datatype,
                                int root, MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *send_request_array;
index 090edc7..53a7d76 100644 (file)
@@ -8,7 +8,7 @@ static int bcast_NTSL_segment_size_in_byte = 8192;
 int smpi_coll_tuned_bcast_NTSL(void *buf, int count, MPI_Datatype datatype,
                                int root, MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *send_request_array;
index ec717e2..1645e71 100644 (file)
@@ -9,7 +9,7 @@ int smpi_coll_tuned_bcast_SMP_binary(void *buf, int count,
                                      MPI_Datatype datatype, int root,
                                      MPI_Comm comm)
 {
-  int tag = 5000;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *request_array;
index 9919302..c2b24a4 100644 (file)
@@ -11,7 +11,7 @@ int smpi_coll_tuned_bcast_SMP_binomial(void *buf, int count,
   int size;
   int rank;
   MPI_Status status;
-  int tag = 50;
+  int tag = COLL_TAG_BCAST;
 
   size = smpi_comm_size(comm);
   rank = smpi_comm_rank(comm);
index 673f6cf..b999b39 100644 (file)
@@ -9,7 +9,7 @@ int smpi_coll_tuned_bcast_SMP_linear(void *buf, int count,
                                      MPI_Datatype datatype, int root,
                                      MPI_Comm comm)
 {
-  int tag = 5000;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *request_array;
index be088ed..15280f4 100644 (file)
@@ -10,7 +10,7 @@ int smpi_coll_tuned_bcast_arrival_nb(void *buf, int count,
                                      MPI_Datatype datatype, int root,
                                      MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *send_request_array;
index 0a12246..285c163 100644 (file)
@@ -27,7 +27,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware_wait(void *buf, int count,
 
   int rank, size;
   int i, j, k;
-  int tag = 50;
+  int tag = COLL_TAG_BCAST;
   int will_send[BCAST_ARRIVAL_PATTERN_AWARE_MAX_NODE];
 
   int sent_count;
index a9df449..1e8f95a 100644 (file)
@@ -10,7 +10,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
                                                 MPI_Datatype datatype, int root,
                                                 MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *send_request_array;
index 6ad805d..761c15f 100644 (file)
@@ -13,7 +13,7 @@ int smpi_coll_tuned_bcast_arrival_scatter(void *buf, int count,
                                           MPI_Datatype datatype, int root,
                                           MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = COLL_TAG_BCAST;
   int header_tag = 10;
   MPI_Status status;
 
index e840c02..0b37d39 100644 (file)
@@ -68,7 +68,7 @@ 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;
+  int tag = COLL_TAG_BCAST;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index 9033bf5..434b684 100644 (file)
@@ -8,7 +8,7 @@ smpi_coll_tuned_bcast_flattree_pipeline(void *buff, int count,
                                         MPI_Comm comm)
 {
   int i, j, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_BCAST;
 
   MPI_Aint extent;
   extent = smpi_datatype_get_extent(data_type);
index 626c203..4cf3308 100644 (file)
@@ -8,7 +8,7 @@ smpi_coll_tuned_bcast_flattree(void *buff, int count, MPI_Datatype data_type,
   MPI_Request *reqs;
 
   int i, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_BCAST;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index 63c2067..cd0e3ce 100644 (file)
@@ -96,7 +96,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
             for( i = 0; i < tree->tree_nextsize; i++ ) { 
                 send_reqs[i] = smpi_mpi_isend(tmpbuf, sendcount, datatype,
                                          tree->tree_next[i], 
-                                         777, comm);
+                                         COLL_TAG_BCAST, comm);
            } 
 
             /* complete the sends before starting the next sends */
@@ -124,7 +124,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
          */
         req_index = 0;
         recv_reqs[req_index]=smpi_mpi_irecv(tmpbuf, count_by_segment, datatype,
-                           tree->tree_prev, 777,
+                           tree->tree_prev, COLL_TAG_BCAST,
                            comm);
         
         for( segindex = 1; segindex < num_segments; segindex++ ) {
@@ -134,7 +134,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
             /* post new irecv */
             recv_reqs[req_index]= smpi_mpi_irecv( tmpbuf + realsegsize, count_by_segment,
                                 datatype, tree->tree_prev, 
-                                777, 
+                                COLL_TAG_BCAST,
                                 comm);
             
             /* wait for and forward the previous segment to children */
@@ -144,7 +144,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
             for( i = 0; i < tree->tree_nextsize; i++ ) { 
                 send_reqs[i]=smpi_mpi_isend(tmpbuf, count_by_segment, datatype,
                                          tree->tree_next[i], 
-                                         777, comm );
+                                         COLL_TAG_BCAST, comm );
             } 
             
             /* complete the sends before starting the next iteration */
@@ -161,7 +161,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
         for( i = 0; i < tree->tree_nextsize; i++ ) {
             send_reqs[i] = smpi_mpi_isend(tmpbuf, sendcount, datatype,
                                      tree->tree_next[i], 
-                                     777, comm);
+                                     COLL_TAG_BCAST, comm);
         }
         
         smpi_mpi_waitall( tree->tree_nextsize, send_reqs, 
@@ -180,7 +180,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
         */
         req_index = 0;
         recv_reqs[req_index] = smpi_mpi_irecv(tmpbuf, count_by_segment, datatype,
-                                 tree->tree_prev, 777,
+                                 tree->tree_prev, COLL_TAG_BCAST,
                                  comm);
 
         for( segindex = 1; segindex < num_segments; segindex++ ) {
@@ -188,7 +188,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
             tmpbuf += realsegsize;
             /* post receive for the next segment */
             recv_reqs[req_index] = smpi_mpi_irecv(tmpbuf, count_by_segment, datatype, 
-                                     tree->tree_prev, 777, 
+                                     tree->tree_prev, COLL_TAG_BCAST,
                                      comm);
             /* wait on the previous segment */
             smpi_mpi_wait( &recv_reqs[req_index ^ 0x1], 
index f1201d1..58bf387 100644 (file)
@@ -171,7 +171,7 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
                     sendcount[i] = counts[i] - segindex*segcount[i];
                 /* send data */
                 smpi_mpi_send(tmpbuf[i], sendcount[i], datatype,
-                                  tree->tree_next[i], 777, comm);
+                                  tree->tree_next[i], COLL_TAG_BCAST, comm);
                 /* update tmp buffer */
                 tmpbuf[i] += realsegsize[i];
             }
@@ -193,7 +193,7 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
          */
         sendcount[lr] = segcount[lr];
         base_req=smpi_mpi_irecv(tmpbuf[lr], sendcount[lr], datatype,
-                           tree->tree_prev, 777,
+                           tree->tree_prev, COLL_TAG_BCAST,
                            comm);
 
         for( segindex = 1; segindex < num_segments[lr]; segindex++ ) {
@@ -202,14 +202,14 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
                 sendcount[lr] = counts[lr] - segindex*segcount[lr];
             /* post new irecv */
             new_req = smpi_mpi_irecv( tmpbuf[lr] + realsegsize[lr], sendcount[lr],
-                                datatype, tree->tree_prev, 777, 
+                                datatype, tree->tree_prev, COLL_TAG_BCAST,
                                 comm);
 
             /* wait for and forward current segment */
             smpi_mpi_waitall( 1, &base_req, MPI_STATUSES_IGNORE );
             for( i = 0; i < tree->tree_nextsize; i++ ) {  /* send data to children (segcount[lr]) */
                 smpi_mpi_send( tmpbuf[lr], segcount[lr], datatype,
-                                   tree->tree_next[i], 777,
+                                   tree->tree_next[i], COLL_TAG_BCAST,
                                    comm);
             } /* end of for each child */
 
@@ -223,7 +223,7 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
         smpi_mpi_waitall( 1, &base_req, MPI_STATUSES_IGNORE );
         for( i = 0; i < tree->tree_nextsize; i++ ) {  /* send data to children */
             smpi_mpi_send(tmpbuf[lr], sendcount[lr], datatype,
-                              tree->tree_next[i], 777, comm);
+                              tree->tree_next[i], COLL_TAG_BCAST, comm);
         } /* end of for each child */
     } 
   
@@ -236,7 +236,7 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
             if (segindex == (num_segments[lr] - 1)) sendcount[lr] = counts[lr] - segindex*segcount[lr];
             /* receive segments */
             smpi_mpi_recv(tmpbuf[lr], sendcount[lr], datatype,
-                              tree->tree_prev, 777,
+                              tree->tree_prev, COLL_TAG_BCAST,
                               comm, MPI_STATUS_IGNORE);
             /* update the initial pointer to the buffer */
             tmpbuf[lr] += realsegsize[lr];
@@ -265,29 +265,29 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
     if ( (size%2) != 0 && rank != root) { 
 
         smpi_mpi_sendrecv( tmpbuf[lr], counts[lr], datatype,
-                                        pair, 777,
+                                        pair, COLL_TAG_BCAST,
                                         tmpbuf[(lr+1)%2], counts[(lr+1)%2], datatype,
-                                        pair, 777,
+                                        pair, COLL_TAG_BCAST,
                                         comm, MPI_STATUS_IGNORE);
     } else if ( (size%2) == 0 ) {
         /* root sends right buffer to the last node */
         if( rank == root ) {
             smpi_mpi_send(tmpbuf[1], counts[1], datatype,
-                              (root+size-1)%size, 777, comm);
+                              (root+size-1)%size, COLL_TAG_BCAST, comm);
 
         } 
         /* last node receives right buffer from the root */
         else if (rank == (root+size-1)%size) {
             smpi_mpi_recv(tmpbuf[1], counts[1], datatype,
-                              root, 777,
+                              root, COLL_TAG_BCAST,
                               comm, MPI_STATUS_IGNORE);
         } 
         /* everyone else exchanges buffers */
         else {
             smpi_mpi_sendrecv( tmpbuf[lr], counts[lr], datatype,
-                                            pair, 777,
+                                            pair, COLL_TAG_BCAST,
                                             tmpbuf[(lr+1)%2], counts[(lr+1)%2], datatype,
-                                            pair, 777,
+                                            pair, COLL_TAG_BCAST,
                                             comm, MPI_STATUS_IGNORE); 
         }
     }
index ebd5539..bf7a05a 100644 (file)
@@ -71,7 +71,7 @@ smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count,
   int i, src, dst, rank, num_procs;
   int mask, relative_rank, curr_size, recv_size, send_size, nbytes;
   int scatter_size, left, right, next_src, *recv_counts, *disps;
-  int tag = 1;
+  int tag = COLL_TAG_BCAST;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index ab458e4..43cf25d 100644 (file)
@@ -73,7 +73,7 @@ smpi_coll_tuned_bcast_scatter_rdb_allgather(void *buff, int count, MPI_Datatype
   int mask, relative_rank, curr_size, recv_size = 0, send_size, nbytes;
   int scatter_size, tree_root, relative_dst, dst_tree_root;
   int my_tree_root, offset, tmp_mask, num_procs_completed;
-  int tag = 1;
+  int tag = COLL_TAG_BCAST;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index 22e6e63..18f1d08 100644 (file)
@@ -19,7 +19,6 @@
 #include "colls_private.h"
 #include "coll_tuned_topo.h"
 
-#define MCA_COLL_BASE_TAG_GATHER 333
 /* Todo: gather_intra_generic, gather_intra_binary, gather_intra_chain,
  * gather_intra_pipeline, segmentation? */
 int
@@ -137,7 +136,7 @@ smpi_coll_tuned_gather_ompi_binomial(void *sbuf, int scount,
                         rank, bmtree->tree_next[i], mycount);
 
            smpi_mpi_recv(ptmp + total_recv*rextent, rcount*size-total_recv, rdtype,
-                                   bmtree->tree_next[i], MCA_COLL_BASE_TAG_GATHER,
+                                   bmtree->tree_next[i], COLL_TAG_GATHER,
                                    comm, &status);
 
            total_recv += mycount;
@@ -152,7 +151,7 @@ smpi_coll_tuned_gather_ompi_binomial(void *sbuf, int scount,
 
        smpi_mpi_send(ptmp, total_recv, sdtype,
                                bmtree->tree_prev,
-                               MCA_COLL_BASE_TAG_GATHER,
+                               COLL_TAG_GATHER,
                                 comm);
   }
     if (rank == root) {
@@ -243,16 +242,16 @@ smpi_coll_tuned_gather_ompi_linear_sync(void *sbuf, int scount,
                                       first_segment_count );
 
         smpi_mpi_recv(sbuf, 0, MPI_BYTE, root, 
-                                MCA_COLL_BASE_TAG_GATHER,
+                                COLL_TAG_GATHER,
                                 comm, MPI_STATUS_IGNORE);
 
         smpi_mpi_send(sbuf, first_segment_count, sdtype, root,
-                                MCA_COLL_BASE_TAG_GATHER,
+                                COLL_TAG_GATHER,
                                  comm);
 
         smpi_mpi_send((char*)sbuf + extent * first_segment_count, 
                                 (scount - first_segment_count), sdtype, 
-                                root, MCA_COLL_BASE_TAG_GATHER,
+                                root, COLL_TAG_GATHER,
                                  comm);
     }
 
@@ -288,18 +287,18 @@ smpi_coll_tuned_gather_ompi_linear_sync(void *sbuf, int scount,
             /* irecv for the first segment from i */
             ptmp = (char*)rbuf + i * rcount * extent;
             first_segment_req = smpi_mpi_irecv(ptmp, first_segment_count, rdtype, i,
-                                     MCA_COLL_BASE_TAG_GATHER, comm
+                                     COLL_TAG_GATHER, comm
                                      );
             
             /* send sync message */
             smpi_mpi_send(rbuf, 0, MPI_BYTE, i,
-                                    MCA_COLL_BASE_TAG_GATHER,
+                                    COLL_TAG_GATHER,
                                      comm);
 
             /* irecv for the second segment */
             ptmp = (char*)rbuf + (i * rcount + first_segment_count) * extent;
             reqs[i]=smpi_mpi_irecv(ptmp, (rcount - first_segment_count), 
-                                     rdtype, i, MCA_COLL_BASE_TAG_GATHER, comm
+                                     rdtype, i, COLL_TAG_GATHER, comm
                                      );
 
             /* wait on the first segment to complete */
@@ -376,7 +375,7 @@ smpi_coll_tuned_gather_ompi_basic_linear(void *sbuf, int scount,
 
     if (rank != root) {
         smpi_mpi_send(sbuf, scount, sdtype, root,
-                                 MCA_COLL_BASE_TAG_GATHER,
+                                 COLL_TAG_GATHER,
                                   comm);
         return MPI_SUCCESS;
     }
@@ -395,7 +394,7 @@ smpi_coll_tuned_gather_ompi_basic_linear(void *sbuf, int scount,
             }
         } else {
             smpi_mpi_recv(ptmp, rcount, rdtype, i,
-                                    MCA_COLL_BASE_TAG_GATHER,
+                                    COLL_TAG_GATHER,
                                     comm, MPI_STATUS_IGNORE);
             err = MPI_SUCCESS;
         }
index 5a3b887..2bb714a 100644 (file)
@@ -10,7 +10,7 @@ int smpi_coll_tuned_reduce_NTSL(void *buf, void *rbuf, int count,
                                 MPI_Datatype datatype, MPI_Op op, int root,
                                 MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = COLL_TAG_REDUCE;
   MPI_Status status;
   MPI_Request *send_request_array;
   MPI_Request *recv_request_array;
index 1e25250..4038e70 100644 (file)
@@ -21,7 +21,7 @@ int smpi_coll_tuned_reduce_arrival_pattern_aware(void *buf, void *rbuf,
   int rank;
   rank = smpi_comm_rank(comm);
 
-  int tag = 50;
+  int tag = COLL_TAG_REDUCE;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *send_request_array;
index f2555f8..6c91ffb 100644 (file)
@@ -10,7 +10,7 @@ int smpi_coll_tuned_reduce_binomial(void *sendbuf, void *recvbuf, int count,
   int comm_size, rank;
   int mask, relrank, source;
   int dst;
-  int tag = 4321;
+  int tag = COLL_TAG_REDUCE;
   MPI_Aint extent;
   void *tmp_buf;
   MPI_Aint true_lb, true_extent;
index f304e78..9241be1 100644 (file)
@@ -6,7 +6,7 @@ smpi_coll_tuned_reduce_flat_tree(void *sbuf, void *rbuf, int count,
                                  MPI_Datatype dtype, MPI_Op op,
                                  int root, MPI_Comm comm)
 {
-  int i, tag = 4321;
+  int i, tag = COLL_TAG_REDUCE;
   int size;
   int rank;
   MPI_Aint extent;
index 78294e8..25353aa 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "colls_private.h"
 #include "coll_tuned_topo.h"
-#define MCA_COLL_BASE_TAG_REDUCE 555
 
 
 
@@ -151,7 +150,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
 
                     reqs[inbi]=smpi_mpi_irecv(local_recvbuf, recvcount, datatype,
                                              tree->tree_next[i], 
-                                             MCA_COLL_BASE_TAG_REDUCE, comm
+                                             COLL_TAG_REDUCE, comm
                                              );
                 }
                 /* wait for previous req to complete, if any.
@@ -195,7 +194,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
                         /* send combined/accumulated data to parent */
                         smpi_mpi_send( accumulator, prevcount, 
                                                   datatype, tree->tree_prev, 
-                                                  MCA_COLL_BASE_TAG_REDUCE,
+                                                  COLL_TAG_REDUCE,
                                                   comm);
                     }
 
@@ -242,7 +241,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
                                          segindex * segment_increment,
                                          count_by_segment, datatype,
                                          tree->tree_prev, 
-                                         MCA_COLL_BASE_TAG_REDUCE,
+                                         COLL_TAG_REDUCE,
                                          comm) ;
                 segindex++;
                 original_count -= count_by_segment;
@@ -270,7 +269,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
                                           segindex * segment_increment,
                                           count_by_segment, datatype,
                                           tree->tree_prev, 
-                                          MCA_COLL_BASE_TAG_REDUCE,
+                                          COLL_TAG_REDUCE,
                                           comm);
                 original_count -= count_by_segment;
             }
@@ -288,7 +287,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
                                           segindex * segment_increment, 
                                           count_by_segment, datatype, 
                                           tree->tree_prev, 
-                                          MCA_COLL_BASE_TAG_REDUCE, 
+                                          COLL_TAG_REDUCE,
                                           comm );
                 creq = (creq + 1) % max_outstanding_reqs;
                 segindex++;
@@ -545,7 +544,7 @@ int smpi_coll_tuned_reduce_ompi_in_order_binary( void *sendbuf, void *recvbuf,
         if (root == rank) {
             /* Receive result from rank io_root to recvbuf */
             smpi_mpi_recv(recvbuf, count, datatype, io_root,
-                                    MCA_COLL_BASE_TAG_REDUCE, comm,
+                                    COLL_TAG_REDUCE, comm,
                                     MPI_STATUS_IGNORE);
             if (MPI_IN_PLACE == sendbuf) {
                 free(use_this_sendbuf);
@@ -554,7 +553,7 @@ int smpi_coll_tuned_reduce_ompi_in_order_binary( void *sendbuf, void *recvbuf,
         } else if (io_root == rank) {
             /* Send result from use_this_recvbuf to root */
             smpi_mpi_send(use_this_recvbuf, count, datatype, root,
-                                    MCA_COLL_BASE_TAG_REDUCE, 
+                                    COLL_TAG_REDUCE,
                                     comm);
             free(use_this_recvbuf);
         }
@@ -610,7 +609,7 @@ smpi_coll_tuned_reduce_ompi_basic_linear(void *sbuf, void *rbuf, int count,
 
     if (rank != root) {
         smpi_mpi_send(sbuf, count, dtype, root,
-                                MCA_COLL_BASE_TAG_REDUCE,
+                                COLL_TAG_REDUCE,
                                 comm);
         return -1;
     }
@@ -642,7 +641,7 @@ smpi_coll_tuned_reduce_ompi_basic_linear(void *sbuf, void *rbuf, int count,
         smpi_datatype_copy((char*)sbuf, count, dtype,(char*)rbuf, count, dtype);
     } else {
         smpi_mpi_recv(rbuf, count, dtype, size - 1,
-                                MCA_COLL_BASE_TAG_REDUCE, comm,
+                                COLL_TAG_REDUCE, comm,
                                 MPI_STATUS_IGNORE);
     }
 
@@ -653,7 +652,7 @@ smpi_coll_tuned_reduce_ompi_basic_linear(void *sbuf, void *rbuf, int count,
             inbuf = (char*)sbuf;
         } else {
             smpi_mpi_recv(pml_buffer, count, dtype, i,
-                                    MCA_COLL_BASE_TAG_REDUCE, comm,
+                                    COLL_TAG_REDUCE, comm,
                                     MPI_STATUS_IGNORE);
             inbuf = pml_buffer;
         }
index 2c61d48..24ad911 100644 (file)
@@ -15,7 +15,7 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf,
   int recv_idx, last_idx = 0, newdst;
   int dst, send_cnt, recv_cnt, newroot, newdst_tree_root;
   int newroot_tree_root, new_count;
-  int tag = 4321;
+  int tag = COLL_TAG_REDUCE;
   void *send_ptr, *recv_ptr, *tmp_buf;
 
   cnts = NULL;
index e7631be..5101c7e 100644 (file)
@@ -1,5 +1,4 @@
 #include "colls_private.h"
-#define MPIR_REDUCE_SCATTER_TAG 222
 
 static inline int MPIU_Mirror_permutation(unsigned int x, int bits)
 {
@@ -70,16 +69,16 @@ int smpi_coll_tuned_reduce_scatter_mpich_pair(void *sendbuf, void *recvbuf, int
             if (sendbuf != MPI_IN_PLACE) 
                 smpi_mpi_sendrecv(((char *)sendbuf+disps[dst]*extent), 
                                              recvcounts[dst], datatype, dst,
-                                             MPIR_REDUCE_SCATTER_TAG, tmp_recvbuf,
+                                             COLL_TAG_SCATTER, tmp_recvbuf,
                                              recvcounts[rank], datatype, src,
-                                             MPIR_REDUCE_SCATTER_TAG, comm,
+                                             COLL_TAG_SCATTER, comm,
                                              MPI_STATUS_IGNORE);
             else
                 smpi_mpi_sendrecv(((char *)recvbuf+disps[dst]*extent), 
                                              recvcounts[dst], datatype, dst,
-                                             MPIR_REDUCE_SCATTER_TAG, tmp_recvbuf,
+                                             COLL_TAG_SCATTER, tmp_recvbuf,
                                              recvcounts[rank], datatype, src,
-                                             MPIR_REDUCE_SCATTER_TAG, comm,
+                                             COLL_TAG_SCATTER, comm,
                                              MPI_STATUS_IGNORE);
             
             if (is_commutative || (src < rank)) {
@@ -212,9 +211,9 @@ int smpi_coll_tuned_reduce_scatter_mpich_noncomm(void *sendbuf, void *recvbuf, i
         }
 
         smpi_mpi_sendrecv(outgoing_data + send_offset*true_extent,
-                                     size, datatype, peer, MPIR_REDUCE_SCATTER_TAG,
+                                     size, datatype, peer, COLL_TAG_SCATTER,
                                      incoming_data + recv_offset*true_extent,
-                                     size, datatype, peer, MPIR_REDUCE_SCATTER_TAG,
+                                     size, datatype, peer, COLL_TAG_SCATTER,
                                      comm, MPI_STATUS_IGNORE);
         /* always perform the reduction at recv_offset, the data at send_offset
            is now our peer's responsibility */
@@ -367,9 +366,9 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
                        tmp_results. accumulation is done later below.   */ 
 
                     smpi_mpi_sendrecv(tmp_results, 1, sendtype, dst,
-                                                 MPIR_REDUCE_SCATTER_TAG, 
+                                                 COLL_TAG_SCATTER,
                                                  tmp_recvbuf, 1, recvtype, dst,
-                                                 MPIR_REDUCE_SCATTER_TAG, comm,
+                                                 COLL_TAG_SCATTER, comm,
                                                  MPI_STATUS_IGNORE);
                     received = 1;
                 }
@@ -411,7 +410,7 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
                             && (dst >= tree_root + nprocs_completed)) {
                             /* send the current result */
                             smpi_mpi_send(tmp_recvbuf, 1, recvtype,
-                                                     dst, MPIR_REDUCE_SCATTER_TAG,
+                                                     dst, COLL_TAG_SCATTER,
                                                      comm);
                         }
                         /* recv only if this proc. doesn't have data and sender
@@ -420,7 +419,7 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
                                  (dst < tree_root + nprocs_completed) &&
                                  (rank >= tree_root + nprocs_completed)) {
                             smpi_mpi_recv(tmp_recvbuf, 1, recvtype, dst,
-                                                     MPIR_REDUCE_SCATTER_TAG,
+                                                     COLL_TAG_SCATTER,
                                                      comm, MPI_STATUS_IGNORE); 
                             received = 1;
                         }
index e10be98..bb01dee 100644 (file)
@@ -22,7 +22,6 @@
 #include "colls_private.h"
 #include "coll_tuned_topo.h"
 
-#define MCA_COLL_BASE_TAG_REDUCE_SCATTER 222
 /*
  * Recursive-halving function is (*mostly*) copied from the BASIC coll module.
  * I have removed the part which handles "large" message sizes 
@@ -116,13 +115,13 @@ smpi_coll_tuned_reduce_scatter_ompi_basic_recursivehalving(void *sbuf,
     if (rank < 2 * remain) {
         if ((rank & 1) == 0) {
             smpi_mpi_send(result_buf, count, dtype, rank + 1, 
-                                    MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                    COLL_TAG_REDUCE_SCATTER,
                                     comm);
             /* we don't participate from here on out */
             tmp_rank = -1;
         } else {
             smpi_mpi_recv(recv_buf, count, dtype, rank - 1,
-                                    MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                    COLL_TAG_REDUCE_SCATTER,
                                     comm, MPI_STATUS_IGNORE);
          
             /* integrate their results into our temp results */
@@ -211,7 +210,7 @@ smpi_coll_tuned_reduce_scatter_ompi_basic_recursivehalving(void *sbuf,
             if (send_count > 0 && recv_count != 0) {
                 request=smpi_mpi_irecv(recv_buf + (ptrdiff_t)tmp_disps[recv_index] * extent,
                                          recv_count, dtype, peer,
-                                         MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                         COLL_TAG_REDUCE_SCATTER,
                                          comm);
                 if (MPI_SUCCESS != err) {
                     xbt_free(tmp_rcounts);
@@ -222,7 +221,7 @@ smpi_coll_tuned_reduce_scatter_ompi_basic_recursivehalving(void *sbuf,
             if (recv_count > 0 && send_count != 0) {
                 smpi_mpi_send(result_buf + (ptrdiff_t)tmp_disps[send_index] * extent,
                                         send_count, dtype, peer, 
-                                        MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                        COLL_TAG_REDUCE_SCATTER,
                                         comm);
                 if (MPI_SUCCESS != err) {
                     xbt_free(tmp_rcounts);
@@ -271,14 +270,14 @@ smpi_coll_tuned_reduce_scatter_ompi_basic_recursivehalving(void *sbuf,
         if ((rank & 1) == 0) {
             if (rcounts[rank]) {
                 smpi_mpi_recv(rbuf, rcounts[rank], dtype, rank + 1,
-                                        MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                        COLL_TAG_REDUCE_SCATTER,
                                         comm, MPI_STATUS_IGNORE);
             }
         } else {
             if (rcounts[rank - 1]) {
                 smpi_mpi_send(result_buf + disps[rank - 1] * extent,
                                         rcounts[rank - 1], dtype, rank - 1,
-                                        MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                        COLL_TAG_REDUCE_SCATTER,
                                         comm);
             }
         }            
@@ -452,11 +451,11 @@ smpi_coll_tuned_reduce_scatter_ompi_ring(void *sbuf, void *rbuf, int *rcounts,
     inbi = 0;
     /* Initialize first receive from the neighbor on the left */
     reqs[inbi]=smpi_mpi_irecv(inbuf[inbi], max_block_count, dtype, recv_from,
-                             MCA_COLL_BASE_TAG_REDUCE_SCATTER, comm
+                             COLL_TAG_REDUCE_SCATTER, comm
                              );
     tmpsend = accumbuf + (ptrdiff_t)displs[recv_from] * extent;
     smpi_mpi_send(tmpsend, rcounts[recv_from], dtype, send_to,
-                            MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                            COLL_TAG_REDUCE_SCATTER,
                              comm);
 
     for (k = 2; k < size; k++) {
@@ -466,7 +465,7 @@ smpi_coll_tuned_reduce_scatter_ompi_ring(void *sbuf, void *rbuf, int *rcounts,
 
         /* Post irecv for the current block */
         reqs[inbi]=smpi_mpi_irecv(inbuf[inbi], max_block_count, dtype, recv_from,
-                                 MCA_COLL_BASE_TAG_REDUCE_SCATTER, comm 
+                                 COLL_TAG_REDUCE_SCATTER, comm
                                  );
       
         /* Wait on previous block to arrive */
@@ -480,7 +479,7 @@ smpi_coll_tuned_reduce_scatter_ompi_ring(void *sbuf, void *rbuf, int *rcounts,
       
         /* send previous block to send_to */
         smpi_mpi_send(tmprecv, rcounts[prevblock], dtype, send_to,
-                                MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                COLL_TAG_REDUCE_SCATTER,
                                  comm);
     }
 
index dbc223f..7cce8ae 100644 (file)
@@ -20,7 +20,6 @@
 #include "colls_private.h"
 #include "coll_tuned_topo.h"
 
-#define MCA_COLL_BASE_TAG_SCATTER 111
 
 int
 smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
@@ -123,7 +122,7 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
        if (rank != root) {
            /* recv from parent on non-root */
            smpi_mpi_recv(ptmp, rcount*size, rdtype, bmtree->tree_prev,
-                                   MCA_COLL_BASE_TAG_SCATTER, comm, &status);
+                                   COLL_TAG_SCATTER, comm, &status);
            /* local copy to rbuf */
            err = smpi_datatype_copy(ptmp, scount, sdtype,
                                  rbuf, rcount, rdtype);
@@ -140,7 +139,7 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
 
            smpi_mpi_send(ptmp + total_send*sextent, mycount, sdtype,
                                    bmtree->tree_next[i],
-                                   MCA_COLL_BASE_TAG_SCATTER,
+                                   COLL_TAG_SCATTER,
                                     comm);
 
            total_send += mycount;
@@ -151,7 +150,7 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
     } else {
        /* recv from parent on leaf nodes */
        smpi_mpi_recv(ptmp, rcount, rdtype, bmtree->tree_prev,
-                               MCA_COLL_BASE_TAG_SCATTER, comm, &status);
+                               COLL_TAG_SCATTER, comm, &status);
     }
     //!FIXME : store the tree, as done in ompi, instead of calculating it each time ?
     xbt_free(bmtree);
@@ -209,7 +208,7 @@ smpi_coll_tuned_scatter_ompi_basic_linear(void *sbuf, int scount,
 
     if (rank != root) {
         smpi_mpi_recv(rbuf, rcount, rdtype, root,
-                                MCA_COLL_BASE_TAG_SCATTER,
+                                COLL_TAG_SCATTER,
                                 comm, MPI_STATUS_IGNORE);
         return MPI_SUCCESS;
     }
@@ -234,7 +233,7 @@ smpi_coll_tuned_scatter_ompi_basic_linear(void *sbuf, int scount,
             }
         } else {
             smpi_mpi_send(ptmp, scount, sdtype, i,
-                                    MCA_COLL_BASE_TAG_SCATTER,
+                                    COLL_TAG_SCATTER,
                                      comm);
         }
         if (MPI_SUCCESS != err) {
index 11a8933..6c34cd0 100644 (file)
@@ -47,6 +47,20 @@ typedef struct s_smpi_mpi_datatype{
   int in_use;
 } s_smpi_mpi_datatype_t;
 
+
+#define COLL_TAG_REDUCE 111
+#define COLL_TAG_SCATTER 222
+#define COLL_TAG_SCATTERV 333
+#define COLL_TAG_GATHER 444
+#define COLL_TAG_ALLGATHER 555
+#define COLL_TAG_ALLGATHERV 666
+#define COLL_TAG_BARRIER 777
+#define COLL_TAG_REDUCE_SCATTER 888
+#define COLL_TAG_ALLTOALLV 999
+#define COLL_TAG_ALLTOALL 1111
+#define COLL_TAG_GATHERV 2222
+#define COLL_TAG_BCAST 3333
+#define COLL_TAG_ALLREDUCE 4444
 //*****************************************************************************************
 
 typedef struct s_smpi_mpi_request {
index 875ce4e..d7b67c0 100644 (file)
@@ -528,7 +528,7 @@ void smpi_mpi_sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
   MPI_Request requests[2];
   MPI_Status stats[2];
   int myid=smpi_process_index();
-  if ((dst == myid) && (src == myid)) {
+  if ((smpi_group_index(smpi_comm_group(comm), dst) == myid) && (smpi_group_index(smpi_comm_group(comm), src) == myid)) {
       smpi_datatype_copy(sendbuf, sendcount, sendtype,
                                      recvbuf, recvcount, recvtype);
       return;
@@ -912,7 +912,7 @@ void smpi_mpi_gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                      void *recvbuf, int recvcount, MPI_Datatype recvtype,
                      int root, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_GATHER;
   int rank, size, src, index;
   MPI_Aint lb = 0, recvext = 0;
   MPI_Request *requests;
@@ -975,7 +975,7 @@ void smpi_mpi_gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                       void *recvbuf, int *recvcounts, int *displs,
                       MPI_Datatype recvtype, int root, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_GATHERV;
   int rank, size, src, index;
   MPI_Aint lb = 0, recvext = 0;
   MPI_Request *requests;
@@ -1015,7 +1015,7 @@ void smpi_mpi_allgather(void *sendbuf, int sendcount,
                         int recvcount, MPI_Datatype recvtype,
                         MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_ALLGATHER;
   int rank, size, other, index;
   MPI_Aint lb = 0, recvext = 0;
   MPI_Request *requests;
@@ -1054,7 +1054,7 @@ void smpi_mpi_allgatherv(void *sendbuf, int sendcount,
                          int *recvcounts, int *displs,
                          MPI_Datatype recvtype, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_ALLGATHERV;
   int rank, size, other, index;
   MPI_Aint lb = 0, recvext = 0;
   MPI_Request *requests;
@@ -1092,7 +1092,7 @@ void smpi_mpi_scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                       void *recvbuf, int recvcount, MPI_Datatype recvtype,
                       int root, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_SCATTER;
   int rank, size, dst, index;
   MPI_Aint lb = 0, sendext = 0;
   MPI_Request *requests;
@@ -1131,7 +1131,7 @@ void smpi_mpi_scatterv(void *sendbuf, int *sendcounts, int *displs,
                        MPI_Datatype sendtype, void *recvbuf, int recvcount,
                        MPI_Datatype recvtype, int root, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_SCATTERV;
   int rank, size, dst, index;
   MPI_Aint lb = 0, sendext = 0;
   MPI_Request *requests;
@@ -1170,30 +1170,35 @@ void smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count,
                      MPI_Datatype datatype, MPI_Op op, int root,
                      MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_REDUCE;
   int rank, size, src, index;
   MPI_Aint lb = 0, dataext = 0;
   MPI_Request *requests;
   void **tmpbufs;
 
+  char* sendtmpbuf = (char*) sendbuf;
+  if( sendbuf == MPI_IN_PLACE ) {
+      sendtmpbuf = (char *)recvbuf;
+  }
+
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
   //non commutative case, use a working algo from openmpi
   if(!smpi_op_is_commute(op)){
-    smpi_coll_tuned_reduce_ompi_basic_linear(sendbuf, recvbuf, count,
+    smpi_coll_tuned_reduce_ompi_basic_linear(sendtmpbuf, recvbuf, count,
                      datatype, op, root, comm);
     return;
   }
   
   if(rank != root) {
     // Send buffer to root
-    smpi_mpi_send(sendbuf, count, datatype, root, system_tag, comm);
+    smpi_mpi_send(sendtmpbuf, count, datatype, root, system_tag, comm);
   } else {
     // FIXME: check for errors
     smpi_datatype_extent(datatype, &lb, &dataext);
     // Local copy from root
-    if (sendbuf && recvbuf)
-      smpi_datatype_copy(sendbuf, count, datatype, recvbuf, count, datatype);
+    if (sendtmpbuf && recvbuf)
+      smpi_datatype_copy(sendtmpbuf, count, datatype, recvbuf, count, datatype);
     // Receive buffers from senders
     //TODO: make a MPI_barrier here ?
     requests = xbt_new(MPI_Request, size - 1);
@@ -1239,7 +1244,7 @@ void smpi_mpi_allreduce(void *sendbuf, void *recvbuf, int count,
 void smpi_mpi_scan(void *sendbuf, void *recvbuf, int count,
                    MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = 888;
   int rank, size, other, index;
   MPI_Aint lb = 0, dataext = 0;
   MPI_Request *requests;
index d49b858..611690a 100644 (file)
@@ -78,7 +78,7 @@ void smpi_comm_get_name (MPI_Comm comm, char* name, int* len)
 
 MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key)
 {
-  int system_tag = 666;
+  int system_tag = 123;
   int index, rank, size, i, j, count, reqs;
   int* sendbuf;
   int* recvbuf;
index b034aaf..c35b821 100644 (file)
@@ -588,26 +588,41 @@ int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
       size = 0;
       for (i = 0; i < n; i++) {
         for (rank = ranges[i][0];       /* First */
-             rank >= 0 && rank <= ranges[i][1]; /* Last */
-             rank += ranges[i][2] /* Stride */ ) {
+             rank >= 0; /* Last */
+              ) {
           size++;
+
+          rank += ranges[i][2]; /* Stride */
+         if (ranges[i][0]<ranges[i][1]){
+             if(rank > ranges[i][1])
+               break;
+         }else{
+             if(rank < ranges[i][1])
+               break;
+         }
         }
       }
-      if (size == smpi_group_size(group)) {
-        *newgroup = group;
-      } else {
+
         *newgroup = smpi_group_new(size);
         j = 0;
         for (i = 0; i < n; i++) {
           for (rank = ranges[i][0];     /* First */
-               rank >= 0 && rank <= ranges[i][1];       /* Last */
-               rank += ranges[i][2] /* Stride */ ) {
+               rank >= 0; /* Last */
+               ) {
             index = smpi_group_index(group, rank);
             smpi_group_set_mapping(*newgroup, index, j);
             j++;
+            rank += ranges[i][2]; /* Stride */
+           if (ranges[i][0]<ranges[i][1]){
+             if(rank > ranges[i][1])
+               break;
+           }else{
+             if(rank < ranges[i][1])
+               break;
+           }
           }
         }
-      }
+      //}
     }
     smpi_group_use(*newgroup);
     retval = MPI_SUCCESS;
@@ -792,7 +807,11 @@ int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
     retval = MPI_ERR_GROUP;
   } else if (newcomm == NULL) {
     retval = MPI_ERR_ARG;
-  } else {
+  } else if(smpi_group_rank(group,smpi_process_index())==MPI_UNDEFINED){
+    *newcomm= MPI_COMM_NULL;
+    retval = MPI_SUCCESS;
+  }else{
+
     *newcomm = smpi_comm_new(group);
     retval = MPI_SUCCESS;
   }
index 5991906..2efcaa8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, 2011, 2012. The SimGrid Team.
+/* Copyright (c) 2009 - 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@ static void log_timed_action (const char *const *action, double clock){
 }
 
 typedef struct {
-  xbt_dynar_t isends; /* of MPI_Request */
   xbt_dynar_t irecvs; /* of MPI_Request */
 } s_smpi_replay_globals_t, *smpi_replay_globals_t;
 
@@ -47,7 +46,7 @@ static double parse_double(const char *string)
 static MPI_Datatype decode_datatype(const char *const action)
 {
 // Declared datatypes,
+
   switch(atoi(action))
   {
     case 0:
@@ -73,7 +72,7 @@ static MPI_Datatype decode_datatype(const char *const action)
       break;
     default:
       MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
-  
+
   }
    return MPI_CURRENT_TYPE;
 }
@@ -83,12 +82,11 @@ static void action_init(const char *const *action)
   int i;
   XBT_DEBUG("Initialize the counters");
   smpi_replay_globals_t globals =  xbt_new(s_smpi_replay_globals_t, 1);
-  globals->isends = xbt_dynar_new(sizeof(MPI_Request),NULL);
   globals->irecvs = xbt_dynar_new(sizeof(MPI_Request),NULL);
 
   if(action[2]) MPI_DEFAULT_TYPE= MPI_DOUBLE; // default MPE dataype 
   else MPI_DEFAULT_TYPE= MPI_BYTE; // default TAU datatype
-  
+
   smpi_process_set_user_data((void*) globals);
 
   /* start a simulated timer */
@@ -98,7 +96,7 @@ static void action_init(const char *const *action)
 
   if (!reqq) {
     reqq=xbt_new0(xbt_dynar_t,active_processes);
-  
+
     for(i=0;i<active_processes;i++){
       reqq[i]=xbt_dynar_new(sizeof(MPI_Request),NULL);
     }
@@ -110,9 +108,8 @@ static void action_finalize(const char *const *action)
   smpi_replay_globals_t globals =
       (smpi_replay_globals_t) smpi_process_get_user_data();
   if (globals){
-    XBT_DEBUG("There are %lu isends and %lu irecvs in the dynars",
-         xbt_dynar_length(globals->isends),xbt_dynar_length(globals->irecvs));
-    xbt_dynar_free_container(&(globals->isends));
+    XBT_DEBUG("There are %lu irecvs in the dynar",
+         xbt_dynar_length(globals->irecvs));
     xbt_dynar_free_container(&(globals->irecvs));
   }
   free(globals);
@@ -159,7 +156,7 @@ static void action_send(const char *const *action)
   } else {
     MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
   }
-    
+
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_computing_out(rank);
@@ -189,8 +186,6 @@ static void action_Isend(const char *const *action)
   if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
   else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
 
-  smpi_replay_globals_t globals =
-     (smpi_replay_globals_t) smpi_process_get_user_data();
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_computing_out(rank);
@@ -200,14 +195,13 @@ static void action_Isend(const char *const *action)
 #endif
 
   request = smpi_mpi_isend(NULL, size, MPI_CURRENT_TYPE, to, 0,MPI_COMM_WORLD);
-  
+
 #ifdef HAVE_TRACING
   TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
   request->send = 1;
   TRACE_smpi_computing_in(rank);
 #endif
 
-  xbt_dynar_push(globals->isends,&request);
   xbt_dynar_push(reqq[smpi_comm_rank(MPI_COMM_WORLD)],&request);
 
   log_timed_action (action, clock);
@@ -221,7 +215,7 @@ static void action_recv(const char *const *action) {
 
   if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
   else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
-  
+
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   int src_traced = smpi_group_rank(smpi_comm_group(MPI_COMM_WORLD), from);
@@ -250,7 +244,7 @@ static void action_Irecv(const char *const *action)
 
   smpi_replay_globals_t globals =
      (smpi_replay_globals_t) smpi_process_get_user_data();
-  
+
   if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
   else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
 
@@ -261,7 +255,7 @@ static void action_Irecv(const char *const *action)
 #endif
 
   request = smpi_mpi_irecv(NULL, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD);
-  
+
 #ifdef HAVE_TRACING
   TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
   request->recv = 1;
@@ -317,14 +311,14 @@ static void action_waitall(const char *const *action){
   if (count_requests>0) {
     MPI_Request requests[count_requests];
     MPI_Status status[count_requests];
-  
+
     /*  The reqq is an array of dynars. Its index corresponds to the rank.
      Thus each rank saves its own requests to the array request. */
     xbt_dynar_foreach(reqq[smpi_comm_rank(MPI_COMM_WORLD)],i,requests[i]); 
-    
+
   #ifdef HAVE_TRACING
    //save information from requests
+
    xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), NULL);
    xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), NULL);
    xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), NULL);
@@ -375,7 +369,7 @@ static void action_waitall(const char *const *action){
    xbt_dynar_free(&recvs);
    TRACE_smpi_computing_in(rank_traced);
   #endif
-   
+
    xbt_dynar_reset(reqq[smpi_comm_rank(MPI_COMM_WORLD)]);
   }
   log_timed_action (action, clock);
@@ -415,7 +409,7 @@ static void action_bcast(const char *const *action)
       MPI_CURRENT_TYPE=decode_datatype(action[4]);   
     }
   }
-  
+
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_computing_out(rank);
@@ -439,12 +433,12 @@ static void action_reduce(const char *const *action)
   double clock = smpi_process_simulated_elapsed();
   int root=0;
   MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
-  
+
   if(action[4]) {
-      root= atoi(action[4]);
-      if(action[5]) {
-       MPI_CURRENT_TYPE=decode_datatype(action[5]);
-      }
+    root= atoi(action[4]);
+    if(action[5]) {
+      MPI_CURRENT_TYPE=decode_datatype(action[5]);
+    }
   }
 
 #ifdef HAVE_TRACING
@@ -466,19 +460,19 @@ static void action_reduce(const char *const *action)
 static void action_allReduce(const char *const *action) {
   double comm_size = parse_double(action[2]);
   double comp_size = parse_double(action[3]);
-  
+
   if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
   else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
-  
+
   double clock = smpi_process_simulated_elapsed();
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_computing_out(rank);
   TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
 #endif
-   mpi_coll_reduce_fun(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, 0, MPI_COMM_WORLD);
+  mpi_coll_reduce_fun(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, 0, MPI_COMM_WORLD);
   smpi_execute_flops(comp_size);
-   mpi_coll_bcast_fun(NULL, comm_size, MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
+  mpi_coll_bcast_fun(NULL, comm_size, MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
@@ -493,7 +487,7 @@ static void action_allToAll(const char *const *action) {
   int send_size = parse_double(action[2]);
   int recv_size = parse_double(action[3]);
   MPI_Datatype MPI_CURRENT_TYPE2;
-  
+
   if(action[4]) {
     MPI_CURRENT_TYPE=decode_datatype(action[4]);
     MPI_CURRENT_TYPE2=decode_datatype(action[5]);
@@ -510,7 +504,7 @@ static void action_allToAll(const char *const *action) {
   TRACE_smpi_computing_out(rank);
   TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
 #endif
-  
+
   mpi_coll_alltoall_fun(send, send_size, MPI_CURRENT_TYPE, recv, recv_size, MPI_CURRENT_TYPE2, MPI_COMM_WORLD);
 
 #ifdef HAVE_TRACING
@@ -525,8 +519,6 @@ static void action_allToAll(const char *const *action) {
 
 
 static void action_gather(const char *const *action) {
-  
-  
   /*
  The structure of the gather action for the rank 0 (total 4 processes) 
  is the following:   
@@ -538,7 +530,6 @@ static void action_gather(const char *const *action) {
   3) 0 is the root node
   4) 0 is the send datatype id, see decode_datatype()
   5) 0 is the recv datatype id, see decode_datatype()
-    
   */
   double clock = smpi_process_simulated_elapsed();
   int comm_size = smpi_comm_size(MPI_COMM_WORLD);
@@ -552,8 +543,8 @@ static void action_gather(const char *const *action) {
     MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
     MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
   }
-  void *send = calloc(send_size, smpi_datatype_size(MPI_CURRENT_TYPE));  
-  void *recv = calloc(recv_size, smpi_datatype_size(MPI_CURRENT_TYPE2));  
+  void *send = calloc(send_size, smpi_datatype_size(MPI_CURRENT_TYPE));
+  void *recv = calloc(recv_size, smpi_datatype_size(MPI_CURRENT_TYPE2));
 
   int root=atoi(action[4]);
   int rank = smpi_process_index();
@@ -581,7 +572,7 @@ smpi_mpi_gather(send, send_size, MPI_CURRENT_TYPE,
 
 
 static void action_reducescatter(const char *const *action) {
-  
+
     /*
  The structure of the reducescatter action for the rank 0 (total 4 processes) 
  is the following:   
@@ -591,9 +582,9 @@ static void action_reducescatter(const char *const *action) {
   1) The first four values after the name of the action declare the recvcounts array
   2) The value 11346849 is the amount of instructions
   3) The last value corresponds to the datatype, see decode_datatype().
-  
+
   We analyze a MPI_Reduce_scatter call to one MPI_Reduce and one MPI_Scatterv.
-  
+
    */
 
   double clock = smpi_process_simulated_elapsed();
@@ -625,8 +616,8 @@ static void action_reducescatter(const char *const *action) {
    smpi_mpi_scatterv(NULL, recvcounts, disps, MPI_CURRENT_TYPE, NULL,
                       recvcounts[rank], MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
    smpi_execute_flops(comp_size);
-    
-    
+
+
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
@@ -637,7 +628,7 @@ static void action_reducescatter(const char *const *action) {
 
 
 static void action_allgatherv(const char *const *action) {
-  
+
   /*
  The structure of the allgatherv action for the rank 0 (total 4 processes) 
  is the following:   
@@ -653,7 +644,7 @@ static void action_allgatherv(const char *const *action) {
    */
 
   double clock = smpi_process_simulated_elapsed();
-  
+
   int comm_size = smpi_comm_size(MPI_COMM_WORLD);
   int i=0;
   int sendcount=atoi(action[2]);
@@ -683,14 +674,14 @@ static void action_allgatherv(const char *const *action) {
   TRACE_smpi_computing_out(rank);
   TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
 #endif
-  
+
 mpi_coll_allgatherv_fun(sendbuf, sendcount, MPI_CURRENT_TYPE, recvbuf, recvcounts, disps, MPI_CURRENT_TYPE2, MPI_COMM_WORLD);
 
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
-   
+
   log_timed_action (action, clock);
   xbt_free(sendbuf);
   xbt_free(recvbuf);
@@ -712,12 +703,12 @@ static void action_allToAllv(const char *const *action) {
   4) 100*sizeof(int) is the size of the receiver buffer
   5)  1 70 10 5 is the recvcounts array
   6) 1 5 77 90 is the rdispls array
-    
+
    */
-  
-  
+
+
   double clock = smpi_process_simulated_elapsed();
-  
+
   int comm_size = smpi_comm_size(MPI_COMM_WORLD);
   int send_buf_size=0,recv_buf_size=0,i=0;
   int *sendcounts = xbt_new0(int, comm_size);  
@@ -726,7 +717,7 @@ static void action_allToAllv(const char *const *action) {
   int *recvdisps = xbt_new0(int, comm_size);  
 
   MPI_Datatype MPI_CURRENT_TYPE2;
-  
+
   send_buf_size=parse_double(action[2]);
   recv_buf_size=parse_double(action[3+2*comm_size]);
   if(action[4+4*comm_size]) {
@@ -737,7 +728,7 @@ static void action_allToAllv(const char *const *action) {
       MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
       MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
   }
-  
+
   void *sendbuf = calloc(send_buf_size, smpi_datatype_size(MPI_CURRENT_TYPE));  
   void *recvbuf = calloc(recv_buf_size, smpi_datatype_size(MPI_CURRENT_TYPE2));  
 
@@ -747,7 +738,7 @@ static void action_allToAllv(const char *const *action) {
     recvcounts[i] = atoi(action[i+4+2*comm_size]);
     recvdisps[i] = atoi(action[i+4+3*comm_size]);
   }
-  
+
 
 #ifdef HAVE_TRACING
   int rank = MPI_COMM_WORLD != MPI_COMM_NULL ? smpi_process_index() : -1;
@@ -761,7 +752,7 @@ static void action_allToAllv(const char *const *action) {
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
-   
+
   log_timed_action (action, clock);
   xbt_free(sendbuf);
   xbt_free(recvbuf);
@@ -769,8 +760,6 @@ static void action_allToAllv(const char *const *action) {
   xbt_free(recvcounts);
   xbt_free(senddisps);
   xbt_free(recvdisps);
-
-  
 }
 
 void smpi_replay_init(int *argc, char***argv){
index f943795..f7102f5 100644 (file)
@@ -53,7 +53,7 @@ int main( int argc, char **argv )
     }
 
     /* Free the communicator */
-    if (newcomm != MPI_COMM_NULL)
+    //if (newcomm != MPI_COMM_NULL)
        //MPI_Comm_free( &newcomm );
     Test_Waitforall( );
     MPI_Finalize();