2004-01-26 01:07:54 +03:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "ompi_config.h"
|
2004-01-26 01:07:54 +03:00
|
|
|
|
|
|
|
#include "mpi.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mpi/c/bindings.h"
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "class/ompi_list.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "info/info.h"
|
2004-04-21 02:13:39 +04:00
|
|
|
#include "errhandler/errhandler.h"
|
|
|
|
#include "communicator/communicator.h"
|
2004-01-26 01:07:54 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
2004-01-26 01:07:54 +03:00
|
|
|
#pragma weak MPI_Info_f2c = PMPI_Info_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_Info_f2c";
|
|
|
|
|
|
|
|
|
2004-02-02 01:28:20 +03:00
|
|
|
/**
|
|
|
|
* Converts the MPI_Fint info into a valid C MPI_Info handle
|
|
|
|
*
|
|
|
|
* @param info Integer handle to an MPI_INFO object
|
2004-08-12 20:56:24 +04:00
|
|
|
* @retval C handle corresponding to MPI_INFO object
|
2004-02-02 01:28:20 +03:00
|
|
|
*/
|
2004-07-30 06:58:53 +04:00
|
|
|
MPI_Info MPI_Info_f2c(MPI_Fint info)
|
|
|
|
{
|
2004-08-14 05:56:05 +04:00
|
|
|
size_t info_index = (size_t) info;
|
|
|
|
|
2004-04-21 02:13:39 +04:00
|
|
|
/* check the arguments */
|
2004-08-14 05:56:05 +04:00
|
|
|
|
2004-04-21 02:13:39 +04:00
|
|
|
if (MPI_PARAM_CHECK) {
|
2004-07-30 06:58:53 +04:00
|
|
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
2004-04-21 02:13:39 +04:00
|
|
|
}
|
2004-07-30 06:58:53 +04:00
|
|
|
|
2004-08-14 16:28:25 +04:00
|
|
|
/* Per MPI-2:4.12.4, do not invoke an error handler if we get an
|
|
|
|
invalid fortran handle */
|
|
|
|
|
|
|
|
if (info_index < 0 ||
|
|
|
|
info_index >=
|
|
|
|
ompi_pointer_array_get_size(&ompi_info_f_to_c_table)) {
|
|
|
|
return MPI_INFO_NULL;
|
|
|
|
}
|
|
|
|
|
2004-09-13 22:14:03 +04:00
|
|
|
return ompi_pointer_array_get_item(&ompi_info_f_to_c_table, info_index);
|
2004-01-26 01:07:54 +03:00
|
|
|
}
|