1
1

Changing some prototypes and also changing the functions. There were some spelling mistakes and other problems. Also commiting the MPI topology functions

This commit was SVN r1075.
Этот коммит содержится в:
Prabhanjan Kambadur 2004-04-21 20:55:54 +00:00
родитель cc569843f6
Коммит ca48b3962b
21 изменённых файлов: 542 добавлений и 21 удалений

Просмотреть файл

@ -435,7 +435,7 @@ extern "C" {
int MPI_Cancel(MPI_Request *request);
int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords);
int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims,
int *periods, int redorder, MPI_Comm *comm_cart);
int *periods, int reorder, MPI_Comm *comm_cart);
int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims,
int *periods, int *coords);
int MPI_Cart_map(MPI_Comm comm, int ndims, int *dims,
@ -946,7 +946,7 @@ extern "C" {
int PMPI_Cancel(MPI_Request *request);
int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords);
int PMPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims,
int *periods, int redorder, MPI_Comm *comm_cart);
int *periods, int reorder, MPI_Comm *comm_cart);
int PMPI_Cart_get(MPI_Comm comm, int maxdims, int *dims,
int *periods, int *coords);
int PMPI_Cart_map(MPI_Comm comm, int ndims, int *dims,

Просмотреть файл

@ -145,7 +145,7 @@ static inline int lam_cube_dim(int nprocs) {
size_t size;
if (1 > nprocs) return LAM_ERROR;
for(dim = 0, size = 1; size < nprocs; ++dim, size <<= 1);
for(dim = 0, size = 1; size < (size_t)nprocs; ++dim, size <<= 1);
return dim;
}

Просмотреть файл

@ -19,7 +19,7 @@ libmca_topo_base_la_SOURCES = \
topo_base_cart_shift.c \
topo_base_cart_sub.c \
topo_base_graph_create.c \
topo_base_graph_dims_get.c \
topo_base_graphdims_get.c \
topo_base_graph_get.c \
topo_base_graph_neighbors.c \
topo_base_graph_neighbors_count.c \

Просмотреть файл

@ -79,7 +79,7 @@ extern "C" {
int reorder,
MPI_Comm *comm_graph);
int topo_base_graph_dims_get (MPI_Comm comm,
int topo_base_graphdims_get (MPI_Comm comm,
int *nodes,
int *nedges);

Просмотреть файл

@ -181,6 +181,11 @@ typedef int (*mca_topo_base_graph_map_fn_t)
int *edges,
int *newrank);
typedef int (*mca_topo_base_graphdims_get_fn_t)
(MPI_Comm comm,
int *nnodes,
int *nnedges);
typedef int (*mca_topo_base_graph_neighbors_fn_t)
(MPI_Comm comm,
int rank,
@ -223,6 +228,7 @@ struct mca_topo_1_0_0_t {
mca_topo_base_graph_create_fn_t topo_graph_create;
mca_topo_base_graph_get_fn_t topo_graph_get;
mca_topo_base_graph_map_fn_t topo_graph_map;
mca_topo_base_graphdims_get_fn_t topo_graphdims_get;
mca_topo_base_graph_neighbors_fn_t topo_graph_neighbors;
mca_topo_base_graph_neighbors_count_fn_t topo_graph_neighbors_count;
};

Просмотреть файл

@ -6,6 +6,10 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "mca/topo/topo.h"
#include "errhandler/errhandler.h"
#include "group/group.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Cart_coords = PMPI_Cart_coords
@ -16,5 +20,45 @@
#endif
int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int *coords) {
int err;
mca_topo_base_cart_coords_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_coords");
}
if (LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_coords");
}
if (!LAM_COMM_IS_CART(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY,
"MPI_Cart_coords");
}
if ( (0 > maxdims) || ((0 < maxdims) && (NULL == coords))) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Cart_coords");
}
if ((0 > rank) || (rank > lam_group_size(comm->c_local_group))) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_RANK,
"MPI_Cart_coords");
}
}
/* get the function pointer on this communicator */
func = comm->c_topo.topo_cart_coords;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Cart_coords");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm, rank, maxdims, coords))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_coords");
}
/* all done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "mca/topo/topo.h"
#include "errhandler/errhandler.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Cart_create = PMPI_Cart_create
@ -16,6 +19,43 @@
#endif
int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims,
int *periods, int redorder, MPI_Comm *comm_cart) {
int *periods, int reorder, MPI_Comm *comm_cart) {
int err;
mca_topo_base_cart_create_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == old_comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_create");
}
if (LAM_COMM_IS_INTER(old_comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_create");
}
if (1 > ndims) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_create");
}
if (NULL == dims || NULL == periods || NULL == comm_cart) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Cart_create");
}
}
/* get the function pointer to do the right thing */
func = old_comm->c_topo.topo_cart_create;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Cart_create");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(old_comm, ndims, dims, periods, reorder, comm_cart))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_create");
}
/* All done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "mca/topo/topo.h"
#include "communicator/communicator.h"
#include "errhandler/errhandler.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Cart_get = PMPI_Cart_get
@ -17,5 +20,39 @@
int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims,
int *periods, int *coords) {
/* local variables */
mca_topo_base_cart_get_fn_t func;
int err;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm || LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_get");
}
if (!LAM_COMM_IS_CART(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY,
"MPI_Cart_get");
}
if ((0 > maxdims) || (0 < maxdims &&
((NULL == dims) || (NULL == periods) || (NULL == coords)))) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Cart_get");
}
}
/* get the function pointer to do the right thing */
func = comm->c_topo.topo_cart_get;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Cart_get");
}
/* all arguments are checked and now call the back end function */
if ( MPI_SUCCESS !=
(err = func(comm, maxdims, dims, periods, coords))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_get");
}
/* All done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "mca/topo/topo.h"
#include "communicator/communicator.h"
#include "errhandler/errhandler.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Cart_map = PMPI_Cart_map
@ -17,5 +20,40 @@
int MPI_Cart_map(MPI_Comm comm, int ndims, int *dims,
int *periods, int *newrank) {
int err;
mca_topo_base_cart_map_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_map");
}
if (LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_map");
}
if(!LAM_COMM_IS_CART(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY,
"MPI_Cart_map");
}
if ((NULL == dims) || (NULL == periods) || (NULL == newrank)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Cart_map");
}
}
/* get the function pointer on this communicator */
func = comm->c_topo.topo_cart_map;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Cart_map");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm, ndims, dims, periods, newrank))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_map");
}
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "mca/topo/topo.h"
#include "communicator/communicator.h"
#include "errhandler/errhandler.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Cart_rank = PMPI_Cart_rank
@ -17,5 +20,40 @@
int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank) {
int err;
mca_topo_base_cart_rank_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_rank");
}
if (LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_rank");
}
if (!LAM_COMM_IS_CART(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY,
"MPI_Cart_rank");
}
if ((NULL == coords) || (NULL == rank)){
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Cart_rank");
}
}
/* get the function pointer on this communicator */
func = comm->c_topo.topo_cart_rank;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Cart_rank");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm, coords, rank))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_rank");
}
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "mca/topo/topo.h"
#include "errhandler/errhandler.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Cart_shift = PMPI_Cart_shift
@ -17,5 +20,45 @@
int MPI_Cart_shift(MPI_Comm comm, int direction, int disp,
int *rank_source, int *rank_dest) {
int err;
mca_topo_base_cart_shift_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_shift");
}
if (LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_shift");
}
if (!LAM_COMM_IS_CART(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY,
"MPI_Cart_shift");
}
if (0 > direction) { /* yet to detect direction >= comm->c_topo_ndims */
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_DIMS,
"MPI_Cart_shift");
}
if (NULL == rank_source || NULL == rank_dest) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Cart_shift");
}
}
/* get the function pointer on this communicator */
func = comm->c_topo.topo_cart_shift;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Cart_shift");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm, direction, disp, rank_source, rank_dest))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_shift");
}
/* all done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "mca/topo/topo.h"
#include "errhandler/errhandler.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Cart_sub = PMPI_Cart_sub
@ -17,5 +20,41 @@
int MPI_Cart_sub(MPI_Comm comm, int *remain_dims, MPI_Comm *new_comm) {
int err;
mca_topo_base_cart_sub_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_sub");
}
if (LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Cart_sub");
}
if (!LAM_COMM_IS_CART(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY,
"MPI_Cart_sub");
}
if (NULL == remain_dims || NULL == new_comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Cart_sub");
}
}
/* get the function pointer on this communicator */
func = comm->c_topo.topo_cart_sub;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Cart_sub");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm, remain_dims, new_comm))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Cart_sub");
}
/* all done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "errhandler/errhandler.h"
#include "mca/topo/topo.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Graph_create = PMPI_Graph_create
@ -17,5 +20,38 @@
int MPI_Graph_create(MPI_Comm comm_old, int nnodes, int *index,
int *edges, int reorder, MPI_Comm *comm_graph) {
int err;
mca_topo_base_graph_create_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm_old) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graph_create");
}
if (LAM_COMM_IS_INTER(comm_old)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graph_create");
}
if (1 > nnodes || NULL == index || NULL == edges) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Graph_create");
}
}
/* get the function pointer to do the right thing */
func = comm_old->c_topo.topo_graph_create;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Graph_create");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm_old, nnodes, index, edges, reorder, comm_graph))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graph_create");
}
/* All done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "errhandler/errhandler.h"
#include "mca/topo/topo.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Graph_get = PMPI_Graph_get
@ -17,5 +20,41 @@
int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges,
int *index, int *edges) {
int err;
mca_topo_base_graph_get_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graph_get");
}
if (LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graph_get");
}
if (!LAM_COMM_IS_GRAPH(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY,
"MPI_Graph_get");
}
if (0 > maxindex || 0 > maxedges || NULL == index || NULL == edges) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Graph_get");
}
}
/* get the function pointer to do the right thing */
func = comm->c_topo.topo_graph_get;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Graph_get");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm, maxindex, maxedges, index, edges))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graph_get");
}
/* All done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "errhandler/errhandler.h"
#include "mca/topo/topo.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Graph_map = PMPI_Graph_map
@ -17,5 +20,37 @@
int MPI_Graph_map(MPI_Comm comm, int nnodes, int *index, int *edges,
int *newrank) {
int err;
mca_topo_base_graph_map_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graph_map");
}
if (LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graph_map");
}
if (1 > nnodes || NULL == index || NULL == edges || NULL == newrank) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Graph_map");
}
}
/* map the function pointer to do the right thing */
func = comm->c_topo.topo_graph_map;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Graph_map");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm, nnodes, index, edges, newrank))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graph_map");
}
/* All done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "errhandler/errhandler.h"
#include "mca/topo/topo.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Graph_neighbors = PMPI_Graph_neighbors
@ -17,5 +20,46 @@
int MPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors,
int *neighbors) {
int err;
mca_topo_base_graph_neighbors_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graph_neighbors");
}
if (LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graph_neighbors");
}
if (!LAM_COMM_IS_GRAPH(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY,
"MPI_Graph_neighbors");
}
if ((0 > maxneighbors) || ((0 < maxneighbors) && NULL == neighbors)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Graph_neighbors");
}
if ((0 > rank) || (rank > lam_group_size(comm->c_local_group))) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_RANK,
"MPI_Graph_neighbors");
}
}
/* neighbors the function pointer to do the right thing */
func = comm->c_topo.topo_graph_neighbors;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Graph_neighbors");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm, rank, maxneighbors, neighbors))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graph_neighbors");
}
/* All done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "errhandler/errhandler.h"
#include "mca/topo/topo.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Graph_neighbors_count = PMPI_Graph_neighbors_count
@ -16,5 +19,45 @@
#endif
int MPI_Graph_neighbors_count(MPI_Comm comm, int rank, int *nneighbors) {
int err;
mca_topo_base_graph_neighbors_count_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graph_neighbors_count");
}
if (LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graph_neighbors_count");
}
if (!LAM_COMM_IS_GRAPH(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY,
"MPI_Graph_neighbors_count");
}
if ((0 > rank) || (rank > lam_group_size(comm->c_local_group))) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_RANK,
"MPI_Graph_neighbors");
}
if (NULL == nneighbors) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Graph_neighbors_count");
}
}
/* get the function pointer to do the right thing */
func = comm->c_topo.topo_graph_neighbors_count;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Graph_neighbors_count");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm, rank, nneighbors))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graph_neighbors_count");
}
/* All done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -6,6 +6,9 @@
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#include "errhandler/errhandler.h"
#include "mca/topo/topo.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Graphdims_get = PMPI_Graphdims_get
@ -16,5 +19,41 @@
#endif
int MPI_Graphdims_get(MPI_Comm comm, int *nnodes, int *nedges) {
int err;
mca_topo_base_graphdims_get_fn_t func;
/* check the arguments */
if (MPI_PARAM_CHECK) {
if (MPI_COMM_NULL == comm) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graphdims_get");
}
if (LAM_COMM_IS_INTER(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
"MPI_Graphdims_get");
}
if (!LAM_COMM_IS_GRAPH(comm)) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_TOPOLOGY,
"MPI_Graphdims_get");
}
if (NULL == nnodes || NULL == nedges) {
return LAM_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
"MPI_Graphdims_get");
}
}
/* get the function pointer to do the right thing */
func = comm->c_topo.topo_graphdims_get;
if (NULL == func) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
"MPI_Graphdims_get");
}
/* call the function */
if ( MPI_SUCCESS !=
(err = func(comm, nnodes, nedges))) {
return LAM_ERRHANDLER_INVOKE(MPI_COMM_WORLD, err, "MPI_Graphdims_get");
}
/* All done */
return MPI_SUCCESS;
}

