2004-01-25 22:07:54 +00:00
|
|
|
/*
|
2004-11-22 01:38:40 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 20:09:25 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-25 22:07:54 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#include "ompi_config.h"
|
2004-01-25 22:07:54 +00:00
|
|
|
|
2004-03-17 18:45:16 +00:00
|
|
|
#include "mpi/c/bindings.h"
|
2004-10-23 19:24:00 +00:00
|
|
|
#include "mpi/f77/fint_2_int.h"
|
2005-09-12 09:17:44 +00:00
|
|
|
#include "ompi/info/info.h"
|
2004-01-25 22:07:54 +00:00
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
2004-01-25 22:07:54 +00:00
|
|
|
#pragma weak MPI_Info_f2c = PMPI_Info_f2c
|
|
|
|
#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-07-30 02:58:53 +00:00
|
|
|
static const char FUNC_NAME[] = "MPI_Info_f2c";
|
|
|
|
|
|
|
|
|
2004-02-01 22:28:20 +00: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 16:56:24 +00:00
|
|
|
* @retval C handle corresponding to MPI_INFO object
|
2004-02-01 22:28:20 +00:00
|
|
|
*/
|
2004-07-30 02:58:53 +00:00
|
|
|
MPI_Info MPI_Info_f2c(MPI_Fint info)
|
|
|
|
{
|
2004-10-23 19:24:00 +00:00
|
|
|
int info_index = OMPI_FINT_2_INT(info);
|
2004-08-14 01:56:05 +00:00
|
|
|
|
2004-04-20 22:13:39 +00:00
|
|
|
/* check the arguments */
|
2004-08-14 01:56:05 +00:00
|
|
|
|
2004-04-20 22:13:39 +00:00
|
|
|
if (MPI_PARAM_CHECK) {
|
2004-07-30 02:58:53 +00:00
|
|
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
2004-04-20 22:13:39 +00:00
|
|
|
}
|
2004-07-30 02:58:53 +00:00
|
|
|
|
2004-08-14 12:28:25 +00: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 18:14:03 +00:00
|
|
|
return ompi_pointer_array_get_item(&ompi_info_f_to_c_table, info_index);
|
2004-01-25 22:07:54 +00:00
|
|
|
}
|