Pavel Shamis avatar Pavel Shamis committed 85978e2

Moving mca/common/netpatterns and commpaterns to ompi/patterns.

Comments (0)

Files changed (64)

 include mpi/Makefile.am
 include mpi/man/man3/Makefile.extra
 include mpiext/Makefile.am
+include patterns/net/Makefile.am
+include patterns/comm/Makefile.am
 
 # Ensure that the man page directory exists before we try to make man
 # page files (because ompi/mpi/man/man3 has no config.status-generated

ompi/mca/bcol/basesmuma/Makefile.am

 mca_bcol_basesmuma_la_SOURCES = $(sources)
 mca_bcol_basesmuma_la_LDFLAGS = -module -avoid-version $(btl_portals_LDFLAGS)
 mca_bcol_basesmuma_la_LIBADD = \
-    	$(btl_portals_LIBS) \
-        $(top_ompi_builddir)/ompi/mca/common/netpatterns/libmca_common_netpatterns.la \
-        $(top_ompi_builddir)/ompi/mca/common/commpatterns/libmca_common_commpatterns.la 
+    	$(btl_portals_LIBS)
 
 
 noinst_LTLIBRARIES = $(component_noinst)

ompi/mca/bcol/basesmuma/bcol_basesmuma.h

 #include "ompi/mca/coll/ml/coll_ml_allocation.h"
 #include "ompi/request/request.h"
 #include "ompi/proc/proc.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
+#include "ompi/patterns/net/netpatterns.h"
 
 #include "opal/mca/mca.h"
 #include "opal/util/arch.h"
     sm_buffer_mgmt colls_with_user_data;
 
     /* recursive-doubling tree node */
-    mca_common_netpatterns_pair_exchange_node_t recursive_doubling_tree;
+    netpatterns_pair_exchange_node_t recursive_doubling_tree;
 
     /* k-nomial gather/allgather tree */
-    mca_common_netpatterns_k_exchange_node_t knomial_allgather_tree;
+    netpatterns_k_exchange_node_t knomial_allgather_tree;
 
     /* fanin tree node - root is rank 0 */
-    mca_common_netpatterns_tree_node_t fanin_node;
+    netpatterns_tree_node_t fanin_node;
 
     /* fanout tree node - root is rank 0 */
-    mca_common_netpatterns_tree_node_t fanout_node;
+    netpatterns_tree_node_t fanout_node;
 
     /* index of blocking barrier memory region to use */
     int index_blocking_barrier_memory_bank;
     int *comm_to_sm_map;
 
     /* reduction fanout tree */
-    mca_common_netpatterns_tree_node_t* reduction_tree;
+    netpatterns_tree_node_t* reduction_tree;
 
     /* broadcast fanout tree */
-    mca_common_netpatterns_tree_node_t* fanout_read_tree;
+    netpatterns_tree_node_t* fanout_read_tree;
 
     /* scatter - k-ary tree */
     int scatter_kary_radix;
-    mca_common_netpatterns_tree_node_t *scatter_kary_tree;
+    netpatterns_tree_node_t *scatter_kary_tree;
 
 	/* Knomial exchange tree */
 	/* Currently used for only large message reduce */
-	mca_common_netpatterns_k_exchange_node_t knomial_exchange_tree;
+	netpatterns_k_exchange_node_t knomial_exchange_tree;
 
     /* sequence number offset - want to make sure that we start
      *   id'ing collectives with id 0, so we can have simple

ompi/mca/bcol/basesmuma/bcol_basesmuma_bcast.c

     volatile char* parent_data_pointer;
     mca_bcol_basesmuma_header_t *my_ctl_pointer;
     volatile mca_bcol_basesmuma_header_t *parent_ctl_pointer;
-    mca_common_netpatterns_tree_node_t* my_fanout_read_tree;
+    netpatterns_tree_node_t* my_fanout_read_tree;
     size_t pack_len = 0, dt_size;
 
     void *data_addr = (void *)((unsigned char *)input_args->src_desc->data_addr );
     mca_bcol_basesmuma_module_t* bcol_module=
         (mca_bcol_basesmuma_module_t *)c_input_args->bcol_module;
 
-    mca_common_netpatterns_tree_node_t* my_fanout_read_tree;
+    netpatterns_tree_node_t* my_fanout_read_tree;
     size_t pack_len = 0, dt_size;
 
     void *data_addr = (void *)((unsigned char *)input_args->src_desc->data_addr);

ompi/mca/bcol/basesmuma/bcol_basesmuma_buf_mgmt.c

 #include "ompi/mca/bcol/bcol.h"
 #include "ompi/mca/bcol/base/base.h"
 #include "ompi/mca/coll/ml/coll_ml.h"
-#include "ompi/mca/common/commpatterns/common_coll_ops.h"
+#include "ompi/patterns/comm/coll_ops.h"
 
 #include "opal/dss/dss.h"
 

ompi/mca/bcol/basesmuma/bcol_basesmuma_fanin.c

 #include "ompi/constants.h"
 #include "ompi/communicator/communicator.h"
 #include "ompi/mca/bcol/bcol.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
+#include "ompi/patterns/net/netpatterns.h"
 
 #include "opal/sys/atomic.h"
 
     volatile mca_bcol_basesmuma_header_t *child_ctl;
 
 
-    mca_common_netpatterns_tree_node_t *my_tree_node = &(bcol_module->fanin_node);
+    netpatterns_tree_node_t *my_tree_node = &(bcol_module->fanin_node);
 
     /* Figure out - what instance of the basesmuma bcol I am */
     sequence_number = input_args->sequence_num;
     volatile mca_bcol_basesmuma_header_t *child_ctl;
 
 
-    mca_common_netpatterns_tree_node_t *my_tree_node = &(bcol_module->fanin_node);
+    netpatterns_tree_node_t *my_tree_node = &(bcol_module->fanin_node);
 
     sequence_number = input_args->sequence_num;
 

ompi/mca/bcol/basesmuma/bcol_basesmuma_fanout.c

 #include "ompi/constants.h"
 #include "ompi/communicator/communicator.h"
 #include "ompi/mca/bcol/bcol.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
+#include "ompi/patterns/net/netpatterns.h"
 
 #include "opal/sys/atomic.h"
 
     volatile mca_bcol_basesmuma_header_t *parent_ctl;
 
 
-    mca_common_netpatterns_tree_node_t *my_tree_node = &(bcol_module->fanin_node);
+    netpatterns_tree_node_t *my_tree_node = &(bcol_module->fanin_node);
 
     /* Figure out - what instance of the basesmuma bcol I am */
     sequence_number = input_args->sequence_num;

ompi/mca/bcol/basesmuma/bcol_basesmuma_module.c

 #include "ompi/communicator/communicator.h"
 #include "ompi/mca/bcol/bcol.h"
 #include "ompi/mca/bcol/base/base.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