Просмотреть файл

@ -20,8 +20,8 @@ LAM_GENERATE_F77_BINDINGS (PMPI_CART_CREATE,
pmpi_cart_create_,
pmpi_cart_create__,
pmpi_cart_create_f,
(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr),
(old_comm, ndims, dims, periods, redorder, comm_cart, ierr) )
(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr),
(old_comm, ndims, dims, periods, reorder, comm_cart, ierr) )
#endif
#if LAM_HAVE_WEAK_SYMBOLS
@ -37,8 +37,8 @@ LAM_GENERATE_F77_BINDINGS (MPI_CART_CREATE,
mpi_cart_create_,
mpi_cart_create__,
mpi_cart_create_f,
(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr),
(old_comm, ndims, dims, periods, redorder, comm_cart, ierr) )
(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr),
(old_comm, ndims, dims, periods, reorder, comm_cart, ierr) )
#endif
@ -46,7 +46,7 @@ LAM_GENERATE_F77_BINDINGS (MPI_CART_CREATE,
#include "mpi/c/profile/defines.h"
#endif
void mpi_cart_create_f(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr)
void mpi_cart_create_f(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr)
{
}

Просмотреть файл

@ -41,7 +41,7 @@ void pmpi_buffer_attach_f(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void pmpi_buffer_detach_f(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void pmpi_cancel_f(MPI_Fint *request, MPI_Fint *ierr);
void pmpi_cart_coords_f(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, MPI_Fint *coords, MPI_Fint *ierr);
void pmpi_cart_create_f(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void pmpi_cart_create_f(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void pmpi_cart_get_f(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *coords, MPI_Fint *ierr);
void pmpi_cart_map_f(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *newrank, MPI_Fint *ierr);
void pmpi_cart_rank_f(MPI_Fint *comm, MPI_Fint *coords, MPI_Fint *rank, MPI_Fint *ierr);
@ -328,7 +328,7 @@ void pmpi_buffer_attach(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void pmpi_buffer_detach(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void pmpi_cancel(MPI_Fint *request, MPI_Fint *ierr);
void pmpi_cart_coords(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, MPI_Fint *coords, MPI_Fint *ierr);
void pmpi_cart_create(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void pmpi_cart_create(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void pmpi_cart_get(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *coords, MPI_Fint *ierr);
void pmpi_cart_map(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *newrank, MPI_Fint *ierr);
void pmpi_cart_rank(MPI_Fint *comm, MPI_Fint *coords, MPI_Fint *rank, MPI_Fint *ierr);
@ -615,7 +615,7 @@ void pmpi_buffer_attach_(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void pmpi_buffer_detach_(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void pmpi_cancel_(MPI_Fint *request, MPI_Fint *ierr);
void pmpi_cart_coords_(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, MPI_Fint *coords, MPI_Fint *ierr);
void pmpi_cart_create_(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void pmpi_cart_create_(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void pmpi_cart_get_(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *coords, MPI_Fint *ierr);
void pmpi_cart_map_(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *newrank, MPI_Fint *ierr);
void pmpi_cart_rank_(MPI_Fint *comm, MPI_Fint *coords, MPI_Fint *rank, MPI_Fint *ierr);
@ -902,7 +902,7 @@ void pmpi_buffer_attach__(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void pmpi_buffer_detach__(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void pmpi_cancel__(MPI_Fint *request, MPI_Fint *ierr);
void pmpi_cart_coords__(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, MPI_Fint *coords, MPI_Fint *ierr);
void pmpi_cart_create__(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void pmpi_cart_create__(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void pmpi_cart_get__(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *coords, MPI_Fint *ierr);
void pmpi_cart_map__(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *newrank, MPI_Fint *ierr);
void pmpi_cart_rank__(MPI_Fint *comm, MPI_Fint *coords, MPI_Fint *rank, MPI_Fint *ierr);
@ -1189,7 +1189,7 @@ void PMPI_BUFFER_ATTACH(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void PMPI_BUFFER_DETACH(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void PMPI_CANCEL(MPI_Fint *request, MPI_Fint *ierr);
void PMPI_CART_COORDS(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, MPI_Fint *coords, MPI_Fint *ierr);
void PMPI_CART_CREATE(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void PMPI_CART_CREATE(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void PMPI_CART_GET(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *coords, MPI_Fint *ierr);
void PMPI_CART_MAP(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *newrank, MPI_Fint *ierr);
void PMPI_CART_RANK(MPI_Fint *comm, MPI_Fint *coords, MPI_Fint *rank, MPI_Fint *ierr);

Просмотреть файл

@ -42,7 +42,7 @@ void mpi_buffer_attach_f(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void mpi_buffer_detach_f(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void mpi_cancel_f(MPI_Fint *request, MPI_Fint *ierr);
void mpi_cart_coords_f(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, MPI_Fint *coords, MPI_Fint *ierr);
void mpi_cart_create_f(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void mpi_cart_create_f(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void mpi_cart_get_f(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *coords, MPI_Fint *ierr);
void mpi_cart_map_f(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *newrank, MPI_Fint *ierr);
void mpi_cart_rank_f(MPI_Fint *comm, MPI_Fint *coords, MPI_Fint *rank, MPI_Fint *ierr);
@ -331,7 +331,7 @@ void mpi_buffer_attach(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void mpi_buffer_detach(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void mpi_cancel(MPI_Fint *request, MPI_Fint *ierr);
void mpi_cart_coords(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, MPI_Fint *coords, MPI_Fint *ierr);
void mpi_cart_create(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void mpi_cart_create(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void mpi_cart_get(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *coords, MPI_Fint *ierr);
void mpi_cart_map(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *newrank, MPI_Fint *ierr);
void mpi_cart_rank(MPI_Fint *comm, MPI_Fint *coords, MPI_Fint *rank, MPI_Fint *ierr);
@ -618,7 +618,7 @@ void mpi_buffer_attach_(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void mpi_buffer_detach_(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void mpi_cancel_(MPI_Fint *request, MPI_Fint *ierr);
void mpi_cart_coords_(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, MPI_Fint *coords, MPI_Fint *ierr);
void mpi_cart_create_(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void mpi_cart_create_(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void mpi_cart_get_(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *coords, MPI_Fint *ierr);
void mpi_cart_map_(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *newrank, MPI_Fint *ierr);
void mpi_cart_rank_(MPI_Fint *comm, MPI_Fint *coords, MPI_Fint *rank, MPI_Fint *ierr);
@ -905,7 +905,7 @@ void mpi_buffer_attach__(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void mpi_buffer_detach__(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void mpi_cancel__(MPI_Fint *request, MPI_Fint *ierr);
void mpi_cart_coords__(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, MPI_Fint *coords, MPI_Fint *ierr);
void mpi_cart_create__(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void mpi_cart_create__(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void mpi_cart_get__(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *coords, MPI_Fint *ierr);
void mpi_cart_map__(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *newrank, MPI_Fint *ierr);
void mpi_cart_rank__(MPI_Fint *comm, MPI_Fint *coords, MPI_Fint *rank, MPI_Fint *ierr);
@ -1192,7 +1192,7 @@ void MPI_BUFFER_ATTACH(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void MPI_BUFFER_DETACH(char *buffer, MPI_Fint *size, MPI_Fint *ierr);
void MPI_CANCEL(MPI_Fint *request, MPI_Fint *ierr);
void MPI_CART_COORDS(MPI_Fint *comm, MPI_Fint *rank, MPI_Fint *maxdims, MPI_Fint *coords, MPI_Fint *ierr);
void MPI_CART_CREATE(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *redorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void MPI_CART_CREATE(MPI_Fint *old_comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *reorder, MPI_Fint *comm_cart, MPI_Fint *ierr);
void MPI_CART_GET(MPI_Fint *comm, MPI_Fint *maxdims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *coords, MPI_Fint *ierr);
void MPI_CART_MAP(MPI_Fint *comm, MPI_Fint *ndims, MPI_Fint *dims, MPI_Fint *periods, MPI_Fint *newrank, MPI_Fint *ierr);
void MPI_CART_RANK(MPI_Fint *comm, MPI_Fint *coords, MPI_Fint *rank, MPI_Fint *ierr);