Skip to content

Commit

Permalink
sessions: remove topo from group related funcs
Browse files Browse the repository at this point in the history
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  #58
Related to #54

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
  • Loading branch information
hppritcha committed Aug 3, 2021
1 parent 0d2aa87 commit fe1f1bf
Show file tree
Hide file tree
Showing 16 changed files with 0 additions and 862 deletions.
36 changes: 0 additions & 36 deletions ompi/include/mpi.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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[],
Expand Down Expand Up @@ -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[],
Expand All @@ -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,
Expand Down Expand Up @@ -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[],
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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[],
Expand All @@ -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,
Expand All @@ -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[],
Expand Down Expand Up @@ -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[],
Expand Down Expand Up @@ -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,
Expand Down
28 changes: 0 additions & 28 deletions ompi/mca/topo/base/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
55 changes: 0 additions & 55 deletions ompi/mca/topo/base/topo_base_cart_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 0 additions & 12 deletions ompi/mca/topo/base/topo_base_comm_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down
28 changes: 0 additions & 28 deletions ompi/mca/topo/base/topo_base_dist_graph_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 0 additions & 18 deletions ompi/mca/topo/base/topo_base_dist_graph_create_adjacent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Loading

0 comments on commit fe1f1bf

Please sign in to comment.