topo: do not cast way the const modifier when this is not necessary
update the topo framework and mpi c bindings
Этот коммит содержится в:
родитель
3a446c9797
Коммит
43ef261d46
@ -13,7 +13,7 @@
|
|||||||
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||||
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
|
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
||||||
* Copyright (c) 2014 Research Organization for Information Science
|
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||||
* and Technology (RIST). All rights reserved.
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -73,8 +73,8 @@ OMPI_DECLSPEC int
|
|||||||
mca_topo_base_cart_create(mca_topo_base_module_t *topo_module,
|
mca_topo_base_cart_create(mca_topo_base_module_t *topo_module,
|
||||||
ompi_communicator_t* old_comm,
|
ompi_communicator_t* old_comm,
|
||||||
int ndims,
|
int ndims,
|
||||||
int *dims,
|
const int *dims,
|
||||||
int *periods,
|
const int *periods,
|
||||||
bool reorder,
|
bool reorder,
|
||||||
ompi_communicator_t** comm_topo);
|
ompi_communicator_t** comm_topo);
|
||||||
|
|
||||||
@ -98,11 +98,11 @@ mca_topo_base_cart_get(ompi_communicator_t *comm,
|
|||||||
OMPI_DECLSPEC int
|
OMPI_DECLSPEC int
|
||||||
mca_topo_base_cart_map(ompi_communicator_t * comm,
|
mca_topo_base_cart_map(ompi_communicator_t * comm,
|
||||||
int ndims,
|
int ndims,
|
||||||
int *dims, int *periods, int *newrank);
|
const int *dims, const int *periods, int *newrank);
|
||||||
|
|
||||||
OMPI_DECLSPEC int
|
OMPI_DECLSPEC int
|
||||||
mca_topo_base_cart_rank(ompi_communicator_t *comm,
|
mca_topo_base_cart_rank(ompi_communicator_t *comm,
|
||||||
int *coords,
|
const int *coords,
|
||||||
int *rank);
|
int *rank);
|
||||||
|
|
||||||
OMPI_DECLSPEC int
|
OMPI_DECLSPEC int
|
||||||
@ -114,7 +114,7 @@ mca_topo_base_cart_shift(ompi_communicator_t *comm,
|
|||||||
|
|
||||||
OMPI_DECLSPEC int
|
OMPI_DECLSPEC int
|
||||||
mca_topo_base_cart_sub(ompi_communicator_t *comm,
|
mca_topo_base_cart_sub(ompi_communicator_t *comm,
|
||||||
int *remain_dims,
|
const int *remain_dims,
|
||||||
ompi_communicator_t **new_comm);
|
ompi_communicator_t **new_comm);
|
||||||
|
|
||||||
OMPI_DECLSPEC int
|
OMPI_DECLSPEC int
|
||||||
@ -126,8 +126,8 @@ OMPI_DECLSPEC int
|
|||||||
mca_topo_base_graph_create(mca_topo_base_module_t *topo_module,
|
mca_topo_base_graph_create(mca_topo_base_module_t *topo_module,
|
||||||
ompi_communicator_t* old_comm,
|
ompi_communicator_t* old_comm,
|
||||||
int nnodes,
|
int nnodes,
|
||||||
int *index,
|
const int *index,
|
||||||
int *edges,
|
const int *edges,
|
||||||
bool reorder,
|
bool reorder,
|
||||||
ompi_communicator_t** new_comm);
|
ompi_communicator_t** new_comm);
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ mca_topo_base_graph_get(ompi_communicator_t *comm,
|
|||||||
OMPI_DECLSPEC int
|
OMPI_DECLSPEC int
|
||||||
mca_topo_base_graph_map(ompi_communicator_t * comm,
|
mca_topo_base_graph_map(ompi_communicator_t * comm,
|
||||||
int nnodes,
|
int nnodes,
|
||||||
int *index, int *edges, int *newrank);
|
const int *index, const int *edges, int *newrank);
|
||||||
|
|
||||||
OMPI_DECLSPEC int
|
OMPI_DECLSPEC int
|
||||||
mca_topo_base_graph_neighbors(ompi_communicator_t *comm,
|
mca_topo_base_graph_neighbors(ompi_communicator_t *comm,
|
||||||
@ -161,25 +161,25 @@ mca_topo_base_graph_neighbors_count(ompi_communicator_t *comm,
|
|||||||
OMPI_DECLSPEC int
|
OMPI_DECLSPEC int
|
||||||
mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
|
mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
|
||||||
ompi_communicator_t *comm,
|
ompi_communicator_t *comm,
|
||||||
int n, int nodes[],
|
int n, const int nodes[],
|
||||||
int degrees[], int targets[],
|
const int degrees[], const int targets[],
|
||||||
int weights[],
|
const int weights[],
|
||||||
mca_topo_base_comm_dist_graph_2_2_0_t** ptopo);
|
mca_topo_base_comm_dist_graph_2_2_0_t** ptopo);
|
||||||
|
|
||||||
OMPI_DECLSPEC int
|
OMPI_DECLSPEC int
|
||||||
mca_topo_base_dist_graph_create(mca_topo_base_module_t* module,
|
mca_topo_base_dist_graph_create(mca_topo_base_module_t* module,
|
||||||
ompi_communicator_t *old_comm,
|
ompi_communicator_t *old_comm,
|
||||||
int n, int nodes[],
|
int n, const int nodes[],
|
||||||
int degrees[], int targets[], int weights[],
|
const int degrees[], const int targets[], const int weights[],
|
||||||
ompi_info_t *info, int reorder,
|
ompi_info_t *info, int reorder,
|
||||||
ompi_communicator_t **new_comm);
|
ompi_communicator_t **new_comm);
|
||||||
|
|
||||||
OMPI_DECLSPEC int
|
OMPI_DECLSPEC int
|
||||||
mca_topo_base_dist_graph_create_adjacent(mca_topo_base_module_t* module,
|
mca_topo_base_dist_graph_create_adjacent(mca_topo_base_module_t* module,
|
||||||
ompi_communicator_t *old_comm,
|
ompi_communicator_t *old_comm,
|
||||||
int indegree, int sources[],
|
int indegree, const int sources[],
|
||||||
int sourceweights[], int outdegree,
|
const int sourceweights[], int outdegree,
|
||||||
int destinations[], int destweights[],
|
const int destinations[], const int destweights[],
|
||||||
ompi_info_t *info, int reorder,
|
ompi_info_t *info, int reorder,
|
||||||
ompi_communicator_t **comm_dist_graph);
|
ompi_communicator_t **comm_dist_graph);
|
||||||
|
|
||||||
|
@ -50,12 +50,12 @@
|
|||||||
int mca_topo_base_cart_create(mca_topo_base_module_t *topo,
|
int mca_topo_base_cart_create(mca_topo_base_module_t *topo,
|
||||||
ompi_communicator_t* old_comm,
|
ompi_communicator_t* old_comm,
|
||||||
int ndims,
|
int ndims,
|
||||||
int *dims,
|
const int *dims,
|
||||||
int *periods,
|
const int *periods,
|
||||||
bool reorder,
|
bool reorder,
|
||||||
ompi_communicator_t** comm_topo)
|
ompi_communicator_t** comm_topo)
|
||||||
{
|
{
|
||||||
int nprocs = 1, i, *p, new_rank, num_procs, ret;
|
int nprocs = 1, i, new_rank, num_procs, ret;
|
||||||
ompi_communicator_t *new_comm;
|
ompi_communicator_t *new_comm;
|
||||||
ompi_proc_t **topo_procs = NULL;
|
ompi_proc_t **topo_procs = NULL;
|
||||||
mca_topo_base_comm_cart_2_2_0_t* cart;
|
mca_topo_base_comm_cart_2_2_0_t* cart;
|
||||||
@ -65,12 +65,11 @@ int mca_topo_base_cart_create(mca_topo_base_module_t *topo,
|
|||||||
assert(topo->type == OMPI_COMM_CART);
|
assert(topo->type == OMPI_COMM_CART);
|
||||||
|
|
||||||
/* Calculate the number of processes in this grid */
|
/* Calculate the number of processes in this grid */
|
||||||
p = dims;
|
for (i = 0; i < ndims; ++i) {
|
||||||
for (i = 0; i < ndims; ++i, ++p) {
|
if(dims[i] <= 0) {
|
||||||
if(*p <= 0) {
|
|
||||||
return OMPI_ERROR;
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
nprocs *= *p;
|
nprocs *= dims[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for the error condition */
|
/* check for the error condition */
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
* Copyright (c) 2015 Research Organization for Information Science
|
||||||
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -38,19 +40,19 @@
|
|||||||
|
|
||||||
int mca_topo_base_cart_map(ompi_communicator_t* comm,
|
int mca_topo_base_cart_map(ompi_communicator_t* comm,
|
||||||
int ndims,
|
int ndims,
|
||||||
int *dims, int *periods, int *newrank)
|
const int *dims, const int *periods, int *newrank)
|
||||||
{
|
{
|
||||||
int nprocs, rank, size, i, *p;
|
int nprocs, rank, size, i;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compute the # of processes in the grid.
|
* Compute the # of processes in the grid.
|
||||||
*/
|
*/
|
||||||
nprocs = 1;
|
nprocs = 1;
|
||||||
for (i = 0, p = dims; i < ndims; ++i, ++p) {
|
for (i = 0 ; i < ndims; ++i) {
|
||||||
if (*p <= 0) {
|
if (dims[i] <= 0) {
|
||||||
return MPI_ERR_DIMS;
|
return MPI_ERR_DIMS;
|
||||||
}
|
}
|
||||||
nprocs *= *p;
|
nprocs *= dims[i];
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Check that number of processes <= size of communicator.
|
* Check that number of processes <= size of communicator.
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. 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$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -38,7 +40,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int mca_topo_base_cart_rank(ompi_communicator_t* comm,
|
int mca_topo_base_cart_rank(ompi_communicator_t* comm,
|
||||||
int *coords,
|
const int *coords,
|
||||||
int *rank)
|
int *rank)
|
||||||
{
|
{
|
||||||
int prank;
|
int prank;
|
||||||
@ -47,7 +49,6 @@ int mca_topo_base_cart_rank(ompi_communicator_t* comm,
|
|||||||
int factor;
|
int factor;
|
||||||
int i;
|
int i;
|
||||||
int *d;
|
int *d;
|
||||||
int *c;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Loop over coordinates computing the rank.
|
* Loop over coordinates computing the rank.
|
||||||
@ -57,11 +58,10 @@ int mca_topo_base_cart_rank(ompi_communicator_t* comm,
|
|||||||
|
|
||||||
i = comm->c_topo->mtc.cart->ndims - 1;
|
i = comm->c_topo->mtc.cart->ndims - 1;
|
||||||
d = comm->c_topo->mtc.cart->dims + i;
|
d = comm->c_topo->mtc.cart->dims + i;
|
||||||
c = coords + i;
|
|
||||||
|
|
||||||
for (; i >= 0; --i, --c, --d) {
|
for (; i >= 0; --i, --d) {
|
||||||
dim = *d;
|
dim = *d;
|
||||||
ord = *c;
|
ord = coords[i];
|
||||||
/* Per MPI-2.1 7.5.4 (description of MPI_CART_RANK), if the
|
/* Per MPI-2.1 7.5.4 (description of MPI_CART_RANK), if the
|
||||||
dimension is periodic and the coordinate is outside of 0 <=
|
dimension is periodic and the coordinate is outside of 0 <=
|
||||||
coord(i) < dim, then normalize it. If the dimension is not
|
coord(i) < dim, then normalize it. If the dimension is not
|
||||||
|
@ -43,14 +43,14 @@
|
|||||||
* @retval MPI_ERR_COMM
|
* @retval MPI_ERR_COMM
|
||||||
*/
|
*/
|
||||||
int mca_topo_base_cart_sub (ompi_communicator_t* comm,
|
int mca_topo_base_cart_sub (ompi_communicator_t* comm,
|
||||||
int *remain_dims,
|
const int *remain_dims,
|
||||||
ompi_communicator_t** new_comm)
|
ompi_communicator_t** new_comm)
|
||||||
{
|
{
|
||||||
struct ompi_communicator_t *temp_comm;
|
struct ompi_communicator_t *temp_comm;
|
||||||
mca_topo_base_comm_cart_2_2_0_t *old_cart;
|
mca_topo_base_comm_cart_2_2_0_t *old_cart;
|
||||||
int errcode, colour, key, colfactor, keyfactor;
|
int errcode, colour, key, colfactor, keyfactor;
|
||||||
int ndim, dim, i;
|
int ndim, dim, i;
|
||||||
int *d, *dorig = NULL, *dold, *c, *r, *p, *porig = NULL, *pold;
|
int *d, *dorig = NULL, *dold, *c, *p, *porig = NULL, *pold;
|
||||||
mca_topo_base_module_t* topo;
|
mca_topo_base_module_t* topo;
|
||||||
mca_topo_base_comm_cart_2_2_0_t* cart;
|
mca_topo_base_comm_cart_2_2_0_t* cart;
|
||||||
|
|
||||||
@ -67,11 +67,10 @@ int mca_topo_base_cart_sub (ompi_communicator_t* comm,
|
|||||||
i = old_cart->ndims - 1;
|
i = old_cart->ndims - 1;
|
||||||
d = old_cart->dims + i;
|
d = old_cart->dims + i;
|
||||||
c = comm->c_topo->mtc.cart->coords + i;
|
c = comm->c_topo->mtc.cart->coords + i;
|
||||||
r = remain_dims + i;
|
|
||||||
|
|
||||||
for (; i >= 0; --i, --d, --c, --r) {
|
for (; i >= 0; --i, --d, --c) {
|
||||||
dim = *d;
|
dim = *d;
|
||||||
if (*r == 0) {
|
if (remain_dims[i] == 0) {
|
||||||
colour += colfactor * (*c);
|
colour += colfactor * (*c);
|
||||||
colfactor *= dim;
|
colfactor *= dim;
|
||||||
} else {
|
} else {
|
||||||
@ -110,9 +109,8 @@ int mca_topo_base_cart_sub (ompi_communicator_t* comm,
|
|||||||
/* Copy the periods */
|
/* Copy the periods */
|
||||||
porig = p = (int*)malloc(ndim * sizeof(int));
|
porig = p = (int*)malloc(ndim * sizeof(int));
|
||||||
pold = old_cart->periods;
|
pold = old_cart->periods;
|
||||||
r = remain_dims;
|
for (i = 0; i < old_cart->ndims; ++i, ++dold, ++pold) {
|
||||||
for (i = 0; i < old_cart->ndims; ++i, ++dold, ++pold, ++r) {
|
if (remain_dims[i]) {
|
||||||
if (*r) {
|
|
||||||
*d++ = *dold;
|
*d++ = *dold;
|
||||||
*p++ = *pold;
|
*p++ = *pold;
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,9 @@ typedef struct _dist_graph_elem {
|
|||||||
|
|
||||||
int mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
|
int mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
|
||||||
ompi_communicator_t *comm,
|
ompi_communicator_t *comm,
|
||||||
int n, int nodes[],
|
int n, const int nodes[],
|
||||||
int degrees[], int targets[],
|
const int degrees[], const int targets[],
|
||||||
int weights[],
|
const int weights[],
|
||||||
mca_topo_base_comm_dist_graph_2_2_0_t** ptopo)
|
mca_topo_base_comm_dist_graph_2_2_0_t** ptopo)
|
||||||
{
|
{
|
||||||
int i, j, err, count, left_over, pending_reqs, current_pos, index, csize;
|
int i, j, err, count, left_over, pending_reqs, current_pos, index, csize;
|
||||||
@ -280,9 +280,9 @@ int mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
|
|||||||
|
|
||||||
int mca_topo_base_dist_graph_create(mca_topo_base_module_t* module,
|
int mca_topo_base_dist_graph_create(mca_topo_base_module_t* module,
|
||||||
ompi_communicator_t *comm_old,
|
ompi_communicator_t *comm_old,
|
||||||
int n, int nodes[],
|
int n, const int nodes[],
|
||||||
int degrees[], int targets[],
|
const int degrees[], const int targets[],
|
||||||
int weights[],
|
const int weights[],
|
||||||
ompi_info_t *info, int reorder,
|
ompi_info_t *info, int reorder,
|
||||||
ompi_communicator_t **newcomm)
|
ompi_communicator_t **newcomm)
|
||||||
{
|
{
|
||||||
|
@ -21,11 +21,11 @@
|
|||||||
|
|
||||||
int mca_topo_base_dist_graph_create_adjacent(mca_topo_base_module_t* module,
|
int mca_topo_base_dist_graph_create_adjacent(mca_topo_base_module_t* module,
|
||||||
ompi_communicator_t *comm_old,
|
ompi_communicator_t *comm_old,
|
||||||
int indegree, int sources[],
|
int indegree, const int sources[],
|
||||||
int sourceweights[],
|
const int sourceweights[],
|
||||||
int outdegree,
|
int outdegree,
|
||||||
int destinations[],
|
const int destinations[],
|
||||||
int destweights[],
|
const int destweights[],
|
||||||
ompi_info_t *info, int reorder,
|
ompi_info_t *info, int reorder,
|
||||||
ompi_communicator_t **newcomm)
|
ompi_communicator_t **newcomm)
|
||||||
{
|
{
|
||||||
|
@ -43,8 +43,8 @@
|
|||||||
int mca_topo_base_graph_create(mca_topo_base_module_t *topo,
|
int mca_topo_base_graph_create(mca_topo_base_module_t *topo,
|
||||||
ompi_communicator_t* old_comm,
|
ompi_communicator_t* old_comm,
|
||||||
int nnodes,
|
int nnodes,
|
||||||
int *index,
|
const int *index,
|
||||||
int *edges,
|
const int *edges,
|
||||||
bool reorder,
|
bool reorder,
|
||||||
ompi_communicator_t** comm_topo)
|
ompi_communicator_t** comm_topo)
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. 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$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -38,7 +40,7 @@
|
|||||||
|
|
||||||
int mca_topo_base_graph_map(ompi_communicator_t * comm,
|
int mca_topo_base_graph_map(ompi_communicator_t * comm,
|
||||||
int nnodes,
|
int nnodes,
|
||||||
int *index, int *edges, int *newrank)
|
const int *index, const int *edges, int *newrank)
|
||||||
{
|
{
|
||||||
int myrank;
|
int myrank;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
||||||
* Copyright (c) 2014 Research Organization for Information Science
|
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||||
* and Technology (RIST). All rights reserved.
|
* and Technology (RIST). All rights reserved.
|
||||||
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
@ -155,8 +155,8 @@ typedef int (*mca_topo_base_module_cart_create_fn_t)
|
|||||||
(mca_topo_base_module_t *topo_module,
|
(mca_topo_base_module_t *topo_module,
|
||||||
ompi_communicator_t* old_comm,
|
ompi_communicator_t* old_comm,
|
||||||
int ndims,
|
int ndims,
|
||||||
int *dims,
|
const int *dims,
|
||||||
int *periods,
|
const int *periods,
|
||||||
bool reorder,
|
bool reorder,
|
||||||
ompi_communicator_t** comm_topo);
|
ompi_communicator_t** comm_topo);
|
||||||
|
|
||||||
@ -177,14 +177,14 @@ typedef int (*mca_topo_base_module_cartdim_get_fn_t)
|
|||||||
typedef int (*mca_topo_base_module_cart_map_fn_t)
|
typedef int (*mca_topo_base_module_cart_map_fn_t)
|
||||||
(struct ompi_communicator_t *comm,
|
(struct ompi_communicator_t *comm,
|
||||||
int ndims,
|
int ndims,
|
||||||
int *dims,
|
const int *dims,
|
||||||
int *periods,
|
const int *periods,
|
||||||
int *newrank);
|
int *newrank);
|
||||||
|
|
||||||
/* Back end for MPI_CART_RANK */
|
/* Back end for MPI_CART_RANK */
|
||||||
typedef int (*mca_topo_base_module_cart_rank_fn_t)
|
typedef int (*mca_topo_base_module_cart_rank_fn_t)
|
||||||
(struct ompi_communicator_t *comm,
|
(struct ompi_communicator_t *comm,
|
||||||
int *coords,
|
const int *coords,
|
||||||
int *rank);
|
int *rank);
|
||||||
|
|
||||||
/* Back end for MPI_CART_SHIFT */
|
/* Back end for MPI_CART_SHIFT */
|
||||||
@ -198,7 +198,7 @@ typedef int (*mca_topo_base_module_cart_shift_fn_t)
|
|||||||
/* Back end for MPI_CART_SUB */
|
/* Back end for MPI_CART_SUB */
|
||||||
typedef int (*mca_topo_base_module_cart_sub_fn_t)
|
typedef int (*mca_topo_base_module_cart_sub_fn_t)
|
||||||
(struct ompi_communicator_t *comm,
|
(struct ompi_communicator_t *comm,
|
||||||
int *remain_dims,
|
const int *remain_dims,
|
||||||
struct ompi_communicator_t ** new_comm);
|
struct ompi_communicator_t ** new_comm);
|
||||||
|
|
||||||
/* Back end for MPI_GRAPH_CREATE */
|
/* Back end for MPI_GRAPH_CREATE */
|
||||||
@ -206,8 +206,8 @@ typedef int (*mca_topo_base_module_graph_create_fn_t)
|
|||||||
(mca_topo_base_module_t *topo_module,
|
(mca_topo_base_module_t *topo_module,
|
||||||
ompi_communicator_t* old_comm,
|
ompi_communicator_t* old_comm,
|
||||||
int nnodes,
|
int nnodes,
|
||||||
int *index,
|
const int *index,
|
||||||
int *edges,
|
const int *edges,
|
||||||
bool reorder,
|
bool reorder,
|
||||||
ompi_communicator_t** new_comm);
|
ompi_communicator_t** new_comm);
|
||||||
|
|
||||||
@ -223,8 +223,8 @@ typedef int (*mca_topo_base_module_graph_get_fn_t)
|
|||||||
typedef int (*mca_topo_base_module_graph_map_fn_t)
|
typedef int (*mca_topo_base_module_graph_map_fn_t)
|
||||||
(struct ompi_communicator_t *comm,
|
(struct ompi_communicator_t *comm,
|
||||||
int nnodes,
|
int nnodes,
|
||||||
int *index,
|
const int *index,
|
||||||
int *edges,
|
const int *edges,
|
||||||
int *newrank);
|
int *newrank);
|
||||||
|
|
||||||
/* Back end for MPI_GRAPHDIMS_GET */
|
/* Back end for MPI_GRAPHDIMS_GET */
|
||||||
@ -250,8 +250,8 @@ typedef int (*mca_topo_base_module_graph_neighbors_count_fn_t)
|
|||||||
typedef int (*mca_topo_base_module_dist_graph_create_fn_t)
|
typedef int (*mca_topo_base_module_dist_graph_create_fn_t)
|
||||||
(struct mca_topo_base_module_t* module,
|
(struct mca_topo_base_module_t* module,
|
||||||
struct ompi_communicator_t *old_comm,
|
struct ompi_communicator_t *old_comm,
|
||||||
int n, int nodes[],
|
int n, const int nodes[],
|
||||||
int degrees[], int targets[], int weights[],
|
const int degrees[], const int targets[], const int weights[],
|
||||||
struct ompi_info_t *info, int reorder,
|
struct ompi_info_t *info, int reorder,
|
||||||
struct ompi_communicator_t **new_comm);
|
struct ompi_communicator_t **new_comm);
|
||||||
|
|
||||||
@ -259,11 +259,11 @@ typedef int (*mca_topo_base_module_dist_graph_create_fn_t)
|
|||||||
typedef int (*mca_topo_base_module_dist_graph_create_adjacent_fn_t)
|
typedef int (*mca_topo_base_module_dist_graph_create_adjacent_fn_t)
|
||||||
(struct mca_topo_base_module_t* module,
|
(struct mca_topo_base_module_t* module,
|
||||||
ompi_communicator_t *comm_old,
|
ompi_communicator_t *comm_old,
|
||||||
int indegree, int sources[],
|
int indegree, const int sources[],
|
||||||
int sourceweights[],
|
const int sourceweights[],
|
||||||
int outdegree,
|
int outdegree,
|
||||||
int destinations[],
|
const int destinations[],
|
||||||
int destweights[],
|
const int destweights[],
|
||||||
struct ompi_info_t *info, int reorder,
|
struct ompi_info_t *info, int reorder,
|
||||||
ompi_communicator_t **comm_dist_graph);
|
ompi_communicator_t **comm_dist_graph);
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2011-2015 INRIA. All rights reserved.
|
* Copyright (c) 2011-2015 INRIA. All rights reserved.
|
||||||
* Copyright (c) 2011-2015 Bordeaux Polytechnic Institute
|
* Copyright (c) 2011-2015 Bordeaux Polytechnic Institute
|
||||||
|
* Copyright (c) 2015 Research Organization for Information Science
|
||||||
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -64,9 +66,9 @@ OBJ_CLASS_DECLARATION(mca_topo_treematch_module_t);
|
|||||||
|
|
||||||
int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* module,
|
int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* module,
|
||||||
ompi_communicator_t *comm_old,
|
ompi_communicator_t *comm_old,
|
||||||
int n, int nodes[],
|
int n, const int nodes[],
|
||||||
int degrees[], int targets[],
|
const int degrees[], const int targets[],
|
||||||
int weights[],
|
const int weights[],
|
||||||
struct ompi_info_t *info, int reorder,
|
struct ompi_info_t *info, int reorder,
|
||||||
ompi_communicator_t **newcomm);
|
ompi_communicator_t **newcomm);
|
||||||
/*
|
/*
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
* Copyright (c) 2011-2015 INRIA. All rights reserved.
|
* Copyright (c) 2011-2015 INRIA. All rights reserved.
|
||||||
* Copyright (c) 2012-2015 Bordeaux Poytechnic Institute
|
* Copyright (c) 2012-2015 Bordeaux Poytechnic Institute
|
||||||
* Copyright (c) 2015 Intel, Inc. All rights reserved
|
* Copyright (c) 2015 Intel, Inc. All rights reserved
|
||||||
|
* Copyright (c) 2015 Research Organization for Information Science
|
||||||
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -97,9 +99,9 @@ static int check_oversubscribing(int rank,
|
|||||||
|
|
||||||
int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
|
int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
|
||||||
ompi_communicator_t *comm_old,
|
ompi_communicator_t *comm_old,
|
||||||
int n, int nodes[],
|
int n, const int nodes[],
|
||||||
int degrees[], int targets[],
|
const int degrees[], const int targets[],
|
||||||
int weights[],
|
const int weights[],
|
||||||
struct ompi_info_t *info, int reorder,
|
struct ompi_info_t *info, int reorder,
|
||||||
ompi_communicator_t **newcomm)
|
ompi_communicator_t **newcomm)
|
||||||
{
|
{
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. 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$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -100,9 +102,8 @@ int MPI_Cart_create(MPI_Comm old_comm, int ndims, const int dims[],
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now let that topology module rearrange procs/ranks if it wants to */
|
/* Now let that topology module rearrange procs/ranks if it wants to */
|
||||||
/* XXX -- CONST -- do not cast away const -- update mca/topo */
|
|
||||||
err = topo->topo.cart.cart_create(topo, old_comm,
|
err = topo->topo.cart.cart_create(topo, old_comm,
|
||||||
ndims, (int *) dims, (int *) periods,
|
ndims, dims, periods,
|
||||||
(0 == reorder) ? false : true, comm_cart);
|
(0 == reorder) ? false : true, comm_cart);
|
||||||
OPAL_CR_EXIT_LIBRARY();
|
OPAL_CR_EXIT_LIBRARY();
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. 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$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -75,9 +77,8 @@ int MPI_Cart_map(MPI_Comm comm, int ndims, const int dims[],
|
|||||||
newrank = rank */
|
newrank = rank */
|
||||||
*newrank = ompi_comm_rank(comm);
|
*newrank = ompi_comm_rank(comm);
|
||||||
} else {
|
} else {
|
||||||
/* XXX -- CONST -- do not cast away const -- update mca/topo */
|
err = comm->c_topo->topo.cart.cart_map(comm, ndims, dims,
|
||||||
err = comm->c_topo->topo.cart.cart_map(comm, ndims, (int *) dims,
|
periods, newrank);
|
||||||
(int *) periods, newrank);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OPAL_CR_EXIT_LIBRARY();
|
OPAL_CR_EXIT_LIBRARY();
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
||||||
* Copyright (c) 2014 Research Organization for Information Science
|
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||||
* and Technology (RIST). All rights reserved.
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -100,8 +100,7 @@ int MPI_Cart_rank(MPI_Comm comm, const int coords[], int *rank)
|
|||||||
}
|
}
|
||||||
OPAL_CR_ENTER_LIBRARY();
|
OPAL_CR_ENTER_LIBRARY();
|
||||||
|
|
||||||
/* XXX -- CONST -- do not cast away const -- update mca/topo */
|
err = comm->c_topo->topo.cart.cart_rank(comm, coords, rank);
|
||||||
err = comm->c_topo->topo.cart.cart_rank(comm, (int *) coords, rank);
|
|
||||||
OPAL_CR_EXIT_LIBRARY();
|
OPAL_CR_EXIT_LIBRARY();
|
||||||
|
|
||||||
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
|
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
||||||
* Copyright (c) 2014 Research Organization for Information Science
|
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||||
* and Technology (RIST). All rights reserved.
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -75,8 +75,7 @@ int MPI_Cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *new_comm)
|
|||||||
}
|
}
|
||||||
OPAL_CR_ENTER_LIBRARY();
|
OPAL_CR_ENTER_LIBRARY();
|
||||||
|
|
||||||
/* XXX -- CONST -- do not cast away const -- update mca/topo */
|
err = comm->c_topo->topo.cart.cart_sub(comm, remain_dims, new_comm);
|
||||||
err = comm->c_topo->topo.cart.cart_sub(comm, (int *) remain_dims, new_comm);
|
|
||||||
OPAL_CR_EXIT_LIBRARY();
|
OPAL_CR_EXIT_LIBRARY();
|
||||||
|
|
||||||
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
|
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
* Copyright (c) 2012-2013 Inria. All rights reserved.
|
||||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
|
* Copyright (c) 2015 Research Organization for Information Science
|
||||||
|
* and Technology (RIST). All rights reserved.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -83,9 +85,8 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
|
|||||||
return OMPI_ERRHANDLER_INVOKE(comm_old, err, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(comm_old, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX -- CONST -- do not cast away const -- update mca/topo */
|
err = topo->topo.dist_graph.dist_graph_create(topo, comm_old, n, sources, degrees,
|
||||||
err = topo->topo.dist_graph.dist_graph_create(topo, comm_old, n, (int *) sources, (int *) degrees,
|
destinations, weights, info,
|
||||||
(int *) destinations, (int *) weights, info,
|
|
||||||
reorder, newcomm);
|
reorder, newcomm);
|
||||||
OMPI_ERRHANDLER_RETURN(err, comm_old, err, FUNC_NAME);
|
OMPI_ERRHANDLER_RETURN(err, comm_old, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
* Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. 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.
|
||||||
*
|
*
|
||||||
* Author(s): Torsten Hoefler
|
* Author(s): Torsten Hoefler
|
||||||
*
|
*
|
||||||
@ -94,10 +96,9 @@ int MPI_Dist_graph_create_adjacent(MPI_Comm comm_old,
|
|||||||
return OMPI_ERRHANDLER_INVOKE(comm_old, err, FUNC_NAME);
|
return OMPI_ERRHANDLER_INVOKE(comm_old, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX -- CONST -- do not cast away const -- update mca/topo */
|
|
||||||
err = topo->topo.dist_graph.dist_graph_create_adjacent(topo, comm_old, indegree,
|
err = topo->topo.dist_graph.dist_graph_create_adjacent(topo, comm_old, indegree,
|
||||||
(int *) sources, (int *) sourceweights, outdegree,
|
sources, sourceweights, outdegree,
|
||||||
(int *) destinations, (int *) destweights, info,
|
destinations, destweights, info,
|
||||||
reorder, comm_dist_graph);
|
reorder, comm_dist_graph);
|
||||||
OMPI_ERRHANDLER_RETURN(err, comm_old, err, FUNC_NAME);
|
OMPI_ERRHANDLER_RETURN(err, comm_old, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. 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$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -100,9 +102,8 @@ int MPI_Graph_create(MPI_Comm old_comm, int nnodes, const int indx[],
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now let that topology module rearrange procs/ranks if it wants to */
|
/* Now let that topology module rearrange procs/ranks if it wants to */
|
||||||
/* XXX -- CONST -- do not cast away const -- update mca/topo */
|
|
||||||
err = topo->topo.graph.graph_create(topo, old_comm,
|
err = topo->topo.graph.graph_create(topo, old_comm,
|
||||||
nnodes, (int *) indx, (int *) edges,
|
nnodes, indx, edges,
|
||||||
(0 == reorder) ? false : true, comm_graph);
|
(0 == reorder) ? false : true, comm_graph);
|
||||||
OPAL_CR_EXIT_LIBRARY();
|
OPAL_CR_EXIT_LIBRARY();
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2012-2013 Inria. 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$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -75,8 +77,7 @@ int MPI_Graph_map(MPI_Comm comm, int nnodes, const int indx[], const int edges[]
|
|||||||
newrank = rank */
|
newrank = rank */
|
||||||
*newrank = ompi_comm_rank(comm);
|
*newrank = ompi_comm_rank(comm);
|
||||||
} else {
|
} else {
|
||||||
/* XXX -- CONST -- do not cast away const -- update mca/topo */
|
err = comm->c_topo->topo.graph.graph_map(comm, nnodes, indx, edges, newrank);
|
||||||
err = comm->c_topo->topo.graph.graph_map(comm, nnodes, (int *) indx, (int *) edges, newrank);
|
|
||||||
}
|
}
|
||||||
OPAL_CR_EXIT_LIBRARY();
|
OPAL_CR_EXIT_LIBRARY();
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user