+#include "ompi/patterns/net/netpatterns.h"
 
 #include "opal/util/show_help.h"
 #include "opal/align.h"
 				*sm_module)
 {
 	    int rc = OMPI_SUCCESS;
-	    rc = mca_common_netpatterns_setup_recursive_knomial_tree_node(
+	    rc = netpatterns_setup_recursive_knomial_tree_node(
 						                    sm_module->super.sbgp_partner_module->group_size,
    			              					sm_module->super.sbgp_partner_module->my_index,
             		     					mca_bcol_basesmuma_component.k_nomial_radix,
 {
     mca_bcol_basesmuma_module_t *sm_module = (mca_bcol_basesmuma_module_t *) super;
     
-    return mca_common_netpatterns_setup_recursive_knomial_allgather_tree_node(
+    return netpatterns_setup_recursive_knomial_allgather_tree_node(
             sm_module->super.sbgp_partner_module->group_size,
             sm_module->super.sbgp_partner_module->my_index,
             mca_bcol_basesmuma_component.k_nomial_radix,
     sm_module->reduction_tree = NULL;
     sm_module->fanout_read_tree = NULL;
 
-    ret=mca_common_netpatterns_setup_recursive_doubling_tree_node(
+    ret=netpatterns_setup_recursive_doubling_tree_node(
         module->group_size,module->my_index,
         &(sm_module->recursive_doubling_tree));
     if(OMPI_SUCCESS != ret) {
     /* setup the fanin tree - this is used only as part of a hierarchical
      *   barrier, so will set this up with rank 0 as the root */
     my_rank=module->my_index;
-    ret=mca_common_netpatterns_setup_narray_tree(cs->radix_fanin,
+    ret=netpatterns_setup_narray_tree(cs->radix_fanin,
         my_rank,module->group_size,&(sm_module->fanin_node));
     if(OMPI_SUCCESS != ret) {
 	    fprintf(stderr,"Error setting up fanin tree \n");
 
     /* setup the fanout tree - this is used only as part of a hierarchical
      *   barrier, so will set this up with rank 0 as the root */
-    ret=mca_common_netpatterns_setup_narray_tree(cs->radix_fanout,
+    ret=netpatterns_setup_narray_tree(cs->radix_fanout,
         my_rank,module->group_size,&(sm_module->fanout_node));
     if(OMPI_SUCCESS != ret) {
 	    fprintf(stderr,"Error setting up fanout tree \n");
       bcast_radix = cs->radix_read_tree;
 
        /* initialize fan-out read tree */
-       sm_module->fanout_read_tree=(mca_common_netpatterns_tree_node_t*) malloc(
-               sizeof(mca_common_netpatterns_tree_node_t)*module->group_size);
+       sm_module->fanout_read_tree=(netpatterns_tree_node_t*) malloc(
+               sizeof(netpatterns_tree_node_t)*module->group_size);
        if( NULL == sm_module->fanout_read_tree ) {
            goto Error;
        }
 
        for(i = 0; i < module->group_size; i++){
-          ret = mca_common_netpatterns_setup_narray_tree(bcast_radix,
+          ret = netpatterns_setup_narray_tree(bcast_radix,
                   i, module->group_size, &(sm_module->fanout_read_tree[i]));
           if(OMPI_SUCCESS != ret) {
               goto Error;
     */
 
     /* initialize reduction tree */
-    sm_module->reduction_tree=(mca_common_netpatterns_tree_node_t *) malloc(
-            sizeof(mca_common_netpatterns_tree_node_t )*module->group_size);
+    sm_module->reduction_tree=(netpatterns_tree_node_t *) malloc(
+            sizeof(netpatterns_tree_node_t )*module->group_size);
     if( NULL == sm_module->reduction_tree ) { 
         goto Error;
     }
         
-    ret=mca_common_netpatterns_setup_multinomial_tree(
+    ret=netpatterns_setup_multinomial_tree(
             cs->order_reduction_tree,module->group_size,
             sm_module->reduction_tree);
     if( MPI_SUCCESS != ret ) {
      */
     sm_module->scatter_kary_radix=cs->scatter_kary_radix;
     sm_module->scatter_kary_tree=NULL;
-    ret=mca_common_netpatterns_setup_narray_tree_contigous_ranks(
+    ret=netpatterns_setup_narray_tree_contigous_ranks(
             sm_module->scatter_kary_radix,
             sm_module->super.sbgp_partner_module->group_size,
             &(sm_module->scatter_kary_tree));

ompi/mca/bcol/basesmuma/bcol_basesmuma_rd_nb_barrier.c

 #include "ompi/mca/bcol/bcol.h"
 #include "bcol_basesmuma.h"
 #include "opal/sys/atomic.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
+#include "ompi/patterns/net/netpatterns.h"
 
 /*
  * Initialize nonblocking barrier.  This is code specific for handling
     int ret=OMPI_SUCCESS, idx, leading_dim, loop_cnt, exchange;
     int pair_rank;
     mca_bcol_basesmuma_ctl_struct_t **ctl_structs;
-    mca_common_netpatterns_pair_exchange_node_t *my_exchange_node;
+    netpatterns_pair_exchange_node_t *my_exchange_node;
     int extra_rank, my_rank, pow_2;
     mca_bcol_basesmuma_ctl_struct_t volatile *partner_ctl;
     mca_bcol_basesmuma_ctl_struct_t volatile *my_ctl;
     int ret=OMPI_SUCCESS, idx, leading_dim, loop_cnt, exchange;
     int pair_rank, start_index, restart_phase;
     mca_bcol_basesmuma_ctl_struct_t **ctl_structs;
-    mca_common_netpatterns_pair_exchange_node_t *my_exchange_node;
+    netpatterns_pair_exchange_node_t *my_exchange_node;
     int extra_rank, my_rank, pow_2;
     mca_bcol_basesmuma_ctl_struct_t volatile *partner_ctl;
     mca_bcol_basesmuma_ctl_struct_t volatile *my_ctl;

ompi/mca/bcol/basesmuma/bcol_basesmuma_rk_barrier.c

     int flag_offset = 0;
     volatile int8_t ready_flag;
     mca_bcol_basesmuma_module_t *bcol_module = (mca_bcol_basesmuma_module_t *) const_args->bcol_module;
-    mca_common_netpatterns_k_exchange_node_t *exchange_node = &bcol_module->knomial_allgather_tree;
+    netpatterns_k_exchange_node_t *exchange_node = &bcol_module->knomial_allgather_tree;
     mca_bcol_basesmuma_component_t *cm = &mca_bcol_basesmuma_component;
     uint32_t buffer_index = input_args->buffer_index;
     int *active_requests =
     int flag_offset;
     volatile int8_t ready_flag;
     mca_bcol_basesmuma_module_t *bcol_module = (mca_bcol_basesmuma_module_t *) const_args->bcol_module;
-    mca_common_netpatterns_k_exchange_node_t *exchange_node = &bcol_module->knomial_allgather_tree;
+    netpatterns_k_exchange_node_t *exchange_node = &bcol_module->knomial_allgather_tree;
     mca_bcol_basesmuma_component_t *cm = &mca_bcol_basesmuma_component;
     uint32_t buffer_index = input_args->buffer_index;
     int *active_requests =

ompi/mca/bcol/basesmuma/bcol_basesmuma_setup.c

 #include "ompi/mca/mpool/base/base.h"
 #include "ompi/mca/bcol/bcol.h"
 #include "ompi/mca/bcol/base/base.h"
-#include "ompi/mca/common/commpatterns/common_coll_ops.h"
+#include "ompi/patterns/comm/coll_ops.h"
 
 #include "opal/class/opal_object.h"
 #include "opal/dss/dss.h"

ompi/mca/bcol/basesmuma/bcol_basesmuma_smcm.c

 #include <errno.h>
 
 #include "ompi/proc/proc.h"
-#include "ompi/mca/common/commpatterns/common_coll_ops.h"
+#include "ompi/patterns/comm/coll_ops.h"
 
 #include "opal/dss/dss.h"
 #include "opal/util/error.h"

ompi/mca/bcol/bcol.h

 #include "ompi/datatype/ompi_datatype.h"
 #include "ompi/op/op.h"
 #include "ompi/include/ompi/constants.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns_knomial_tree.h"
+#include "ompi/patterns/net/netpatterns_knomial_tree.h"
 
 #include <limits.h>
 

ompi/mca/bcol/iboffload/bcol_iboffload.h

     opal_list_t collfrag_pending;
 
     /* recursive-doubling tree node */
-    mca_common_netpatterns_pair_exchange_node_t recursive_doubling_tree;
+    netpatterns_pair_exchange_node_t recursive_doubling_tree;
 
     /* N exchange tree */
-    mca_common_netpatterns_pair_exchange_node_t n_exchange_tree;
+    netpatterns_pair_exchange_node_t n_exchange_tree;
 
     /* Knomial exchange tree */
-    mca_common_netpatterns_k_exchange_node_t knomial_exchange_tree;
+    netpatterns_k_exchange_node_t knomial_exchange_tree;
 
     /* Knomial exchange tree */
-    mca_common_netpatterns_k_exchange_node_t knomial_allgather_tree;
+    netpatterns_k_exchange_node_t knomial_allgather_tree;
 
     /* The array will keep pre-calculated task consumption per
      * algorithm

ompi/mca/bcol/iboffload/bcol_iboffload_barrier.c

     mca_bcol_iboffload_frag_t *send_fragment = NULL,
                               *preposted_recv_frag = NULL;
 
-    mca_common_netpatterns_pair_exchange_node_t *my_exchange_node =
+    netpatterns_pair_exchange_node_t *my_exchange_node =
                                           &iboffload->recursive_doubling_tree;
 
     IBOFFLOAD_VERBOSE(10, ("Calling for mca_bcol_iboffload_barrier_intra_recursive_doubling.\n"));
 /* Recursive K - ing*/
 static int recursive_knomial_start_connections(struct mca_bcol_iboffload_module_t *iboffload)
 {
-    mca_common_netpatterns_k_exchange_node_t *my_exchange_node =
+    netpatterns_k_exchange_node_t *my_exchange_node =
         &iboffload->knomial_exchange_tree;
     int k, i, n_exchanges = my_exchange_node->n_exchanges,
         **exchanges = my_exchange_node->rank_exchanges,
     mca_bcol_iboffload_frag_t *send_fragment = NULL,
                               *preposted_recv_frag = NULL;
 
-    mca_common_netpatterns_k_exchange_node_t *my_exchange_node =
+    netpatterns_k_exchange_node_t *my_exchange_node =
         &iboffload->knomial_exchange_tree;
     IBOFFLOAD_VERBOSE(10, ("Calling for mca_bcol_iboffload_barrier_intra_recursive_knomial. Node type %d\n", my_exchange_node->node_type));
 
 
 int mca_bcol_iboffload_rec_doubling_start_connections(mca_bcol_iboffload_module_t *iboffload)
 {
-    mca_common_netpatterns_pair_exchange_node_t *my_exchange_node =
+    netpatterns_pair_exchange_node_t *my_exchange_node =
                                           &iboffload->recursive_doubling_tree;
 
     int i, n_exchanges = my_exchange_node->n_exchanges,

ompi/mca/bcol/iboffload/bcol_iboffload_bcast.c

 static int mca_bcol_iboffload_small_msg_bcast_exec(mca_bcol_iboffload_module_t *iboffload_module,
                                                    mca_bcol_iboffload_collreq_t *coll_request)
 {
-    mca_common_netpatterns_pair_exchange_node_t *recursive_doubling_tree =
+    netpatterns_pair_exchange_node_t *recursive_doubling_tree =
         &iboffload_module->recursive_doubling_tree;
 
     int rc,
 static int mca_bcol_iboffload_small_msg_bcast_extra_exec(mca_bcol_iboffload_module_t *iboffload_module,
                                                    mca_bcol_iboffload_collreq_t *coll_request)
 {
-    mca_common_netpatterns_pair_exchange_node_t *recursive_doubling_tree =
+    netpatterns_pair_exchange_node_t *recursive_doubling_tree =
         &iboffload_module->recursive_doubling_tree;
 
     int rc,
 static int mca_bcol_iboffload_bcast_scatter_allgather_exec(mca_bcol_iboffload_module_t *iboffload_module,
         mca_bcol_iboffload_collreq_t *coll_request)
 {
-    mca_common_netpatterns_pair_exchange_node_t *recursive_doubling_tree =
+    netpatterns_pair_exchange_node_t *recursive_doubling_tree =
         &iboffload_module->recursive_doubling_tree;
 
     int rc,
 static int mca_bcol_iboffload_bcast_scatter_allgather_extra_exec(mca_bcol_iboffload_module_t *iboffload_module,
         mca_bcol_iboffload_collreq_t *coll_request)
 {
-    mca_common_netpatterns_pair_exchange_node_t *recursive_doubling_tree =
+    netpatterns_pair_exchange_node_t *recursive_doubling_tree =
         &iboffload_module->recursive_doubling_tree;
 
     int rc, dst;

ompi/mca/bcol/iboffload/bcol_iboffload_bcast.h

 
 static inline void bcol_iboffload_setup_binomial_connection(mca_bcol_iboffload_module_t *iboffload)
 {
-    mca_common_netpatterns_pair_exchange_node_t *my_exchange_node =
+    netpatterns_pair_exchange_node_t *my_exchange_node =
                                           &iboffload->recursive_doubling_tree;
 
     int i, n_exchanges = my_exchange_node->n_exchanges,

ompi/mca/bcol/iboffload/bcol_iboffload_module.c

         free(module->endpoints);
     }
 
-    mca_common_netpatterns_free_recursive_doubling_tree_node(&module->n_exchange_tree);
-    mca_common_netpatterns_free_recursive_doubling_tree_node(&module->recursive_doubling_tree);
+    netpatterns_free_recursive_doubling_tree_node(&module->n_exchange_tree);
+    netpatterns_free_recursive_doubling_tree_node(&module->recursive_doubling_tree);
 
     OBJ_RELEASE(module->device->net_context);
     OBJ_RELEASE(module->device);
 {
     int rc;
     mca_bcol_iboffload_module_t *ib_module = (mca_bcol_iboffload_module_t *) super;
-    rc = mca_common_netpatterns_setup_recursive_knomial_allgather_tree_node(
+    rc = netpatterns_setup_recursive_knomial_allgather_tree_node(
             ib_module->super.sbgp_partner_module->group_size,
             ib_module->super.sbgp_partner_module->my_index,
             mca_bcol_iboffload_component.k_nomial_radix,
         /* Barrier initialization - recuresive doubling */
 #if 1
         if (OMPI_SUCCESS !=
-                    mca_common_netpatterns_setup_recursive_doubling_tree_node(
+                    netpatterns_setup_recursive_doubling_tree_node(
                                 iboffload_module->group_size, my_rank,
                                 &iboffload_module->recursive_doubling_tree)) {
             IBOFFLOAD_ERROR(("Failed to setup recursive doubling tree,"
 
         /* Barrier initialization - N exchange tree */
         if (OMPI_SUCCESS !=
-                mca_common_netpatterns_setup_recursive_doubling_n_tree_node(
+                netpatterns_setup_recursive_doubling_n_tree_node(
                                 iboffload_module->group_size, my_rank,
                                 cm->exchange_tree_order,
                                 &iboffload_module->n_exchange_tree)) {
 
         /* Recursive K-ing initialization - Knomial exchange tree */
         if (OMPI_SUCCESS !=
-                mca_common_netpatterns_setup_recursive_knomial_tree_node(
+                netpatterns_setup_recursive_knomial_tree_node(
                                 iboffload_module->group_size, my_rank,
                                 cm->knomial_tree_order,
                                 &iboffload_module->knomial_exchange_tree)) {
         }
         /* that should take care of that */
         if (OMPI_SUCCESS !=
-                mca_common_netpatterns_setup_recursive_knomial_allgather_tree_node(
+                netpatterns_setup_recursive_knomial_allgather_tree_node(
                                 iboffload_module->group_size, sbgp->group_list[my_rank],
                                 cm->k_nomial_radix, iboffload_module->super.list_n_connected,
                                 &iboffload_module->knomial_allgather_tree)) {

ompi/mca/bcol/ptpcoll/Makefile.am

 mcacomponent_LTLIBRARIES = $(component_install)
 mca_bcol_ptpcoll_la_SOURCES = $(sources)
 mca_bcol_ptpcoll_la_LDFLAGS = -module -avoid-version
-mca_bcol_ptpcoll_la_LIBADD = \
-                             $(top_ompi_builddir)/ompi/mca/common/netpatterns/libmca_common_netpatterns.la
+mca_bcol_ptpcoll_la_LIBADD = 
 
 noinst_LTLIBRARIES = $(component_noinst)
 libmca_bcol_ptpcoll_la_SOURCES =$(sources)

ompi/mca/bcol/ptpcoll/bcol_ptpcoll.h

 #include "ompi/request/request.h"
 #include "ompi/mca/pml/pml.h"
 #include "ompi/mca/coll/ml/coll_ml_allocation.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
+#include "ompi/patterns/net/netpatterns.h"
 
 BEGIN_C_DECLS
 
     int full_narray_tree_num_leafs;
 
     /* Nary tree info */
-    mca_common_netpatterns_tree_node_t *narray_node;
+    netpatterns_tree_node_t *narray_node;
 
     /* if the rank in group, it keeps the extra peer. 
        if the rank is extra, it keeps the proxy peer.
     /* number of extra peers , maximum k - 1*/
     int narray_knomial_proxy_num; 
     /* Narray-Knomial node information array */
-    mca_common_netpatterns_narray_knomial_tree_node_t *narray_knomial_node;
+    netpatterns_narray_knomial_tree_node_t *narray_knomial_node;
     /* Knomial exchange tree */ 
-    mca_common_netpatterns_k_exchange_node_t knomial_exchange_tree;
+    netpatterns_k_exchange_node_t knomial_exchange_tree;
     /* knomial allgather tree --- Do not disable, we need both 
        different algorithms define recursive k - ing differently
      */
-    mca_common_netpatterns_k_exchange_node_t knomial_allgather_tree;
+    netpatterns_k_exchange_node_t knomial_allgather_tree;
 
 	/* Knomial allgather offsets */
 	int **allgather_offsets;

ompi/mca/bcol/ptpcoll/bcol_ptpcoll_barrier.c

     mca_bcol_ptpcoll_module_t *ptpcoll_module =
                         (mca_bcol_ptpcoll_module_t *) const_args->bcol_module;
 
-    mca_common_netpatterns_k_exchange_node_t *my_exchange_node =
+    netpatterns_k_exchange_node_t *my_exchange_node =
                                        &ptpcoll_module->knomial_exchange_tree;
 
     int rc, k, pair_comm_rank, exchange, completed,
     mca_bcol_ptpcoll_module_t *ptpcoll_module =
                         (mca_bcol_ptpcoll_module_t *) const_args->bcol_module;
 
-    mca_common_netpatterns_k_exchange_node_t *my_exchange_node =
+    netpatterns_k_exchange_node_t *my_exchange_node =
                                        &ptpcoll_module->knomial_exchange_tree;
 
     int rc, k, tag, pair_comm_rank, exchange,
     mca_bcol_ptpcoll_module_t *ptpcoll_module =
                     (mca_bcol_ptpcoll_module_t *) const_args->bcol_module;
 
-    mca_common_netpatterns_k_exchange_node_t *my_exchange_node =
+    netpatterns_k_exchange_node_t *my_exchange_node =
                                    &ptpcoll_module->knomial_exchange_tree;
 
     ompi_communicator_t *comm =
 
 static int mca_bcol_ptpcoll_barrier_setup(mca_bcol_base_module_t *super, int bcoll_type)
 {
-    mca_common_netpatterns_k_exchange_node_t *my_exchange_node;
+    netpatterns_k_exchange_node_t *my_exchange_node;
     mca_bcol_ptpcoll_module_t * ptpcoll_module =
                            (mca_bcol_ptpcoll_module_t *) super;
 

ompi/mca/bcol/ptpcoll/bcol_ptpcoll_bcast.c

     int count = input_args->count * input_args->dtype->super.size;
     int *active_requests =
         &(ptpcoll_module->ml_mem.ml_buf_desc[buffer_index].active_requests);
-    mca_common_netpatter_knomial_step_info_t step_info = {0, 0, 0};
+    netpatterns_knomial_step_info_t step_info = {0, 0, 0};
 
     PTPCOLL_VERBOSE(3, ("BCAST Anyroot, index_this_type %d, num_of_this_type %d",
                     const_args->index_of_this_type_in_collective + 1,
         /* No data was received. Waiting for data */
         if (0 == (*active_requests)) {
             int extra_root = -1;
-            mca_common_netpatter_knomial_step_info_t step_info;
+            netpatterns_knomial_step_info_t step_info;
             /* We can not block. So run couple of test for data arrival */
             if (0 == mca_bcol_ptpcoll_test_for_match(recv_request, &rc)) {
                 PTPCOLL_VERBOSE(10, ("Test was not matched (active request %d)",
     int matched = 0;
     int k_level, logk_level;
     int extra_root = -1;
-    mca_common_netpatter_knomial_step_info_t step_info;
+    netpatterns_knomial_step_info_t step_info;
 
     PTPCOLL_VERBOSE(3, ("BCAST Know root, index_this_type %d, num_of_this_type %d",
                     const_args->index_of_this_type_in_collective + 1,
         }
     }
 
-    data_src = mca_common_netpatterns_get_knomial_data_source(
+    data_src = netpatterns_get_knomial_data_source(
                 my_group_index, group_root_index, radix, ptpcoll_module->pow_knum,
                 &k_level, &logk_level);
 
     int group_size = ptpcoll_module->full_narray_tree_size;
     int completed = 0;
     int virtual_root;
-    mca_common_netpatterns_narray_knomial_tree_node_t *narray_knomial_node = NULL;
-    mca_common_netpatterns_narray_knomial_tree_node_t *narray_node = NULL;
+    netpatterns_narray_knomial_tree_node_t *narray_knomial_node = NULL;
+    netpatterns_narray_knomial_tree_node_t *narray_node = NULL;
 
     PTPCOLL_VERBOSE(3, ("BCAST Anyroot, index_this_type %d, num_of_this_type %d",
                     const_args->index_of_this_type_in_collective + 1,
     int matched = true;
     int my_group_index = ptpcoll_module->super.sbgp_partner_module->my_index;
     int relative_group_index = 0;
-    mca_common_netpatterns_tree_node_t *narray_node = NULL;
+    netpatterns_tree_node_t *narray_node = NULL;
 
     PTPCOLL_VERBOSE(3, ("Bcast, Narray tree Progress"));
 
     int my_group_index = ptpcoll_module->super.sbgp_partner_module->my_index;
     int group_root_index;
     int relative_group_index = 0;
-    mca_common_netpatterns_tree_node_t *narray_node = NULL;
+    netpatterns_tree_node_t *narray_node = NULL;
 
     PTPCOLL_VERBOSE(3, ("Bcast, Narray tree"));
 

ompi/mca/bcol/ptpcoll/bcol_ptpcoll_bcast.h

     ompi_communicator_t* comm = ptpcoll_module->super.sbgp_partner_module->group_comm;
     ompi_request_t **requests = 
         ptpcoll_module->ml_mem.ml_buf_desc[buffer_index].requests;
-    mca_common_netpatterns_narray_knomial_tree_node_t *narray_node =
+    netpatterns_narray_knomial_tree_node_t *narray_node =
         &ptpcoll_module->narray_knomial_node[relative_group_index];
-    mca_common_netpatterns_k_exchange_node_t *k_node =
+    netpatterns_k_exchange_node_t *k_node =
         &narray_node->k_node;
     mca_bcol_ptpcoll_component_t *cm =
         &mca_bcol_ptpcoll_component;

ompi/mca/bcol/ptpcoll/bcol_ptpcoll_module.c

 {
    mca_bcol_ptpcoll_module_t *p2p_module = (mca_bcol_ptpcoll_module_t *) super;
    int rc = 0; 
-   rc = mca_common_netpatterns_setup_recursive_knomial_allgather_tree_node(
+   rc = netpatterns_setup_recursive_knomial_allgather_tree_node(
                 p2p_module->super.sbgp_partner_module->group_size,
                 p2p_module->super.sbgp_partner_module->my_index,
                 mca_bcol_ptpcoll_component.k_nomial_radix,
 
     ptpcoll_module->narray_knomial_node = calloc(
             ptpcoll_module->full_narray_tree_size,
-            sizeof(mca_common_netpatterns_narray_knomial_tree_node_t));
+            sizeof(netpatterns_narray_knomial_tree_node_t));
     if(NULL == ptpcoll_module->narray_knomial_node) {
         goto Error;
     }
         }
         /* Setting node info */
         for(i = 0; i < ptpcoll_module->full_narray_tree_size; i++) {
-            rc = mca_common_netpatterns_setup_narray_knomial_tree(
+            rc = netpatterns_setup_narray_knomial_tree(
                     cm->narray_knomial_radix,
                     i,
                     ptpcoll_module->full_narray_tree_size,
     mca_bcol_ptpcoll_component_t *cm = &mca_bcol_ptpcoll_component;
 
     ptpcoll_module->narray_node = calloc(ptpcoll_module->group_size,
-            sizeof(mca_common_netpatterns_tree_node_t));
+            sizeof(netpatterns_tree_node_t));
     if(NULL == ptpcoll_module->narray_node ) {
         goto Error;
     }
 
     for(i = 0; i < ptpcoll_module->group_size; i++) {
-        rc = mca_common_netpatterns_setup_narray_tree(
+        rc = netpatterns_setup_narray_tree(
                 cm->narray_radix,
                 i,
                 ptpcoll_module->group_size,
 static int load_recursive_knomial_info(mca_bcol_ptpcoll_module_t *ptpcoll_module)
 {
     int rc = OMPI_SUCCESS;
-    rc = mca_common_netpatterns_setup_recursive_knomial_tree_node(
+    rc = netpatterns_setup_recursive_knomial_tree_node(
                     ptpcoll_module->group_size,
                     ptpcoll_module->super.sbgp_partner_module->my_index,
                     mca_bcol_ptpcoll_component.k_nomial_radix,

ompi/mca/coll/ml/Makefile.am

 mcacomponent_LTLIBRARIES = $(component_install)
 mca_coll_ml_la_SOURCES = $(sources)
 mca_coll_ml_la_LDFLAGS = -module -avoid-version
-mca_coll_ml_la_LIBADD = \
-    $(top_ompi_builddir)/ompi/mca/common/commpatterns/libmca_common_commpatterns.la \
-    $(top_ompi_builddir)/ompi/mca/common/netpatterns/libmca_common_netpatterns.la
+mca_coll_ml_la_LIBADD =
 
 
 noinst_LTLIBRARIES = $(component_noinst)
 libmca_coll_ml_la_SOURCES =$(sources)
 libmca_coll_ml_la_LDFLAGS = -module -avoid-version
-
-$(top_ompi_builddir)/ompi/mca/common/commpatterns/libmca_common_commpatterns.la: foo.c
-	cd $(top_ompi_builddir)/ompi/mca/common/commpatterns && $(MAKE)
-$(top_ompi_builddir)/ompi/mca/common/netpatterns/libmca_common_netpatterns.la: foo.c
-	cd $(top_ompi_builddir)/ompi/mca/common/netpatterns && $(MAKE)
-
-foo.c:

ompi/mca/coll/ml/coll_ml_component.c

 #include "coll_ml.h"
 #include "coll_ml_inlines.h"
 
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
+#include "ompi/patterns/net/netpatterns.h"
 #include "coll_ml_mca.h"
 #include "coll_ml_custom_utils.h"
 
     OBJ_CONSTRUCT(&(cs->sequential_collectives_mutex), opal_mutex_t);
     OBJ_CONSTRUCT(&(cs->sequential_collectives), opal_list_t);
 
-    rc = ompi_common_netpatterns_init();
+    rc = netpatterns_init();
     if (OMPI_SUCCESS != rc) {
         return rc;
     }

ompi/mca/coll/ml/coll_ml_custom_utils.c

 #include "ompi/mca/coll/base/base.h"
 #include "ompi/mca/coll/ml/coll_ml.h"
 #include "ompi/mca/coll/ml/coll_ml_inlines.h"
-#include "ompi/mca/common/commpatterns/common_coll_ops.h"
+#include "ompi/patterns/comm/coll_ops.h"
 
 #include "ompi/datatype/ompi_datatype.h"
 #include "ompi/communicator/communicator.h"

ompi/mca/coll/ml/coll_ml_mca.c

 #include "coll_ml_inlines.h"
 #include "coll_ml_mca.h"
 #include "coll_ml_lmngr.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
+#include "ompi/patterns/net/netpatterns.h"
 #include "opal/mca/installdirs/installdirs.h"
 
 /*

ompi/mca/coll/ml/coll_ml_module.c

 #include "ompi/mca/sbgp/base/base.h"
 #include "ompi/mca/bcol/base/base.h"
 #include "ompi/mca/sbgp/sbgp.h"
-#include "ompi/mca/common/commpatterns/common_coll_ops.h"
+#include "ompi/patterns/comm/coll_ops.h"
 #include "ompi/mca/coll/ml/coll_ml.h"
 
 #include "opal/util/argv.h"
Add a comment to this file

ompi/mca/common/commpatterns/.windows

Empty file removed.

ompi/mca/common/commpatterns/Makefile.am

-#
-# Copyright (c) 2009-2012 Mellanox Technologies.  All rights reserved.
-# Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-# A word of explanation...
-#
-# This library is linked against various MCA components because all
-# shared-memory based components (e.g., mpool, ptl, etc.)  need to
-# share some common code and data.  There's two cases:
-#
-# 1. libmca_common_commpatterns.la is a shared library.  By linking that shared
-# library to all components that need it, the OS linker will
-# automatically load it into the process as necessary, and there will
-# only be one copy (i.e., all the components will share *one* copy of
-# the code and data).
-#
-# 2. libmca_common_commpatterns.la is a static library.  In this case, it will
-# be rolled up into the top-level libmpi.la.  It will also be rolled
-# into each component, but then the component will also be rolled up
-# into the upper-level libmpi.la.  Linkers universally know how to
-# "figure this out" so that we end up with only one copy of the code
-# and data.
-#
-# Note that building this common component statically and linking
-# against other dynamic components is *not* supported!
-
-EXTRA_DIST = .windows
-
-# Header files
-
-headers = \
-        common_coll_ops.h \
-        common_netpatterns.h \
-        ompi_common_netpatterns_macros.h
-
-# Source files
-
-sources = \
-        common_allreduce.c \
-        common_allgather.c \
-        common_bcast.c
-
-# As per above, we'll either have an installable or noinst result.
-# The installable one should follow the same MCA prefix naming rules
-# (i.e., libmca_<type>_<name>.la).  The noinst one can be named
-# whatever it wants, although libmca_<type>_<name>_noinst.la is
-# recommended.
-
-# To simplify components that link to this library, we will *always*
-# have an output libtool library named libmca_<type>_<name>.la -- even
-# for case 2) described above (i.e., so there's no conditional logic
-# necessary in component Makefile.am's that link to this library).
-# Hence, if we're creating a noinst version of this library (i.e.,
-# case 2), we sym link it to the libmca_<type>_<name>.la name
-# (libtool will do the Right Things under the covers).  See the
-# all-local and clean-local rules, below, for how this is effected.
-
-lib_LTLIBRARIES =
-noinst_LTLIBRARIES =
-comp_inst = libmca_common_commpatterns.la
-comp_noinst = libmca_common_commpatterns_noinst.la
-
-if MCA_BUILD_ompi_common_commpatterns_DSO
-lib_LTLIBRARIES += $(comp_inst)
-else
-noinst_LTLIBRARIES += $(comp_noinst)
-endif
-
-libmca_common_commpatterns_la_SOURCES = $(headers) $(sources)
-libmca_common_commpatterns_noinst_la_SOURCES = $(libmca_common_commpatterns_la_SOURCES)
-libmca_common_commpatterns_la_LIBADD = \
-		$(top_ompi_builddir)/ompi/mca/common/netpatterns/libmca_common_netpatterns.la
-
-# These two rules will sym link the "noinst" libtool library filename
-# to the installable libtool library filename in the case where we are
-# compiling this component statically (case 2), described above).
-
-all-local:
-	if test -z "$(lib_LTLIBRARIES)"; then \
-	  rm -f "$(comp_inst)"; \
-	  $(LN_S) "$(comp_noinst)" "$(comp_inst)"; \
-	fi
-
-clean-local:
-	if test -z "$(lib_LTLIBRARIES)"; then \
-	  rm -f "$(comp_inst)"; \
-	fi
-# The code below guaranty that the netpatterns will be build before commpatterns
-FORCE:
-
-$(top_ompi_builddir)/ompi/mca/common/netpatterns/libmca_common_netpatterns.la: FORCE
-	(cd  $(top_ompi_builddir)/ompi/mca/common/netpatterns/ && $(MAKE) $(AM_MAKEFLAGS) libmca_common_netpatterns.la)
-
-install-libmca_common_netpatterns: FORCE
-	(cd  $(top_ompi_builddir)/ompi/mca/common/netpatterns/ && $(MAKE) $(AM_MAKEFLAGS) install)
-
-install: install-libmca_common_netpatterns install-am
-

ompi/mca/common/commpatterns/common_allgather.c

-/*
- * Copyright (c) 2009-2012 Mellanox Technologies.  All rights reserved.
- * Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
- * Copyright (c) 2012      Los Alamos National Security, LLC.
- *                         All rights reserved.
- * $COPYRIGHT$
- * 
- * Additional copyrights may follow
- * 
- * $HEADER$
- */
-/** @file */
-
-#include "ompi_config.h"
-
-#include "ompi/constants.h"
-#include "ompi/op/op.h"
-#include "ompi/datatype/ompi_datatype.h"
-#include "ompi/communicator/communicator.h"
-#include "opal/include/opal/sys/atomic.h"
-#include "common_coll_ops.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
-#include "ompi/mca/pml/pml.h"
-
-/**
- * All-reduce - subgroup in communicator
- */
-OMPI_DECLSPEC int comm_allgather_pml(void *src_buf, void *dest_buf, int count,
-        ompi_datatype_t *dtype, int my_rank_in_group,
-        int n_peers, int *ranks_in_comm,ompi_communicator_t *comm)
-{
-    /* local variables */
-    int rc=OMPI_SUCCESS,msg_cnt;
-    int pair_rank,exchange,extra_rank, n_extra_nodes,n_extra;
-    int proc_block,extra_start,extra_end,iovec_len;
-    int remote_data_start_rank,remote_data_end_rank;
-    int local_data_start_rank;
-    mca_common_netpatterns_pair_exchange_node_t my_exchange_node;
-    size_t message_extent,current_data_extent,current_data_count;
-    size_t dt_size;
-    OPAL_PTRDIFF_TYPE dt_extent;
-    char *src_buf_current;
-    char *dest_buf_current;
-    struct iovec send_iov[2] = {{0,0},{0,0}}, 
-                 recv_iov[2] = {{0,0},{0,0}};
-    ompi_request_t *requests[4];
-
-    /* get size of data needed - same layout as user data, so that
-     *   we can apply the reudction routines directly on these buffers
-     */
-    rc = ompi_datatype_type_size(dtype, &dt_size);
-    if( OMPI_SUCCESS != rc ) {
-        goto Error;
-    }
-
-    rc = ompi_datatype_type_extent(dtype, &dt_extent);
-    if( OMPI_SUCCESS != rc ) {
-        goto Error;
-    }
-    message_extent = dt_extent*count;
-
-    /* place my data in the correct destination buffer */
-    rc=ompi_datatype_copy_content_same_ddt(dtype,count,
-            (char *)dest_buf+my_rank_in_group*message_extent,
-            (char *)src_buf);
-    if( OMPI_SUCCESS != rc ) {
-        goto Error;
-    }
-
-    /* 1 process special case */
-    if(1 == n_peers) {
-        return OMPI_SUCCESS;
-    }
-
-    /* get my reduction communication pattern */
-    rc = mca_common_netpatterns_setup_recursive_doubling_tree_node(n_peers, 
-            my_rank_in_group, &my_exchange_node);
-    if(OMPI_SUCCESS != rc){
-        return rc;
-    }
-
-    n_extra_nodes=n_peers-my_exchange_node.n_largest_pow_2;
-
-    /* get the data from the extra sources */
-    if(0 < my_exchange_node.n_extra_sources)  {
-
-        if ( EXCHANGE_NODE == my_exchange_node.node_type ) {
-
-            /*
-             ** Receive data from extra node
-             */
-
-            extra_rank=my_exchange_node.rank_extra_source;
-            /* receive the data into the correct location - will use 2
-             * messages in the recursive doubling phase */
-            dest_buf_current=(char *)dest_buf+message_extent*extra_rank;
-            rc=MCA_PML_CALL(recv(dest_buf_current,
-                    count,dtype,ranks_in_comm[extra_rank],
-                    -OMPI_COMMON_TAG_ALLREDUCE,
-                    comm, MPI_STATUSES_IGNORE));
-            if( 0 > rc ) {
-                goto  Error;
-            }
-
-        } else {
-
-            /*
-             ** Send data to "partner" node
-             */
-            extra_rank=my_exchange_node.rank_extra_source;
-            src_buf_current=(char *)src_buf;
-            rc=MCA_PML_CALL(send(src_buf_current,
-                    count,dtype,ranks_in_comm[extra_rank],
-                    -OMPI_COMMON_TAG_ALLREDUCE,
-                    MCA_PML_BASE_SEND_STANDARD,
-                    comm));
-            if( 0 > rc ) {
-                goto  Error;
-            }
-        }
-    }
-
-    current_data_extent=message_extent;
-    current_data_count=count;
-    src_buf_current=(char *)dest_buf+my_rank_in_group*message_extent;
-    proc_block=1;
-    local_data_start_rank=my_rank_in_group;
-    /* loop over data exchanges */
-    for(exchange=0 ; exchange < my_exchange_node.n_exchanges ; exchange++) {
-
-        /* is the remote data read */
-        pair_rank=my_exchange_node.rank_exchanges[exchange];
-        msg_cnt=0;
-
-        /*
-         * Power of 2 data segment 
-         */
-        /* post non-blocking receive */
-        if(pair_rank > my_rank_in_group ){
-            recv_iov[0].iov_base=src_buf_current+current_data_extent;
-            recv_iov[0].iov_len=current_data_extent;
-            iovec_len=1;
-            remote_data_start_rank=local_data_start_rank+proc_block;
-            remote_data_end_rank=remote_data_start_rank+proc_block-1;
-        } else {
-            recv_iov[0].iov_base=src_buf_current-current_data_extent;
-            recv_iov[0].iov_len=current_data_extent;
-            iovec_len=1;
-            remote_data_start_rank=local_data_start_rank-proc_block;
-            remote_data_end_rank=remote_data_start_rank+proc_block-1;
-        }
-        /* the data from the non power of 2 ranks */
-        if(remote_data_start_rank<n_extra_nodes) {
-            /* figure out how much data is at the remote rank */
-            /* last rank with data */
-            extra_start=remote_data_start_rank;
-            extra_end=remote_data_end_rank;
-            if(extra_end >= n_extra_nodes ) {
-                /* if last rank exceeds the ranks with extra data,
-                 * adjust this.
-                 */
-                extra_end=n_extra_nodes-1;
-            }
-            /* get the number of ranks whos data is to be grabbed */
-            n_extra=extra_end-extra_start+1;
-
-            recv_iov[1].iov_base=(char *)dest_buf+
-                (extra_start+my_exchange_node.n_largest_pow_2)*message_extent;
-            recv_iov[1].iov_len=n_extra*count;
-            iovec_len=2;
-        }
-
-        rc=MCA_PML_CALL(irecv(recv_iov[0].iov_base,
-                    current_data_count,dtype,ranks_in_comm[pair_rank],
-                    -OMPI_COMMON_TAG_ALLREDUCE,
-                    comm,&(requests[msg_cnt])));
-        if( 0 > rc ) {
-            goto Error;
-        }
-        msg_cnt++;
-
-        if(iovec_len > 1 ) {
-            rc=MCA_PML_CALL(irecv(recv_iov[1].iov_base,
-                        recv_iov[1].iov_len,dtype,ranks_in_comm[pair_rank],
-                        -OMPI_COMMON_TAG_ALLREDUCE,
-                        comm,&(requests[msg_cnt])));
-            if( 0 > rc ) {
-                goto Error;
-            }
-            msg_cnt++;
-        }
-
-        /* post non-blocking send */
-        send_iov[0].iov_base=src_buf_current;
-        send_iov[0].iov_len=current_data_extent;
-        iovec_len=1;
-        /* the data from the non power of 2 ranks */
-        if(local_data_start_rank<n_extra_nodes) {
-            /* figure out how much data is at the remote rank */
-            /* last rank with data */
-            extra_start=local_data_start_rank;
-            extra_end=extra_start+proc_block-1;
-            if(extra_end >= n_extra_nodes ) {
-                /* if last rank exceeds the ranks with extra data,
-                 * adjust this.
-                 */
-                extra_end=n_extra_nodes-1;
-            }
-            /* get the number of ranks whos data is to be grabbed */
-            n_extra=extra_end-extra_start+1;
-
-            send_iov[1].iov_base=(char *)dest_buf+
-                (extra_start+my_exchange_node.n_largest_pow_2)*message_extent;
-            send_iov[1].iov_len=n_extra*count;
-            iovec_len=2;
-        }
-
-        rc=MCA_PML_CALL(isend(send_iov[0].iov_base,
-                    current_data_count,dtype,ranks_in_comm[pair_rank],
-                    -OMPI_COMMON_TAG_ALLREDUCE,MCA_PML_BASE_SEND_STANDARD,
-                    comm,&(requests[msg_cnt])));
-        if( 0 > rc ) {
-            goto Error;
-        }
-        msg_cnt++;
-        if( iovec_len > 1 ) { 
-            rc=MCA_PML_CALL(isend(send_iov[1].iov_base,
-                        send_iov[1].iov_len,dtype,ranks_in_comm[pair_rank],
-                        -OMPI_COMMON_TAG_ALLREDUCE,MCA_PML_BASE_SEND_STANDARD,
-                        comm,&(requests[msg_cnt])));
-            if( 0 > rc ) {
-                goto Error;
-            }
-            msg_cnt++;
-        }
-
-        /* prepare the source buffer for the next iteration */
-        if(pair_rank < my_rank_in_group ){
-            src_buf_current-=current_data_extent;
-            local_data_start_rank-=proc_block;
-        } 
-        proc_block*=2;
-        current_data_extent*=2;
-        current_data_count*=2;
-
-        /* wait on send and receive completion */
-        ompi_request_wait_all(msg_cnt,requests,MPI_STATUSES_IGNORE);
-    }
-
-    /* copy data in from the "extra" source, if need be */
-    if(0 < my_exchange_node.n_extra_sources)  {
-
-        if ( EXTRA_NODE == my_exchange_node.node_type ) {
-            /* 
-             ** receive the data 
-             ** */
-            extra_rank=my_exchange_node.rank_extra_source;
-
-            rc=MCA_PML_CALL(recv(dest_buf,
-                    count*n_peers,dtype,ranks_in_comm[extra_rank],
-                    -OMPI_COMMON_TAG_ALLREDUCE,
-                    comm,MPI_STATUSES_IGNORE));
-            if(0 > rc ) {
-                goto  Error;
-            }
-        } else {
-            /* send the data to the pair-rank outside of the power of 2 set
-             ** of ranks
-             */
-
-            extra_rank=my_exchange_node.rank_extra_source;
-            rc=MCA_PML_CALL(send(dest_buf,
-                    count*n_peers,dtype,ranks_in_comm[extra_rank],
-                    -OMPI_COMMON_TAG_ALLREDUCE,
-                    MCA_PML_BASE_SEND_STANDARD,
-                    comm));
-            if( 0 > rc ) {
-                goto  Error;
-            }
-        }
-    }
-
-    /* return */
-    return OMPI_SUCCESS;
-
-Error:
-    return rc;
-}

ompi/mca/common/commpatterns/common_allreduce.c

-/*
- * Copyright (c) 2009-2012 Mellanox Technologies.  All rights reserved.
- * Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
- * Copyright (c) 2012      Los Alamos National Security, LLC.
- *                         All rights reserved.
- * $COPYRIGHT$
- * 
- * Additional copyrights may follow
- * 
- * $HEADER$
- */
-/** @file */
-
-#include "ompi_config.h"
-
-#include "ompi/constants.h"
-#include "ompi/op/op.h"
-#include "ompi/datatype/ompi_datatype.h"
-#include "ompi/communicator/communicator.h"
-#include "opal/include/opal/sys/atomic.h"
-#include "ompi/mca/common/commpatterns/common_netpatterns.h"
-#include "common_coll_ops.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
-#include "ompi/mca/pml/pml.h"
-
-/**
- * All-reduce for contigous primitive types
- */
-OMPI_DECLSPEC int comm_allreduce_pml(void *sbuf, void *rbuf, int count, 
-        ompi_datatype_t *dtype, int my_rank_in_group,
-        struct ompi_op_t *op, int n_peers,int *ranks_in_comm, 
-        ompi_communicator_t *comm)
-{
-    /* local variables */
-    int rc=OMPI_SUCCESS,n_dts_per_buffer,n_data_segments,stripe_number;
-    int pair_rank,exchange,extra_rank;
-    mca_common_netpatterns_pair_exchange_node_t my_exchange_node;
-    int count_processed,count_this_stripe;
-    size_t dt_size,dt_extent;
-    char scratch_bufers[2][MAX_TMP_BUFFER];
-    int send_buffer=0,recv_buffer=1;
-    char *sbuf_current, *rbuf_current;
-    ompi_request_t *requests[2];
-
-    /* get size of data needed - same layout as user data, so that
-     *   we can apply the reudction routines directly on these buffers
-     */
-    rc = opal_datatype_type_size((opal_datatype_t *)dtype, &dt_size);
-    if( OMPI_SUCCESS != rc ) {
-        goto Error;
-    }
-    rc = ompi_datatype_type_extent(dtype, (OPAL_PTRDIFF_TYPE *)&dt_extent);
-    if( OMPI_SUCCESS != rc ) {
-        goto Error;
-    }
-    
-    /* 1 process special case */
-    if(1 == n_peers) {
-        /* place my data in the correct destination buffer */
-        rc=ompi_datatype_copy_content_same_ddt(dtype,count,
-                (char *)rbuf, (char *)sbuf);
-        if( OMPI_SUCCESS != rc ) {
-            goto Error;
-        }
-        return OMPI_SUCCESS;
-    }
-
-    /* number of data types copies that the scratch buffer can hold */
-    n_dts_per_buffer=((int) MAX_TMP_BUFFER)/dt_extent;
-    if ( 0 == n_dts_per_buffer ) {
-        rc=OMPI_ERROR;
-        goto Error;
-    }
-
-    /* compute number of stripes needed to process this collective */
-    n_data_segments=(count+n_dts_per_buffer -1 ) / n_dts_per_buffer ;
-
-    /* get my reduction communication pattern */
-    rc = mca_common_netpatterns_setup_recursive_doubling_tree_node(n_peers,
-            my_rank_in_group, &my_exchange_node);
-    if(OMPI_SUCCESS != rc){
-        return rc;
-    }
-
-    count_processed=0;
-
-    /* get a pointer to the shared-memory working buffer */
-    /* NOTE: starting with a rather synchronous approach */
-    for( stripe_number=0 ; stripe_number < n_data_segments ; stripe_number++ ) {
-
-        /* get number of elements to process in this stripe */
-        count_this_stripe=n_dts_per_buffer;
-        if( count_processed + count_this_stripe > count )
-            count_this_stripe=count-count_processed;
-
-        /* copy data from the input buffer into the temp buffer */
-        sbuf_current=(char *)sbuf+count_processed*dt_extent;
-        rc=ompi_datatype_copy_content_same_ddt(dtype,count_this_stripe,
-                scratch_bufers[send_buffer], sbuf_current);
-        if( OMPI_SUCCESS != rc ) {
-            goto Error;
-        }
-
-        /* copy data in from the "extra" source, if need be */
-        if(0 < my_exchange_node.n_extra_sources)  {
-
-            if ( EXCHANGE_NODE == my_exchange_node.node_type ) {
-                
-                /*
-                ** Receive data from extra node
-                */
-                extra_rank=my_exchange_node.rank_extra_source;
-                rc=MCA_PML_CALL(recv(scratch_bufers[recv_buffer],
-                            count_this_stripe,dtype,ranks_in_comm[extra_rank],
-                            -OMPI_COMMON_TAG_ALLREDUCE, comm,
-                            MPI_STATUSES_IGNORE));
-                if( 0 > rc ) {
-                    fprintf(stderr,"  first recv failed in comm_allreduce_pml \n");
-                    fflush(stderr);
-                    goto  Error;
-                }
-
-
-                /* apply collective operation to first half of the data */
-                if( 0 < count_this_stripe ) {
-                    ompi_op_reduce(op,
-                            (void *)scratch_bufers[send_buffer],
-                            (void *)scratch_bufers[recv_buffer],
-                            count_this_stripe,dtype);
-                }
-
-
-            } else {
-        
-                /*
-                ** Send data to "partner" node
-                */
-                extra_rank=my_exchange_node.rank_extra_source;
-                rc=MCA_PML_CALL(send(scratch_bufers[send_buffer],
-                            count_this_stripe,dtype,ranks_in_comm[extra_rank],
-                            -OMPI_COMMON_TAG_ALLREDUCE, MCA_PML_BASE_SEND_STANDARD,
-                            comm));
-                if( 0 > rc ) {
-                    fprintf(stderr,"  first send failed in comm_allreduce_pml \n");
-                    fflush(stderr);
-                    goto  Error;
-                }
-            }
-
-            /* change pointer to scratch buffer - this was we can send data
-            ** that we have summed w/o a memory copy, and receive data into the
-            ** other buffer, w/o fear of over writting data that has not yet
-            ** completed being send
-            */
-            recv_buffer^=1;
-            send_buffer^=1;
-        }
-
-        /* loop over data exchanges */
-        for(exchange=0 ; exchange < my_exchange_node.n_exchanges ; exchange++) {
-
-            /* is the remote data read */
-            pair_rank=my_exchange_node.rank_exchanges[exchange];
-
-            /* post non-blocking receive */
-            rc=MCA_PML_CALL(irecv(scratch_bufers[recv_buffer],
-                        count_this_stripe,dtype,ranks_in_comm[pair_rank],
-                        -OMPI_COMMON_TAG_ALLREDUCE,
-                        comm,&(requests[0])));
-            if( 0 > rc ) {
-                fprintf(stderr,"  irecv failed in  comm_allreduce_pml at iterations %d \n",
-                        exchange);
-                fflush(stderr);
-                goto Error;
-            }
-
-            /* post non-blocking send */
-            rc=MCA_PML_CALL(isend(scratch_bufers[send_buffer],
-                        count_this_stripe,dtype, ranks_in_comm[pair_rank],
-                        -OMPI_COMMON_TAG_ALLREDUCE,MCA_PML_BASE_SEND_STANDARD,
-                        comm,&(requests[1])));
-            if( 0 > rc ) {
-                fprintf(stderr,"  isend failed in  comm_allreduce_pml at iterations %d \n",
-                        exchange);
-                fflush(stderr);
-                goto Error;
-            }
-            /* wait on send and receive completion */
-            ompi_request_wait_all(2,requests,MPI_STATUSES_IGNORE);
-
-            /* reduce the data */
-            if( 0 < count_this_stripe ) {
-                ompi_op_reduce(op,
-                        (void *)scratch_bufers[send_buffer],
-                        (void *)scratch_bufers[recv_buffer],
-                        count_this_stripe,dtype);
-            }
-            /* get ready for next step */
-            recv_buffer^=1;
-            send_buffer^=1;
-
-        }
-
-        /* copy data in from the "extra" source, if need be */
-        if(0 < my_exchange_node.n_extra_sources)  {
-
-            if ( EXTRA_NODE == my_exchange_node.node_type ) {
-                /* 
-                ** receive the data 
-                ** */
-                extra_rank=my_exchange_node.rank_extra_source;
-                rc=MCA_PML_CALL(recv(scratch_bufers[recv_buffer],
-                            count_this_stripe,dtype,ranks_in_comm[extra_rank],
-                            -OMPI_COMMON_TAG_ALLREDUCE, comm,
-                            MPI_STATUSES_IGNORE));
-                if( 0 > rc ) {
-                    fprintf(stderr,"  last recv failed in comm_allreduce_pml \n");
-                    fflush(stderr);
-                    goto  Error;
-                }
-
-                recv_buffer^=1;
-                send_buffer^=1;
-            } else {
-                /* send the data to the pair-rank outside of the power of 2 set
-                ** of ranks
-                */
-
-                extra_rank=my_exchange_node.rank_extra_source;
-                rc=MCA_PML_CALL(send((char *)scratch_bufers[send_buffer],
-                            count_this_stripe,dtype,ranks_in_comm[extra_rank],
-                            -OMPI_COMMON_TAG_ALLREDUCE, MCA_PML_BASE_SEND_STANDARD,
-                            comm));
-                if( 0 > rc ) {
-                    fprintf(stderr,"  last send failed in comm_allreduce_pml \n");
-                    fflush(stderr);
-                    goto  Error;
-                }
-            }
-        }
-
-        /* copy data from the temp buffer into the output buffer */
-        rbuf_current = (char *) rbuf + count_processed * dt_size;
-        memcpy(rbuf_current,scratch_bufers[send_buffer], count_this_stripe*dt_size);
-    
-        /* update the count of elements processed */
-        count_processed += count_this_stripe;
-    }
-
-    /* return */
-    return OMPI_SUCCESS;
-
-Error:
-    return rc;
-}

ompi/mca/common/commpatterns/common_bcast.c

-/*
- * Copyright (c) 2009-2012 Mellanox Technologies.  All rights reserved.
- * Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
- * Copyright (c) 2012      Los Alamos National Security, LLC.
- *                         All rights reserved.
- * $COPYRIGHT$
- * 
- * Additional copyrights may follow
- * 
- * $HEADER$
- */
-/** @file */
-
-#include "ompi_config.h"
-
-#include "ompi/constants.h"
-#include "ompi/op/op.h"
-#include "ompi/datatype/ompi_datatype.h"
-#include "ompi/communicator/communicator.h"
-#include "opal/include/opal/sys/atomic.h"
-#include "common_coll_ops.h"
-#include "ompi/mca/common/netpatterns/common_netpatterns.h"
-#include "ompi/mca/pml/pml.h"
-
-/**
- * Bcast - subgroup in communicator
- *  This is a very simple algorithm - binary tree, transmitting the full
- *  message at each step.
- */
-OMPI_DECLSPEC int comm_bcast_pml(void *buffer, int root, int count,
-        ompi_datatype_t *dtype, int my_rank_in_group,
-        int n_peers, int *ranks_in_comm,ompi_communicator_t *comm)
-{
-    /* local variables */
-    int rc=OMPI_SUCCESS,msg_cnt,i;
-    ompi_request_t *requests[2];
-    int node_rank, peer_rank;
-    mca_common_netpatterns_tree_node_t node_data;
-
-    /*
-     * shift rank to root==0 tree
-     */
-    node_rank=(my_rank_in_group-root+n_peers)%n_peers;
-
-    /*
-     * compute my communication pattern - binary tree
-     */
-    rc=mca_common_netpatterns_setup_narray_tree(2, node_rank, n_peers,
-            &node_data);
-    if( OMPI_SUCCESS != rc ) {
-        goto Error;
-    }
-
-    /* 1 process special case */
-    if(1 == n_peers) {
-        return OMPI_SUCCESS;
-    }
-
-    /* if I have parents - wait on the data to arrive */
-    if(node_data.n_parents) {
-        /* I will have only 1 parent */
-        peer_rank=node_data.parent_rank;
-        peer_rank=(peer_rank+root)%n_peers;
-        /* translate back to actual rank */
-        rc=MCA_PML_CALL(recv(buffer, count,dtype,peer_rank,
-                    -OMPI_COMMON_TAG_BCAST, comm, MPI_STATUSES_IGNORE));
-        if( 0 > rc ) {
-            goto Error;
-        }
-    }
-
-    /* send the data to my children */
-    msg_cnt=0;
-    for(i=0 ; i < node_data.n_children ; i++ ) {
-        peer_rank=node_data.children_ranks[i];
-        peer_rank=(peer_rank+root)%n_peers;
-        rc=MCA_PML_CALL(isend(buffer,
-                    count,dtype,peer_rank,
-                    -OMPI_COMMON_TAG_BCAST,MCA_PML_BASE_SEND_STANDARD,
-                    comm,&(requests[msg_cnt])));
-        if( 0 > rc ) {
-            goto Error;
-        }
-        msg_cnt++;
-    }
-    /* wait for send completion */
-    if(msg_cnt) {
-        /* wait on send and receive completion */
-        ompi_request_wait_all(msg_cnt,requests,MPI_STATUSES_IGNORE);
-    }
-
-    /* return */
-    return OMPI_SUCCESS;
-
-Error:
-    return rc;
-}

ompi/mca/common/commpatterns/common_coll_ops.h

-/*
- * Copyright (c) 2009-2012 Mellanox Technologies.  All rights reserved.
- * Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
- * Copyright (c) 2012      Los Alamos National Security, LLC.
- *                         All rights reserved.
- * $COPYRIGHT$
- *
- * Additional copyrights may follow
- *
- * $HEADER$
- */
-
-#ifndef COMM_COLL_OP_TYPES_H
-#define COMM_COLL_OP_TYPES_H
-
-#include "ompi_config.h"
-#include "ompi/communicator/communicator.h"
-#include "ompi/datatype/ompi_datatype.h"
-#include "ompi/proc/proc.h"
-
-BEGIN_C_DECLS
-
-#define OMPI_COMMON_TAG_ALLREDUCE 99
-#define OMPI_COMMON_TAG_BCAST     98
-
-
-
-
-OMPI_DECLSPEC int comm_allgather_pml(void *src_buf, void *dest_buf, int count,
-        ompi_datatype_t *dtype, int my_rank_in_group, int n_peers, 
-        int *ranks_in_comm,ompi_communicator_t *comm);
-OMPI_DECLSPEC int comm_allreduce_pml(void *sbuf, void *rbuf, int count,
-        ompi_datatype_t *dtype, int my_rank_in_group,
-        struct ompi_op_t *op, int n_peers,int *ranks_in_comm,
-        ompi_communicator_t *comm);
-OMPI_DECLSPEC int comm_bcast_pml(void *buffer, int root, int count,
-        ompi_datatype_t *dtype, int my_rank_in_group,
-        int n_peers, int *ranks_in_comm,ompi_communicator_t
-        *comm);
-
-/* reduction operations supported */
-#define OP_SUM 1
-#define OP_MAX 2
-#define OP_MIN 3
-
-#define TYPE_INT4 1
-
-
-END_C_DECLS
-
-#endif /* COMM_COLL_OP_TYPES_H */

ompi/mca/common/commpatterns/common_netpatterns.h

-/*
- * Copyright (c) 2009-2012 Mellanox Technologies.  All rights reserved.
- * Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
- * $COPYRIGHT$
- *
- * Additional copyrights may follow
- *
- * $HEADER$
- */
-
-#ifndef COMM_NETPATTERNS_H
-#define COMM_NETPATTERNS_H
-
-#include "ompi_config.h"
-
-BEGIN_C_DECLS
-
-#define MAX_TMP_BUFFER            8192
-
-END_C_DECLS
-
-#endif /* COMM_NETPATTERNS_H */

ompi/mca/common/commpatterns/ompi_common_netpatterns_macros.h

-/*
- * Copyright (c) 2009-2012 Mellanox Technologies.  All rights reserved.
- * Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
- * $COPYRIGHT$
- *
- * Additional copyrights may follow
- *
- * $HEADER$
- */
-
-#ifndef OMPI_COMMON_NETPATTERNS_MACROS_H
-#define OMPI_COMMON_NETPATTERNS_MACROS_H
-
-#include "ompi_config.h"
-
-BEGIN_C_DECLS
-
-/* function to decompose an interger into it's representation in base K */
-/*
- * input_value - value to translate (input)
- * base - base of representation (input)
- * highest_power - the highest power that may have a non-zero entry (input)
- *    the assumption is that this will be called in the critical path
- *    to compute communication patterns, so will precompute such values
- *    and pass the in.
- * base_to_power_i - array of base to ith power (input)
- * cum_base_to_power_i - array of cummulative base to ith power (input)
- * base_k_rep - representation in base "base".  Space is pre-allocated. (out)
- */
-static inline  __opal_attribute_always_inline__ void
-common_netpatterns_obtain_rep_base_k (int input_value, int base,
-        int highest_power, int *base_to_power_i,
-        int *base_k_rep
-        )
-{
-    /* local variables */
-    int lvl, work_value;
-
-    /* loop over all possible powers */
-    work_value=input_value;
-    for( lvl=highest_power ; lvl >= 0 ; lvl-- ) {
-        /* still need to compute the actual coefficient */
-        base_k_rep[lvl]=work_value/base_to_power_i[lvl];
-        work_value-=(base_k_rep[lvl]*base_to_power_i[lvl]);
-
-    }
-
-}
-
-END_C_DECLS
-
-#endif /* OMPI_COMMON_NETPATTERNS_MACROS_H */

ompi/mca/common/netpatterns/.windows

-#
-# Copyright (c) 2008-2012 High Performance Computing Center Stuttgart, 
-#                         University of Stuttgart.  All rights reserved.
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-# Specific to this module
-exclude_list=common_allreduce.c

ompi/mca/common/netpatterns/Makefile.am

-#
-# Copyright (c) 2009-2012 Mellanox Technologies.  All rights reserved.
-# Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
-# $COPYRIGHT$
-# 
-# Additional copyrights may follow
-# 
-# $HEADER$
-#
-
-# A word of explanation...
-#
-# This library is linked against various MCA components because all
-# shared-memory based components (e.g., mpool, ptl, etc.)  need to
-# share some common code and data.  There's two cases:
-#
-# 1. libmca_common_netpatterns.la is a shared library.  By linking that shared
-# library to all components that need it, the OS linker will
-# automatically load it into the process as necessary, and there will
-# only be one copy (i.e., all the components will share *one* copy of
-# the code and data).
-#
-# 2. libmca_common_netpatterns.la is a static library.  In this case, it will
-# be rolled up into the top-level libmpi.la.  It will also be rolled
-# into each component, but then the component will also be rolled up
-# into the upper-level libmpi.la.  Linkers universally know how to
-# "figure this out" so that we end up with only one copy of the code
-# and data.
-#
-# Note that building this common component statically and linking
-# against other dynamic components is *not* supported!
-
-EXTRA_DIST = .windows
-
-# Header files
-
-headers = \
-        common_netpatterns.h \
-        common_netpatterns_knomial_tree.h \
-        common_coll_ops.h
-
-# Source files
-
-sources = \
-		common_netpatterns_base.c \
-		common_netpatterns_multinomial_tree.c \
-		common_netpatterns_nary_tree.c \
-		common_netpatterns_knomial_tree.c
-
-#       common_allreduce.c # the allredeace is broken
-
-# As per above, we'll either have an installable or noinst result.
-# The installable one should follow the same MCA prefix naming rules
-# (i.e., libmca_<type>_<name>.la).  The noinst one can be named
-# whatever it wants, although libmca_<type>_<name>_noinst.la is
-# recommended.
-
-# To simplify components that link to this library, we will *always*
-# have an output libtool library named libmca_<type>_<name>.la -- even
-# for case 2) described above (i.e., so there's no conditional logic
-# necessary in component Makefile.am's that link to this library).
-# Hence, if we're creating a noinst version of this library (i.e.,
-# case 2), we sym link it to the libmca_<type>_<name>.la name
-# (libtool will do the Right Things under the covers).  See the
-# all-local and clean-local rules, below, for how this is effected.
-
-lib_LTLIBRARIES =
-noinst_LTLIBRARIES =
-comp_inst = libmca_common_netpatterns.la
-comp_noinst = libmca_common_netpatterns_noinst.la
-
-if MCA_BUILD_ompi_common_netpatterns_DSO
-lib_LTLIBRARIES += $(comp_inst)
-else
-noinst_LTLIBRARIES += $(comp_noinst)
-endif
-
-libmca_common_netpatterns_la_SOURCES = $(headers) $(sources)
-libmca_common_netpatterns_noinst_la_SOURCES = $(libmca_common_netpatterns_la_SOURCES)
-
-# These two rules will sym link the "noinst" libtool library filename
-# to the installable libtool library filename in the case where we are
-# compiling this component statically (case 2), described above).
-
-all-local:
-	if test -z "$(lib_LTLIBRARIES)"; then \
-	  rm -f "$(comp_inst)"; \
-	  $(LN_S) "$(comp_noinst)" "$(comp_inst)"; \
-	fi
-
-clean-local:
-	if test -z "$(lib_LTLIBRARIES)"; then \
-	  rm -f "$(comp_inst)"; \
-	fi

ompi/mca/common/netpatterns/common_allreduce.c

-/*
- * Copyright (c) 2009-2012 Mellanox Technologies.  All rights reserved.
- * Copyright (c) 2009-2012 Oak Ridge National Laboratory.  All rights reserved.
- * Copyright (c) 2012      Los Alamos National Security, LLC.
- *                         All rights reserved.
- * $COPYRIGHT$
- * 
- * Additional copyrights may follow
- * 
- * $HEADER$
- */
-/** @file */
-
-#include "ompi_config.h"
-
-#include "ompi/constants.h"
-#include "coll_sm2.h"
-#include "ompi/op/op.h"
-#include "ompi/datatype/ompi_datatype.h"
-#include "ompi/communicator/communicator.h"
-#include "ompi/mca/rte/rte.h"
-
-void send_completion(nt status, struct ompi_process_name_t* peer, struct iovec* msg, 
-                     int count, ompi_rml_tag_t tag, void* cbdata)
-{
-    /* set send completion flag */
-    *(int *)cbdata=1;
-}
-
-
-void recv_completion(nt status, struct ompi_process_name_t* peer, struct iovec* msg, 
-                     int count, ompi_rml_tag_t tag, void* cbdata)
-{
-    /* set receive completion flag */
-    MB();
-    *(int *)cbdata=1;
-}
-
-
-static void op_reduce(int op_type,(void *)src_dest_buf,(void *) src_buf, int count,
-        int data_type)
-{
-    /* local variables */
-    int ret;
-
-    /* op type */
-    switch (op_type) {
-
-        case OP_SUM:
-
-            
-            switch (data_type) {
-                case TYPE_INT4:
-                    int *int_src_ptr=(int *)src_ptr;
-                    int *int_src_dst_ptr=(int *)src_dst_ptr;
-                    int cnt;
-                    for(cnt=0 ; cnt < count ; ) {
-                        (*(int_src_dst_ptr))+=(*(int_src_ptr));
-                    break;
-                default:
-                    ret=OMPI_ERROR;
-                    goto Error;
-            }
-
-            break;
-
-        default:
-        ret=OMPI_ERROR;
-        goto Error;
-    }
-Error:
-    return ret;
-}
-
-/**
- * All-reduce for contigous primitive types
- */
-static
-comm_allreduce(void *sbuf, void *rbuf, int count, opal_datatype_t *dtype, 
-        int op_type, opal_list_t *peers)
-{
-    /* local variables */
-    int rc=OMPI_SUCCESS,n_dts_per_buffer,n_data_segments,stripe_number;
-    int pair_rank,exchange,extra_rank;
-    int index_read,index_write;
-    mca_common_netpatterns_pair_exchange_node_t my_exchange_node;
-    int my_rank,c