2004-01-25 04:51:49 +03:00
|
|
|
/*
|
|
|
|
* $HEADERS$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "ompi_config.h"
|
2004-01-25 04:51:49 +03:00
|
|
|
#include "mpi.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mpi/c/bindings.h"
|
|
|
|
#include "group/group.h"
|
2004-03-23 00:42:12 +03:00
|
|
|
#include "errhandler/errhandler.h"
|
|
|
|
#include "communicator/communicator.h"
|
2004-01-25 04:51:49 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
2004-01-25 04:51:49 +03:00
|
|
|
#pragma weak MPI_Group_f2c = PMPI_Group_f2c
|
|
|
|
#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-07-30 06:58:53 +04:00
|
|
|
static const char FUNC_NAME[] = "MPI_Group_f2c";
|
|
|
|
|
2004-03-19 22:00:28 +03:00
|
|
|
|
2004-03-18 17:17:23 +03:00
|
|
|
MPI_Group MPI_Group_f2c(MPI_Fint group_f)
|
|
|
|
{
|
|
|
|
/* local variables */
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_group_t *group_c;
|
2004-03-20 04:55:10 +03:00
|
|
|
size_t group_index;
|
2004-02-27 22:22:14 +03:00
|
|
|
|
2004-03-20 04:55:10 +03:00
|
|
|
group_index = (size_t) group_f;
|
2004-02-27 22:22:14 +03:00
|
|
|
|
|
|
|
/* error checks */
|
2004-03-18 17:17:23 +03:00
|
|
|
if (MPI_PARAM_CHECK) {
|
2004-07-30 06:58:53 +04:00
|
|
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
2004-03-18 17:17:23 +03:00
|
|
|
if (0 > group_index) {
|
2004-06-07 19:33:53 +04:00
|
|
|
(void) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP,
|
2004-07-30 06:58:53 +04:00
|
|
|
FUNC_NAME);
|
2004-03-19 22:00:28 +03:00
|
|
|
return MPI_GROUP_NULL;
|
2004-02-27 22:22:14 +03:00
|
|
|
}
|
2004-06-07 19:33:53 +04:00
|
|
|
if (group_index >= ompi_group_f_to_c_table->size) {
|
|
|
|
(void) OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_GROUP,
|
2004-07-30 06:58:53 +04:00
|
|
|
FUNC_NAME);
|
2004-03-19 22:00:28 +03:00
|
|
|
return MPI_GROUP_NULL;
|
2004-02-27 22:22:14 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
group_c = ompi_group_f_to_c_table->addr[group_index];
|
2004-02-27 22:22:14 +03:00
|
|
|
return (MPI_Group) group_c;
|
2004-01-25 04:51:49 +03:00
|
|
|
}
|