2004-01-21 03:05:46 +03:00
|
|
|
/*
|
|
|
|
* $HEADERS$
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "ompi_config.h"
|
2004-01-21 03:05:46 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mpi/c/bindings.h"
|
2004-07-30 06:58:53 +04:00
|
|
|
#include "communicator/communicator.h"
|
|
|
|
#include "errhandler/errhandler.h"
|
2004-01-21 03:05:46 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
2004-01-21 03:05:46 +03:00
|
|
|
#pragma weak MPI_Cartdim_get = PMPI_Cartdim_get
|
|
|
|
#endif
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#if OMPI_PROFILING_DEFINES
|
2004-04-20 22:50:43 +04:00
|
|
|
#include "mpi/c/profile/defines.h"
|
|
|
|
#endif
|
|
|
|
|
2004-01-21 03:05:46 +03:00
|
|
|
|
2004-07-30 06:58:53 +04:00
|
|
|
static const char FUNC_NAME[] = "MPI_Cartdim_get";
|
|
|
|
|
|
|
|
|
|
|
|
int MPI_Cartdim_get(MPI_Comm comm, int *ndims)
|
|
|
|
{
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_topo_base_module_cartdim_get_fn_t func;
|
2004-07-31 02:06:09 +04:00
|
|
|
int err;
|
|
|
|
|
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
|
|
|
if (ompi_comm_invalid(comm)) {
|
|
|
|
return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_COMM,
|
|
|
|
FUNC_NAME);
|
|
|
|
}
|
|
|
|
if (OMPI_COMM_IS_INTER(comm)) {
|
|
|
|
return OMPI_ERRHANDLER_INVOKE (comm, MPI_ERR_COMM,
|
|
|
|
FUNC_NAME);
|
|
|
|
}
|
|
|
|
if (!OMPI_COMM_IS_CART(comm)) {
|
|
|
|
return OMPI_ERRHANDLER_INVOKE (comm, MPI_ERR_TOPOLOGY,
|
|
|
|
FUNC_NAME);
|
|
|
|
}
|
|
|
|
if (NULL == ndims) {
|
|
|
|
return OMPI_ERRHANDLER_INVOKE (comm, MPI_ERR_ARG,
|
|
|
|
FUNC_NAME);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* get the function pointer on this communicator */
|
|
|
|
func = comm->c_topo->topo_cartdim_get;
|
|
|
|
|
|
|
|
/* call the function */
|
|
|
|
if ( MPI_SUCCESS !=
|
|
|
|
(err = func(comm, ndims))) {
|
|
|
|
return OMPI_ERRHANDLER_INVOKE(comm, err, FUNC_NAME);
|
|
|
|
}
|
|
|
|
|
|
|
|
return MPI_SUCCESS;
|
2004-01-21 03:05:46 +03:00
|
|
|
}
|