From 7007fc42468a7857bf540875ce891f6486448cdc Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Tue, 15 Jun 2021 11:03:52 -0600 Subject: [PATCH] sessions: remove topo from group related funcs and some more windows from group stuff too. None of these made it into the sessions API for MPI 4.0 and its very likely they will be added in a MPI 5.0 release. Other approaches to topology constructs outside of sessions proposal are being explored. Related to https://github.com/hpc/ompi/issues/58 Related to https://github.com/hpc/ompi/issues/54 Signed-off-by: Howard Pritchard --- ompi/include/mpi.h.in | 36 ------ ompi/mca/topo/base/base.h | 28 ----- ompi/mca/topo/base/topo_base_cart_create.c | 55 -------- ompi/mca/topo/base/topo_base_comm_select.c | 12 -- .../topo/base/topo_base_dist_graph_create.c | 28 ----- .../topo_base_dist_graph_create_adjacent.c | 18 --- ompi/mca/topo/base/topo_base_graph_create.c | 40 ------ ompi/mca/topo/topo.h | 49 -------- ompi/mpi/c/Makefile.am | 7 -- ompi/mpi/c/cart_create_from_group.c | 117 ------------------ .../c/dist_graph_create_adjacent_from_group.c | 111 ----------------- ompi/mpi/c/dist_graph_create_from_group.c | 96 -------------- ompi/mpi/c/graph_create_from_group.c | 105 ---------------- ompi/mpi/c/profile/Makefile.am | 4 - ompi/mpi/c/win_create_dynamic_from_group.c | 76 ------------ ompi/mpi/c/win_create_from_group.c | 80 ------------ 16 files changed, 862 deletions(-) delete mode 100644 ompi/mpi/c/cart_create_from_group.c delete mode 100644 ompi/mpi/c/dist_graph_create_adjacent_from_group.c delete mode 100644 ompi/mpi/c/dist_graph_create_from_group.c delete mode 100644 ompi/mpi/c/graph_create_from_group.c delete mode 100644 ompi/mpi/c/win_create_dynamic_from_group.c delete mode 100644 ompi/mpi/c/win_create_from_group.c diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 6ab047b1df3..5b2ec70b708 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -1383,9 +1383,6 @@ OMPI_DECLSPEC int MPI_Cancel(MPI_Request *request); OMPI_DECLSPEC int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int coords[]); OMPI_DECLSPEC int MPI_Cart_create(MPI_Comm old_comm, int ndims, const int dims[], const int periods[], int reorder, MPI_Comm *comm_cart); -OMPI_DECLSPEC int MPI_Cart_create_from_group (MPI_Group group, const char *tag, MPI_Info info, - MPI_Errhandler errhandler, int ndims, const int dims[], - const int periods[], int reorder, MPI_Comm *comm_cart); OMPI_DECLSPEC int MPI_Cart_get(MPI_Comm comm, int maxdims, int dims[], int periods[], int coords[]); OMPI_DECLSPEC int MPI_Cart_map(MPI_Comm comm, int ndims, const int dims[], @@ -1426,9 +1423,6 @@ OMPI_DECLSPEC int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int nod const int degrees[], const int targets[], const int weights[], MPI_Info info, int reorder, MPI_Comm * newcomm); -OMPI_DECLSPEC int MPI_Dist_graph_create_from_group (MPI_Group group, const char *tag, MPI_Errhandler errhandler, - int n, const int sources[], const int degrees[], const int destinations[], - const int weights[], MPI_Info info, int reorder, MPI_Comm * newcomm); OMPI_DECLSPEC int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old, int indegree, const int sources[], const int sourceweights[], @@ -1437,10 +1431,6 @@ OMPI_DECLSPEC int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old, const int destweights[], MPI_Info info, int reorder, MPI_Comm *comm_dist_graph); -OMPI_DECLSPEC int MPI_Dist_graph_create_adjacent_from_group (MPI_Group group, const char *tag, MPI_Errhandler errhandler, - int indegree, const int sources[], const int sourceweights[], - int outdegree, const int destinations[], const int destweights[], - MPI_Info info, int reorder, MPI_Comm *comm_dist_graph); OMPI_DECLSPEC int MPI_Dist_graph_neighbors(MPI_Comm comm, int maxindegree, int sources[], int sourceweights[], int maxoutdegree, @@ -1617,9 +1607,6 @@ OMPI_DECLSPEC int MPI_Get_processor_name(char *name, int *resultlen); OMPI_DECLSPEC int MPI_Get_version(int *version, int *subversion); OMPI_DECLSPEC int MPI_Graph_create(MPI_Comm comm_old, int nnodes, const int index[], const int edges[], int reorder, MPI_Comm *comm_graph); -OMPI_DECLSPEC int MPI_Graph_create_from_group (MPI_Group group, const char *tag, MPI_Info info, - MPI_Errhandler errhandler, int nnodes, const int indx[], - const int edges[], int reorder, MPI_Comm *comm_graph); OMPI_DECLSPEC int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int index[], int edges[]); OMPI_DECLSPEC int MPI_Graph_map(MPI_Comm comm, int nnodes, const int index[], const int edges[], @@ -1993,12 +1980,7 @@ OMPI_DECLSPEC int MPI_Win_call_errhandler(MPI_Win win, int errorcode); OMPI_DECLSPEC int MPI_Win_complete(MPI_Win win); OMPI_DECLSPEC int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win); -OMPI_DECLSPEC int MPI_Win_create_from_group (void *base, MPI_Aint size, int disp_unit, - MPI_Info info, MPI_Group group, const char *tag, - MPI_Win *win); OMPI_DECLSPEC int MPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win); -OMPI_DECLSPEC int MPI_Win_create_dynamic_from_group(MPI_Info info, MPI_Group group, const char *tag, - MPI_Win *win); OMPI_DECLSPEC int MPI_Win_create_errhandler(MPI_Win_errhandler_function *function, MPI_Errhandler *errhandler); OMPI_DECLSPEC int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, @@ -2087,9 +2069,6 @@ OMPI_DECLSPEC int PMPI_Dist_graph_create(MPI_Comm comm_old, int n, const int no const int degrees[], const int targets[], const int weights[], MPI_Info info, int reorder, MPI_Comm * newcomm); -OMPI_DECLSPEC int PMPI_Dist_graph_create_from_group (MPI_Group group, const char *tag, MPI_Errhandler errhandler, - int n, const int sources[], const int degrees[], const int destinations[], - const int weights[], MPI_Info info, int reorder, MPI_Comm * newcomm); OMPI_DECLSPEC int PMPI_Dist_graph_create_adjacent(MPI_Comm comm_old, int indegree, const int sources[], const int sourceweights[], @@ -2098,10 +2077,6 @@ OMPI_DECLSPEC int PMPI_Dist_graph_create_adjacent(MPI_Comm comm_old, const int destweights[], MPI_Info info, int reorder, MPI_Comm *comm_dist_graph); -OMPI_DECLSPEC int PMPI_Dist_graph_create_adjacent_from_group (MPI_Group group, const char *tag, MPI_Errhandler errhandler, - int indegree, const int sources[], const int sourceweights[], - int outdegree, const int destinations[], const int destweights[], - MPI_Info info, int reorder, MPI_Comm *comm_dist_graph); OMPI_DECLSPEC int PMPI_Dist_graph_neighbors(MPI_Comm comm, int maxindegree, int sources[], int sourceweights[], int maxoutdegree, @@ -2128,9 +2103,6 @@ OMPI_DECLSPEC int PMPI_Cancel(MPI_Request *request); OMPI_DECLSPEC int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int coords[]); OMPI_DECLSPEC int PMPI_Cart_create(MPI_Comm old_comm, int ndims, const int dims[], const int periods[], int reorder, MPI_Comm *comm_cart); -OMPI_DECLSPEC int PMPI_Cart_create_from_group (MPI_Group group, const char *tag, MPI_Info info, - MPI_Errhandler errhandler, int ndims, const int dims[], - const int periods[], int reorder, MPI_Comm *comm_cart); OMPI_DECLSPEC int PMPI_Cart_get(MPI_Comm comm, int maxdims, int dims[], int periods[], int coords[]); OMPI_DECLSPEC int PMPI_Cart_map(MPI_Comm comm, int ndims, const int dims[], @@ -2336,9 +2308,6 @@ OMPI_DECLSPEC int PMPI_Get_processor_name(char *name, int *resultlen); OMPI_DECLSPEC int PMPI_Get_version(int *version, int *subversion); OMPI_DECLSPEC int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, const int index[], const int edges[], int reorder, MPI_Comm *comm_graph); -OMPI_DECLSPEC int PMPI_Graph_create_from_group (MPI_Group group, const char *tag, MPI_Info info, - MPI_Errhandler errhandler, int nnodes, const int indx[], - const int edges[], int reorder, MPI_Comm *comm_graph); OMPI_DECLSPEC int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int index[], int edges[]); OMPI_DECLSPEC int PMPI_Graph_map(MPI_Comm comm, int nnodes, const int index[], const int edges[], @@ -2712,12 +2681,7 @@ OMPI_DECLSPEC int PMPI_Win_call_errhandler(MPI_Win win, int errorcode); OMPI_DECLSPEC int PMPI_Win_complete(MPI_Win win); OMPI_DECLSPEC int PMPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win); -OMPI_DECLSPEC int PMPI_Win_create_from_group (void *base, MPI_Aint size, int disp_unit, - MPI_Info info, MPI_Group group, const char *tag, - MPI_Win *win); OMPI_DECLSPEC int PMPI_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win); -OMPI_DECLSPEC int PMPI_Win_create_dynamic_from_group (MPI_Info info, MPI_Group group, - const char *tag, MPI_Win *win); OMPI_DECLSPEC int PMPI_Win_create_errhandler(MPI_Win_errhandler_function *function, MPI_Errhandler *errhandler); OMPI_DECLSPEC int PMPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_attr_fn, diff --git a/ompi/mca/topo/base/base.h b/ompi/mca/topo/base/base.h index 92adebcd6e3..f04a1cbff9f 100644 --- a/ompi/mca/topo/base/base.h +++ b/ompi/mca/topo/base/base.h @@ -89,13 +89,6 @@ mca_topo_base_cart_create(mca_topo_base_module_t *topo_module, bool reorder, ompi_communicator_t** comm_topo); -OMPI_DECLSPEC int -mca_topo_base_cart_create_from_group (mca_topo_base_module_t *topo_module, ompi_group_t *group, - const char *tag, opal_info_t *info, - ompi_errhandler_t *errhandler, int ndims, const int *dims, - const int *periods, bool reorder, - ompi_communicator_t **comm_topo); - OMPI_DECLSPEC int mca_topo_base_cart_coords(ompi_communicator_t *comm, int rank, @@ -149,12 +142,6 @@ mca_topo_base_graph_create(mca_topo_base_module_t *topo_module, bool reorder, ompi_communicator_t** new_comm); -OMPI_DECLSPEC int -mca_topo_base_graph_create_from_group (mca_topo_base_module_t *topo_module, ompi_group_t *group, - const char *tag, opal_info_t *info, - ompi_errhandler_t *errhandler, int nnodes, const int *index, - const int *edges, bool reorder, ompi_communicator_t **new_comm); - OMPI_DECLSPEC int mca_topo_base_graph_get(ompi_communicator_t *comm, int maxindex, @@ -198,13 +185,6 @@ mca_topo_base_dist_graph_create(mca_topo_base_module_t* module, opal_info_t *info, int reorder, ompi_communicator_t **new_comm); -OMPI_DECLSPEC int -mca_topo_base_dist_graph_create_from_group (mca_topo_base_module_t *module, ompi_group_t *group, - const char *tag, ompi_errhandler_t *errhandler, int n, - const int nodes[], const int degrees[], const int targets[], - const int weights[], opal_info_t *info, int reorder, - ompi_communicator_t **new_comm); - OMPI_DECLSPEC int mca_topo_base_dist_graph_create_adjacent(mca_topo_base_module_t* module, ompi_communicator_t *old_comm, @@ -214,14 +194,6 @@ mca_topo_base_dist_graph_create_adjacent(mca_topo_base_module_t* module, opal_info_t *info, int reorder, ompi_communicator_t **comm_dist_graph); -OMPI_DECLSPEC int -mca_topo_base_dist_graph_create_adjacent_from_group (mca_topo_base_module_t* module, ompi_group_t *group, - const char *tag, ompi_errhandler_t *errhandler, - int indegree, const int sources[], const int sourceweights[], - int outdegree, const int destinations[], - const int destweights[], opal_info_t *info, int reorder, - ompi_communicator_t **comm_dist_graph); - OMPI_DECLSPEC int mca_topo_base_dist_graph_neighbors(ompi_communicator_t *comm, int maxindegree, diff --git a/ompi/mca/topo/base/topo_base_cart_create.c b/ompi/mca/topo/base/topo_base_cart_create.c index 6405ac9519b..9da23056c70 100644 --- a/ompi/mca/topo/base/topo_base_cart_create.c +++ b/ompi/mca/topo/base/topo_base_cart_create.c @@ -178,61 +178,6 @@ int mca_topo_base_cart_create(mca_topo_base_module_t *topo, return OMPI_SUCCESS; } -int mca_topo_base_cart_create_from_group (mca_topo_base_module_t *topo, ompi_group_t *group, const char *tag, - opal_info_t *info, ompi_errhandler_t *errhandler, int ndims, - const int *dims, const int *periods, bool reorder, - ompi_communicator_t **comm_topo) -{ - int new_rank, num_procs, ret; - ompi_communicator_t *new_comm; - mca_topo_base_comm_cart_2_2_0_t* cart; - ompi_group_t *c_local_group; - - *comm_topo = MPI_COMM_NULL; - - assert(topo->type == OMPI_COMM_CART); - - ret = mca_topo_base_cart_allocate (group, ndims, dims, periods, &new_rank, &num_procs, &cart); - if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) { - return ret; - } - - if (MPI_UNDEFINED == new_rank) { - /* not part of this */ - return OMPI_SUCCESS; - } - - /* Copy the proc structure from the previous communicator over to - the new one. The topology module is then able to work on this - copy and rearrange it as it deems fit. NTH: seems odd that this - function has always clipped the group size here. It might be - worthwhile to clip the group in the module (if reordering) */ - c_local_group = ompi_group_flatten (group, num_procs); - if (OPAL_UNLIKELY(NULL == c_local_group)) { - OBJ_RELEASE(cart); - return OMPI_ERR_OUT_OF_RESOURCE; - } - - ret = ompi_comm_create_from_group (c_local_group, tag, info, errhandler, &new_comm); - - ompi_group_free (&c_local_group); - - if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) { - OBJ_RELEASE(cart); - return ret; - } - - new_comm->c_topo = topo; - new_comm->c_topo->mtc.cart = cart; - new_comm->c_topo->reorder = reorder; - new_comm->c_flags |= OMPI_COMM_CART; - - *comm_topo = new_comm; - - /* end here */ - return OMPI_SUCCESS; -} - static void mca_topo_base_comm_cart_2_2_0_construct(mca_topo_base_comm_cart_2_2_0_t * cart) { cart->ndims = 0; cart->dims = NULL; diff --git a/ompi/mca/topo/base/topo_base_comm_select.c b/ompi/mca/topo/base/topo_base_comm_select.c index 82c6da13767..9dc6fc3d45b 100644 --- a/ompi/mca/topo/base/topo_base_comm_select.c +++ b/ompi/mca/topo/base/topo_base_comm_select.c @@ -288,9 +288,6 @@ static void fill_null_pointers(int type, mca_topo_base_module_t *module) if (NULL == module->topo.cart.cart_create) { module->topo.cart.cart_create = mca_topo_base_cart_create; } - if (NULL == module->topo.cart.cart_create_from_group) { - module->topo.cart.cart_create_from_group = mca_topo_base_cart_create_from_group; - } if (NULL == module->topo.cart.cart_get) { module->topo.cart.cart_get = mca_topo_base_cart_get; } @@ -313,9 +310,6 @@ static void fill_null_pointers(int type, mca_topo_base_module_t *module) if (NULL == module->topo.graph.graph_create) { module->topo.graph.graph_create = mca_topo_base_graph_create; } - if (NULL == module->topo.graph.graph_create_from_group) { - module->topo.graph.graph_create_from_group = mca_topo_base_graph_create_from_group; - } if (NULL == module->topo.graph.graph_get) { module->topo.graph.graph_get = mca_topo_base_graph_get; } @@ -335,15 +329,9 @@ static void fill_null_pointers(int type, mca_topo_base_module_t *module) if (NULL == module->topo.dist_graph.dist_graph_create) { module->topo.dist_graph.dist_graph_create = mca_topo_base_dist_graph_create; } - if (NULL == module->topo.dist_graph.dist_graph_create_from_group) { - module->topo.dist_graph.dist_graph_create_from_group = mca_topo_base_dist_graph_create_from_group; - } if (NULL == module->topo.dist_graph.dist_graph_create_adjacent) { module->topo.dist_graph.dist_graph_create_adjacent = mca_topo_base_dist_graph_create_adjacent; } - if (NULL == module->topo.dist_graph.dist_graph_create_adjacent_from_group) { - module->topo.dist_graph.dist_graph_create_adjacent_from_group = mca_topo_base_dist_graph_create_adjacent_from_group; - } if (NULL == module->topo.dist_graph.dist_graph_neighbors) { module->topo.dist_graph.dist_graph_neighbors = mca_topo_base_dist_graph_neighbors; } diff --git a/ompi/mca/topo/base/topo_base_dist_graph_create.c b/ompi/mca/topo/base/topo_base_dist_graph_create.c index 6c63bed5583..66e2976deb5 100644 --- a/ompi/mca/topo/base/topo_base_dist_graph_create.c +++ b/ompi/mca/topo/base/topo_base_dist_graph_create.c @@ -314,34 +314,6 @@ int mca_topo_base_dist_graph_create(mca_topo_base_module_t* module, return err; } -int mca_topo_base_dist_graph_create_from_group (mca_topo_base_module_t* module, ompi_group_t *group, - const char *tag, ompi_errhandler_t *errhandler, - int n, const int nodes[], const int degrees[], - const int targets[], const int weights[], - opal_info_t *info, int reorder, - ompi_communicator_t **newcomm) -{ - int err; - - if (OMPI_SUCCESS != (err = ompi_comm_create_from_group (group, tag, info, errhandler, newcomm))) { - OBJ_RELEASE(module); - return err; - } - - assert(NULL == (*newcomm)->c_topo); - (*newcomm)->c_topo = module; - (*newcomm)->c_topo->reorder = reorder; - (*newcomm)->c_flags |= OMPI_COMM_DIST_GRAPH; - - err = mca_topo_base_dist_graph_distribute (module, *newcomm, n, nodes, degrees, targets, - weights, &((*newcomm)->c_topo->mtc.dist_graph)); - if( OMPI_SUCCESS != err ) { - ompi_comm_free(newcomm); - } - - return err; -} - static void mca_topo_base_comm_dist_graph_2_2_0_construct(mca_topo_base_comm_dist_graph_2_2_0_t * dist_graph) { dist_graph->in = NULL; dist_graph->inw = NULL; diff --git a/ompi/mca/topo/base/topo_base_dist_graph_create_adjacent.c b/ompi/mca/topo/base/topo_base_dist_graph_create_adjacent.c index 79a273f1946..336aa05c733 100644 --- a/ompi/mca/topo/base/topo_base_dist_graph_create_adjacent.c +++ b/ompi/mca/topo/base/topo_base_dist_graph_create_adjacent.c @@ -115,21 +115,3 @@ int mca_topo_base_dist_graph_create_adjacent(mca_topo_base_module_t* module, return _mca_topo_base_dist_graph_create_adjacent (module, indegree, sources, sourceweights, outdegree, destinations, destweights, reorder, newcomm); } - -int mca_topo_base_dist_graph_create_adjacent_from_group (mca_topo_base_module_t* module, ompi_group_t *group, - const char *tag, ompi_errhandler_t *errhandler, - int indegree, const int sources[], - const int sourceweights[], int outdegree, - const int destinations[], const int destweights[], - opal_info_t *info, int reorder, - ompi_communicator_t **newcomm) -{ - int err; - - if (OMPI_SUCCESS != (err = ompi_comm_create_from_group (group, tag, info, errhandler, newcomm))) { - return err; - } - - return _mca_topo_base_dist_graph_create_adjacent (module, indegree, sources, sourceweights, outdegree, - destinations, destweights, reorder, newcomm); -} diff --git a/ompi/mca/topo/base/topo_base_graph_create.c b/ompi/mca/topo/base/topo_base_graph_create.c index 00d2c6ac3ff..dfd2708bd53 100644 --- a/ompi/mca/topo/base/topo_base_graph_create.c +++ b/ompi/mca/topo/base/topo_base_graph_create.c @@ -121,46 +121,6 @@ int mca_topo_base_graph_create (mca_topo_base_module_t *topo, ompi_communicator_ return OMPI_SUCCESS; } -int mca_topo_base_graph_create_from_group (mca_topo_base_module_t *topo, ompi_group_t *group, - const char *tag, opal_info_t *info, ompi_errhandler_t *errhandler, - int nnodes, const int *index, const int *edges, bool reorder, - ompi_communicator_t **comm_topo) -{ - int num_procs, ret, my_rank = group->grp_my_rank; - mca_topo_base_comm_graph_2_2_0_t *graph; - ompi_group_t *c_local_group; - - assert(topo->type == OMPI_COMM_GRAPH); - - *comm_topo = MPI_COMM_NULL; - - ret = mca_topo_base_graph_allocate (group, nnodes, index, edges, &num_procs, &graph); - if (OPAL_UNLIKELY(OMPI_SUCCESS != ret || my_rank >= num_procs)) { - return ret; - } - - c_local_group = ompi_group_flatten (group, nnodes); - if (OPAL_UNLIKELY(NULL == c_local_group)) { - OBJ_RELEASE(graph); - return OMPI_ERR_OUT_OF_RESOURCE; - } - - ret = ompi_comm_create_from_group (c_local_group, tag, info, errhandler, comm_topo); - if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) { - OBJ_RELEASE(graph); - return ret; - } - - if (MPI_COMM_NULL != *comm_topo) { - (*comm_topo)->c_topo = topo; - (*comm_topo)->c_topo->mtc.graph = graph; - (*comm_topo)->c_flags |= OMPI_COMM_GRAPH; - (*comm_topo)->c_topo->reorder = reorder; - } - - return OMPI_SUCCESS; -} - static void mca_topo_base_comm_graph_2_2_0_construct(mca_topo_base_comm_graph_2_2_0_t * graph) { graph->nnodes = 0; graph->index = NULL; diff --git a/ompi/mca/topo/topo.h b/ompi/mca/topo/topo.h index 050d831dc53..d19fbd7d9a6 100644 --- a/ompi/mca/topo/topo.h +++ b/ompi/mca/topo/topo.h @@ -162,19 +162,6 @@ typedef int (*mca_topo_base_module_cart_create_fn_t) bool reorder, ompi_communicator_t** comm_topo); -/* Back end for MPI_Cart_create_from_group */ -typedef int (*mca_topo_base_module_cart_create_from_group_fn_t) - (mca_topo_base_module_t *topo_module, - ompi_group_t *group, - const char *tag, - opal_info_t *info, - ompi_errhandler_t *errhandler, - int ndims, - const int *dims, - const int *periods, - bool reorder, - ompi_communicator_t** comm_topo); - /* Back end for MPI_CART_GET */ typedef int (*mca_topo_base_module_cart_get_fn_t) (struct ompi_communicator_t *comm, @@ -226,19 +213,6 @@ typedef int (*mca_topo_base_module_graph_create_fn_t) bool reorder, ompi_communicator_t** new_comm); -/* Back end for MPI_Graph_create_from_group */ -typedef int (*mca_topo_base_module_graph_create_from_group_fn_t) - (mca_topo_base_module_t *topo_module, - ompi_group_t *group, - const char *tag, - opal_info_t *info, - ompi_errhandler_t *errhandler, - int nnodes, - const int *index, - const int *edges, - bool reorder, - ompi_communicator_t** new_comm); - /* Back end for MPI_GRAPH_GET */ typedef int (*mca_topo_base_module_graph_get_fn_t) (struct ompi_communicator_t *comm, @@ -283,15 +257,6 @@ typedef int (*mca_topo_base_module_dist_graph_create_fn_t) struct opal_info_t *info, int reorder, struct ompi_communicator_t **new_comm); -/* Back end for MPI_Dist_graph_create_from_group */ -typedef int (*mca_topo_base_module_dist_graph_create_from_group_fn_t) - (struct mca_topo_base_module_t* module, - ompi_group_t *group, const char *tag, - ompi_errhandler_t *errhandler, int n, const int nodes[], - const int degrees[], const int targets[], const int weights[], - struct opal_info_t *info, int reorder, - struct ompi_communicator_t **new_comm); - /* Back end for MPI_DIST_GRAPH_CREATE_ADJACENT */ typedef int (*mca_topo_base_module_dist_graph_create_adjacent_fn_t) (struct mca_topo_base_module_t* module, @@ -304,16 +269,6 @@ typedef int (*mca_topo_base_module_dist_graph_create_adjacent_fn_t) struct opal_info_t *info, int reorder, ompi_communicator_t **comm_dist_graph); -/* Back end for MPI_Dist_graph_create_adjacent_from_group */ -typedef int (*mca_topo_base_module_dist_graph_create_adjacent_from_group_fn_t) - (struct mca_topo_base_module_t* module, - ompi_group_t *group, const char *tag, - ompi_errhandler_t *errhandler, int indegree, const int sources[], - const int sourceweights[], int outdegree, - const int destinations[], const int destweights[], - struct opal_info_t *info, int reorder, - ompi_communicator_t **comm_dist_graph); - /* Back end for MPI_DIST_GRAPH_NEIGHBORS */ typedef int (*mca_topo_base_module_dist_graph_neighbors_fn_t) (struct ompi_communicator_t *comm, @@ -340,7 +295,6 @@ typedef int (*mca_topo_base_module_dist_graph_neighbors_count_fn_t) typedef struct mca_topo_base_cart_module_2_3_0_t { mca_topo_base_module_cart_coords_fn_t cart_coords; mca_topo_base_module_cart_create_fn_t cart_create; - mca_topo_base_module_cart_create_from_group_fn_t cart_create_from_group; mca_topo_base_module_cart_get_fn_t cart_get; mca_topo_base_module_cartdim_get_fn_t cartdim_get; mca_topo_base_module_cart_map_fn_t cart_map; @@ -351,7 +305,6 @@ typedef struct mca_topo_base_cart_module_2_3_0_t { typedef struct mca_topo_base_graph_module_2_3_0_t { mca_topo_base_module_graph_create_fn_t graph_create; - mca_topo_base_module_graph_create_from_group_fn_t graph_create_from_group; mca_topo_base_module_graph_get_fn_t graph_get; mca_topo_base_module_graph_map_fn_t graph_map; mca_topo_base_module_graphdims_get_fn_t graphdims_get; @@ -361,9 +314,7 @@ typedef struct mca_topo_base_graph_module_2_3_0_t { typedef struct mca_topo_base_dist_graph_module_2_3_0_t { mca_topo_base_module_dist_graph_create_fn_t dist_graph_create; - mca_topo_base_module_dist_graph_create_from_group_fn_t dist_graph_create_from_group; mca_topo_base_module_dist_graph_create_adjacent_fn_t dist_graph_create_adjacent; - mca_topo_base_module_dist_graph_create_adjacent_from_group_fn_t dist_graph_create_adjacent_from_group; mca_topo_base_module_dist_graph_neighbors_fn_t dist_graph_neighbors; mca_topo_base_module_dist_graph_neighbors_count_fn_t dist_graph_neighbors_count; } mca_topo_base_dist_graph_module_2_3_0_t; diff --git a/ompi/mpi/c/Makefile.am b/ompi/mpi/c/Makefile.am index 31e284b66c5..c50ff9acc04 100644 --- a/ompi/mpi/c/Makefile.am +++ b/ompi/mpi/c/Makefile.am @@ -92,7 +92,6 @@ libmpi_c_mpi_la_SOURCES = \ cancel.c \ cart_coords.c \ cart_create.c \ - cart_create_from_group.c \ cartdim_get.c \ cart_get.c \ cart_map.c \ @@ -131,9 +130,7 @@ libmpi_c_mpi_la_SOURCES = \ comm_set_attr.c \ comm_set_info.c \ dist_graph_create.c \ - dist_graph_create_from_group.c \ dist_graph_create_adjacent.c \ - dist_graph_create_adjacent_from_group.c \ dist_graph_neighbors.c \ dist_graph_neighbors_count.c \ comm_set_errhandler.c \ @@ -231,7 +228,6 @@ libmpi_c_mpi_la_SOURCES = \ get_processor_name.c \ get_version.c \ graph_create.c \ - graph_create_from_group.c \ graph_get.c \ graph_map.c \ graph_neighbors_count.c \ @@ -425,7 +421,6 @@ libmpi_c_mpi_la_SOURCES = \ put.c \ win_allocate.c \ win_allocate_shared.c \ - win_allocate_shared_from_group.c \ win_attach.c \ win_c2f.c \ win_call_errhandler.c \ @@ -433,9 +428,7 @@ libmpi_c_mpi_la_SOURCES = \ win_create_errhandler.c \ win_create_keyval.c \ win_create.c \ - win_create_from_group.c \ win_create_dynamic.c \ - win_create_dynamic_from_group.c \ win_delete_attr.c \ win_detach.c \ win_f2c.c \ diff --git a/ompi/mpi/c/cart_create_from_group.c b/ompi/mpi/c/cart_create_from_group.c deleted file mode 100644 index e9fd26e23d4..00000000000 --- a/ompi/mpi/c/cart_create_from_group.c +++ /dev/null @@ -1,117 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2013 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * Copyright (c) 2007-2008 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2012-2013 Inria. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ -#include "ompi_config.h" -#include - -#include "ompi/mpi/c/bindings.h" -#include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" -#include "ompi/errhandler/errhandler.h" -#include "ompi/mca/topo/base/base.h" -#include "ompi/memchecker.h" - -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Cart_create_from_group = PMPI_Cart_create_from_group -#endif -#define MPI_Cart_create_from_group PMPI_Cart_create_from_group -#endif - -static const char FUNC_NAME[] = "MPI_Cart_create_from_group"; - - -int MPI_Cart_create_from_group (MPI_Group group, const char *tag, MPI_Info info, - MPI_Errhandler errhandler, int ndims, const int dims[], - const int periods[], int reorder, MPI_Comm *comm_cart) -{ - mca_topo_base_module_t *topo; - int err; - - /* check the arguments */ - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if (NULL == group) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_GROUP, FUNC_NAME); - } - if (NULL == tag) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_TAG, FUNC_NAME); - } - if (NULL == info || ompi_info_is_freed(info)) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_INFO, FUNC_NAME); - } - if (ndims < 0 || (ndims >= 1 && (NULL == dims || NULL == periods)) || NULL == comm_cart) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_ARG, FUNC_NAME); - } - - /* check if the number of processes on the grid are correct */ - { - int count_nodes = 1; - - for (int i = 0 ; i < ndims ; i++) { - count_nodes *= dims[i]; - } - - if (group->grp_proc_count < count_nodes) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_ARG, FUNC_NAME); - } - } - } - - if (MPI_UNDEFINED == group->grp_my_rank) { - *comm_cart = MPI_COMM_NULL; - return MPI_SUCCESS; - } - - /* - * everything seems to be alright with the communicator, we can go - * ahead and select a topology module for this purpose and create - * the new graph communicator - */ - if (OMPI_SUCCESS != (err = mca_topo_base_group_select (group, NULL, &topo, OMPI_COMM_CART))) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - err, FUNC_NAME); - } - - /* Now let that topology module rearrange procs/ranks if it wants to */ - err = topo->topo.cart.cart_create_from_group (topo, group, tag, &info->super, errhandler, - ndims, dims, periods, !!reorder, - comm_cart); - - if (MPI_SUCCESS != err) { - OBJ_RELEASE(topo); - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - err, FUNC_NAME); - } - - /* All done */ - return MPI_SUCCESS; -} diff --git a/ompi/mpi/c/dist_graph_create_adjacent_from_group.c b/ompi/mpi/c/dist_graph_create_adjacent_from_group.c deleted file mode 100644 index af3d74fb936..00000000000 --- a/ompi/mpi/c/dist_graph_create_adjacent_from_group.c +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2008 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2011-2018 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2012-2013 Inria. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2017 IBM Corporation. All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * Author(s): Torsten Hoefler - * - */ - -#include "ompi_config.h" - -#include "ompi/mpi/c/bindings.h" -#include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" -#include "ompi/errhandler/errhandler.h" -#include "ompi/memchecker.h" -#include "ompi/mca/topo/topo.h" -#include "ompi/mca/topo/base/base.h" - -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Dist_graph_create_adjacent_from_group = PMPI_Dist_graph_create_adjacent_from_group -#endif -#define MPI_Dist_graph_create_adjacent_from_group PMPI_Dist_graph_create_adjacent_from_group -#endif - -static const char FUNC_NAME[] = "MPI_Dist_graph_create_adjacent_from_group"; - - -int MPI_Dist_graph_create_adjacent_from_group (MPI_Group group, const char *tag, MPI_Errhandler errhandler, - int indegree, const int sources[], const int sourceweights[], - int outdegree, const int destinations[], const int destweights[], - MPI_Info info, int reorder, MPI_Comm *comm_dist_graph) -{ - mca_topo_base_module_t* topo; - int group_size, err; - - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - - if (NULL == group) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_GROUP, FUNC_NAME); - } - if (NULL == tag) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_TAG, FUNC_NAME); - } - if (NULL == info || ompi_info_is_freed(info)) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_INFO, FUNC_NAME); - } - if (indegree < 0 || outdegree < 0 || NULL == comm_dist_graph) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_ARG, "MPI_Dist_graph_create_adjacent_from_group negative degree"); - } else if ((indegree > 0 && (NULL == sources || NULL == sourceweights)) || - (outdegree > 0 && (NULL == destinations || NULL == destweights))) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_ARG, "MPI_Dist_graph_create_adjacent_from_group mismatched sources or destinations"); - } - - group_size = ompi_group_size (group); - for (int i = 0 ; i < indegree ; ++i) { - if (((sources[i] < 0) && (sources[i] != MPI_PROC_NULL)) || sources[i] >= group_size) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, MPI_ERR_ARG, - "MPI_Dist_graph_create_adjacent_from_group invalid sources"); - } else if (MPI_UNWEIGHTED != sourceweights && sourceweights[i] < 0) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, MPI_ERR_ARG, - "MPI_Dist_graph_create_adjacent_from_group invalid sourceweights"); - } - } - for (int i = 0; i < outdegree; ++i) { - if (((destinations[i] < 0) && (destinations[i] != MPI_PROC_NULL)) || destinations[i] >= group_size) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, MPI_ERR_ARG, - "MPI_Dist_graph_create_adjacent_from_group invalid destinations"); - } else if (MPI_UNWEIGHTED != destweights && destweights[i] < 0) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, MPI_ERR_ARG, - "MPI_Dist_graph_create_adjacent_from_group invalid destweights"); - } - } - } - - /* Ensure there is a topo attached to this communicator */ - if(OMPI_SUCCESS != (err = mca_topo_base_group_select (group, NULL, &topo, OMPI_COMM_DIST_GRAPH))) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - err, FUNC_NAME); - } - - err = topo->topo.dist_graph.dist_graph_create_adjacent_from_group (topo, group, tag, errhandler, indegree, - sources, sourceweights, outdegree, - destinations, destweights, &(info->super), - reorder, comm_dist_graph); - OMPI_ERRHANDLER_RETURN(err, MPI_COMM_SELF, err, FUNC_NAME); -} - diff --git a/ompi/mpi/c/dist_graph_create_from_group.c b/ompi/mpi/c/dist_graph_create_from_group.c deleted file mode 100644 index 96a841edd32..00000000000 --- a/ompi/mpi/c/dist_graph_create_from_group.c +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2012-2018 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2012-2013 Inria. All rights reserved. - * Copyright (c) 2013 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2015 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2017 IBM Corporation. All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - */ - -#include "ompi_config.h" - -#include "ompi/mpi/c/bindings.h" -#include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" -#include "ompi/errhandler/errhandler.h" -#include "ompi/memchecker.h" -#include "ompi/mca/topo/topo.h" -#include "ompi/mca/topo/base/base.h" - -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Dist_graph_create_from_group = PMPI_Dist_graph_create_from_group -#endif -#define MPI_Dist_graph_create_from_group PMPI_Dist_graph_create_from_group -#endif - -static const char FUNC_NAME[] = "MPI_Dist_graph_create_from_group"; - -int MPI_Dist_graph_create_from_group (MPI_Group group, const char *tag, MPI_Errhandler errhandler, - int n, const int sources[], const int degrees[], const int destinations[], - const int weights[], MPI_Info info, int reorder, MPI_Comm * newcomm) -{ - mca_topo_base_module_t* topo; - int index, err, group_size; - - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - - if (NULL == group) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_GROUP, FUNC_NAME); - } - if (NULL == tag) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_TAG, FUNC_NAME); - } - if (NULL == info || ompi_info_is_freed(info)) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_INFO, FUNC_NAME); - } - if (n < 0 || NULL == newcomm || (n > 0 && (NULL == sources || NULL == degrees || - NULL == destinations || NULL == weights))) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_ARG, FUNC_NAME); - } - - /* Ensure the arrays are full of valid-valued integers */ - group_size = ompi_group_size (group); - for (int i = index = 0 ; i < n ; ++i) { - if (((sources[i] < 0) && (sources[i] != MPI_PROC_NULL)) || sources[i] >= group_size || degrees[i] < 0) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_ARG, FUNC_NAME); - } - for (int j = 0 ; j < degrees[i] ; ++j) { - if (((destinations[index] < 0) && (destinations[index] != MPI_PROC_NULL)) || destinations[index] >= group_size || - (MPI_UNWEIGHTED != weights && weights[index] < 0)) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_ARG, FUNC_NAME); - } - index++; - } - } - } - - /* Ensure there is a topo attached to this communicator */ - if(OMPI_SUCCESS != (err = mca_topo_base_group_select (group, NULL, &topo, OMPI_COMM_DIST_GRAPH))) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - err, FUNC_NAME); - } - - err = topo->topo.dist_graph.dist_graph_create_from_group (topo, group, tag, errhandler, n, sources, degrees, - destinations, weights, &(info->super), - reorder, newcomm); - OMPI_ERRHANDLER_RETURN(err, MPI_COMM_SELF, err, FUNC_NAME); -} - diff --git a/ompi/mpi/c/graph_create_from_group.c b/ompi/mpi/c/graph_create_from_group.c deleted file mode 100644 index d02d7f6d073..00000000000 --- a/ompi/mpi/c/graph_create_from_group.c +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2013 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights - * reserved. - * Copyright (c) 2012-2013 Inria. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ -#include "ompi_config.h" -#include - -#include "ompi/mpi/c/bindings.h" -#include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" -#include "ompi/errhandler/errhandler.h" -#include "ompi/mca/topo/base/base.h" -#include "ompi/memchecker.h" - -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Graph_create_from_group = PMPI_Graph_create_from_group -#endif -#define MPI_Graph_create_from_group PMPI_Graph_create_from_group -#endif - -static const char FUNC_NAME[] = "MPI_Graph_create_from_group"; - - -int MPI_Graph_create_from_group (MPI_Group group, const char *tag, MPI_Info info, - MPI_Errhandler errhandler, int nnodes, const int indx[], - const int edges[], int reorder, MPI_Comm *comm_graph) -{ - mca_topo_base_module_t *topo; - int err; - - /* check the arguments */ - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if (NULL == group) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_GROUP, FUNC_NAME); - } - if (NULL == tag) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_TAG, FUNC_NAME); - } - if (NULL == info || ompi_info_is_freed(info)) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_INFO, FUNC_NAME); - } - if (nnodes < 0 || (nnodes > 0 && ((NULL == indx) || (NULL == edges))) || nnodes > group->grp_proc_count) { - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - MPI_ERR_ARG, FUNC_NAME); - } - } - - - /* MPI-2.1 7.5.3 states that if nnodes == 0, all processes should - get MPI_COMM_NULL. MPI-4.0 states if a process is not part of the - group it gets MPI_COMM_NULL */ - if (MPI_UNDEFINED == group->grp_my_rank || 0 == nnodes) { - *comm_graph = MPI_COMM_NULL; - return MPI_SUCCESS; - } - - /* - * everything seems to be alright with the communicator, we can go - * ahead and select a topology module for this purpose and create - * the new graph communicator - */ - if (OMPI_SUCCESS != (err = mca_topo_base_group_select (group, NULL, &topo, OMPI_COMM_GRAPH))) { - return err; - } - - /* Now let that topology module rearrange procs/ranks if it wants to */ - err = topo->topo.graph.graph_create_from_group (topo, group, tag, &info->super, errhandler, - nnodes, indx, edges, !reorder, comm_graph); - - if (MPI_SUCCESS != err) { - OBJ_RELEASE(topo); - return ompi_errhandler_invoke (errhandler, MPI_COMM_SELF, errhandler->eh_mpi_object_type, - err, FUNC_NAME); - } - - /* All done */ - return MPI_SUCCESS; -} diff --git a/ompi/mpi/c/profile/Makefile.am b/ompi/mpi/c/profile/Makefile.am index 4936ef30aac..f5c37ee5585 100644 --- a/ompi/mpi/c/profile/Makefile.am +++ b/ompi/mpi/c/profile/Makefile.am @@ -72,7 +72,6 @@ nodist_libmpi_c_pmpi_la_SOURCES = \ pcancel.c \ pcart_coords.c \ pcart_create.c \ - pcart_create_from_group.c \ pcartdim_get.c \ pcart_get.c \ pcart_map.c \ @@ -111,9 +110,7 @@ nodist_libmpi_c_pmpi_la_SOURCES = \ pcomm_set_attr.c \ pcomm_set_info.c \ pdist_graph_create.c \ - pdist_graph_create_from_group.c \ pdist_graph_create_adjacent.c \ - pdist_graph_create_adjacent_from_group.c \ pdist_graph_neighbors.c \ pdist_graph_neighbors_count.c \ pcomm_set_errhandler.c \ @@ -211,7 +208,6 @@ nodist_libmpi_c_pmpi_la_SOURCES = \ pget_processor_name.c \ pget_version.c \ pgraph_create.c \ - pgraph_create_from_group.c \ pgraph_get.c \ pgraph_map.c \ pgraph_neighbors_count.c \ diff --git a/ompi/mpi/c/win_create_dynamic_from_group.c b/ompi/mpi/c/win_create_dynamic_from_group.c deleted file mode 100644 index cc1ad5e35bd..00000000000 --- a/ompi/mpi/c/win_create_dynamic_from_group.c +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2017 IBM Corporation. All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "ompi_config.h" - -#include - -#include "ompi/mpi/c/bindings.h" -#include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" -#include "ompi/errhandler/errhandler.h" -#include "ompi/info/info.h" -#include "ompi/win/win.h" -#include "ompi/memchecker.h" - -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_create_dynamic_from_group = PMPI_Win_create_dynamic_from_group -#endif -#define MPI_Win_create_dynamic_from_group PMPI_Win_create_dynamic_from_group -#endif - -static const char FUNC_NAME[] = "MPI_Win_create_dynamic_from_group"; - - -int MPI_Win_create_dynamic_from_group (MPI_Info info, MPI_Group group, const char *tag, - MPI_Win *win) -{ - int ret; - - /* argument checking */ - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - - if (NULL == group) { - return MPI_ERR_GROUP; - } else if (NULL == info || ompi_info_is_freed(info)) { - return MPI_ERR_INFO; - } else if (NULL == win) { - return MPI_ERR_WIN; - } else if (NULL == tag) { - return MPI_ERR_TAG; - } - } - - /* create_dynamic_from_group window and return */ - ret = ompi_win_create_dynamic_from_group (&(info->super), group, tag, win); - if (OMPI_SUCCESS != ret) { - *win = MPI_WIN_NULL; - return ompi_errcode_get_mpi_code (ret); - } - - return MPI_SUCCESS; -} diff --git a/ompi/mpi/c/win_create_from_group.c b/ompi/mpi/c/win_create_from_group.c deleted file mode 100644 index d2636bc7fbe..00000000000 --- a/ompi/mpi/c/win_create_from_group.c +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ -/* - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * Copyright (c) 2006 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science - * and Technology (RIST). All rights reserved. - * Copyright (c) 2017 IBM Corporation. All rights reserved. - * Copyright (c) 2018 Triad National Security, LLC. All rights - * reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ -#include "ompi_config.h" - -#include - -#include "ompi/mpi/c/bindings.h" -#include "ompi/runtime/params.h" -#include "ompi/communicator/communicator.h" -#include "ompi/errhandler/errhandler.h" -#include "ompi/info/info.h" -#include "ompi/win/win.h" -#include "ompi/memchecker.h" - -#if OMPI_BUILD_MPI_PROFILING -#if OPAL_HAVE_WEAK_SYMBOLS -#pragma weak MPI_Win_create_from_group = PMPI_Win_create_from_group -#endif -#define MPI_Win_create_from_group PMPI_Win_create_from_group -#endif - -static const char FUNC_NAME[] = "MPI_Win_create_from_group"; - - -int MPI_Win_create_from_group (void *base, MPI_Aint size, int disp_unit, MPI_Info info, - MPI_Group group, const char *tag, MPI_Win *win) -{ - int ret; - - /* argument checking */ - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - - if (NULL == group) { - return MPI_ERR_GROUP; - } else if (NULL == info || ompi_info_is_freed(info)) { - return MPI_ERR_INFO; - } else if (NULL == win) { - return MPI_ERR_WIN; - } else if ( size < 0 ) { - return MPI_ERR_SIZE; - } else if ( disp_unit <= 0 ) { - return MPI_ERR_DISP; - } else if (NULL == tag) { - return MPI_ERR_TAG; - } - } - - /* create window and return */ - ret = ompi_win_create_from_group (base, (size_t)size, disp_unit, group, tag, - &info->super, win); - if (OMPI_SUCCESS != ret) { - *win = MPI_WIN_NULL; - return ompi_errcode_get_mpi_code (ret); - } - - return MPI_SUCCESS; -}