1
1
openmpi/src/mpi/c/topo_test.c

44 строки
1.0 KiB
C
Исходник Обычный вид История

/*
* $HEADERS$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "mpi.h"
#include "mpi/c/bindings.h"
#include "communicator/communicator.h"
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
#pragma weak MPI_Topo_test = PMPI_Topo_test
#endif
#if OMPI_PROFILING_DEFINES
#include "mpi/c/profile/defines.h"
#endif
static const char FUNC_NAME[] = "MPI_Topo_test";
int MPI_Topo_test(MPI_Comm comm, int *status)
{
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);
} else if ( NULL == status ) {
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
}
}
if ( comm->c_flags & OMPI_COMM_CART ) {
*status = MPI_CART;
} else if ( comm->c_flags & OMPI_COMM_GRAPH ) {
*status = MPI_GRAPH;
} else {
*status = MPI_UNDEFINED;
}
return MPI_SUCCESS;
}