2004-01-21 00:05:46 +00:00
|
|
|
/*
|
|
|
|
* $HEADERS$
|
|
|
|
*/
|
2004-06-07 15:33:53 +00:00
|
|
|
#include "ompi_config.h"
|
2004-01-21 00:05:46 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2004-03-26 20:03:38 +00:00
|
|
|
#include "runtime/runtime.h"
|
2004-03-17 18:45:16 +00:00
|
|
|
#include "mpi/c/bindings.h"
|
|
|
|
#include "communicator/communicator.h"
|
2004-01-21 00:05:46 +00:00
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
2004-01-21 00:05:46 +00:00
|
|
|
#pragma weak MPI_Comm_rank = PMPI_Comm_rank
|
|
|
|
#endif
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#if OMPI_PROFILING_DEFINES
|
2004-04-20 18:50:43 +00:00
|
|
|
#include "mpi/c/profile/defines.h"
|
|
|
|
#endif
|
|
|
|
|
2004-01-21 00:05:46 +00:00
|
|
|
|
2004-05-21 19:32:18 +00:00
|
|
|
int MPI_Comm_rank(MPI_Comm comm, int *rank)
|
|
|
|
{
|
2004-03-26 20:03:38 +00:00
|
|
|
if ( MPI_PARAM_CHECK ) {
|
2004-06-18 19:02:52 +00:00
|
|
|
OMPI_ERR_INIT_FINALIZE;
|
2004-03-26 20:03:38 +00:00
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
if ( MPI_COMM_NULL == comm || ompi_comm_invalid (comm))
|
|
|
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
|
2004-03-26 20:03:38 +00:00
|
|
|
"MPI_Comm_rank");
|
|
|
|
|
|
|
|
if ( NULL == rank )
|
2004-06-07 15:33:53 +00:00
|
|
|
return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG,
|
2004-03-26 20:03:38 +00:00
|
|
|
"MPI_Comm_rank");
|
|
|
|
}
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
*rank = ompi_comm_rank((ompi_communicator_t*)comm);
|
2004-01-21 00:05:46 +00:00
|
|
|
return MPI_SUCCESS;
|
|
|
|
}
|
2004-03-03 16:44:41 +00:00
|
|
|
|