2004-01-25 02:17:43 +03:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "ompi_config.h"
|
2004-01-25 02:17:43 +03:00
|
|
|
|
|
|
|
#include "mpi.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mpi/c/bindings.h"
|
2004-07-30 06:58:53 +04:00
|
|
|
#include "communicator/communicator.h"
|
|
|
|
#include "errhandler/errhandler.h"
|
2004-08-14 05:56:05 +04:00
|
|
|
#include "file/file.h"
|
2004-01-25 02:17:43 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
2004-01-25 02:17:43 +03:00
|
|
|
#pragma weak MPI_File_f2c = PMPI_File_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_File_f2c";
|
|
|
|
|
|
|
|
|
2004-08-14 05:56:05 +04:00
|
|
|
MPI_File MPI_File_f2c(MPI_Fint file_f)
|
2004-07-30 06:58:53 +04:00
|
|
|
{
|
2004-08-14 05:56:05 +04:00
|
|
|
size_t file_index = (size_t) file_f;
|
|
|
|
|
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
|
|
|
if (file_index < 0 ||
|
|
|
|
file_index >= ompi_pointer_array_get_size(&ompi_file_f_to_c_table)) {
|
|
|
|
(void) OMPI_ERRHANDLER_INVOKE(MPI_FILE_NULL, MPI_ERR_FILE,
|
|
|
|
FUNC_NAME);
|
|
|
|
return MPI_FILE_NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ompi_file_f_to_c_table.addr[file_index];
|
2004-01-25 02:17:43 +03:00
|
|
|
}
|