2004-01-24 23:17:43 +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-24 23:17:43 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#include "ompi_config.h"
|
2004-01-24 23:17:43 +00:00
|
|
|
|
2004-03-17 18:45:16 +00:00
|
|
|
#include "mpi/c/bindings.h"
|
2005-09-12 09:17:44 +00:00
|
|
|
#include "ompi/file/file.h"
|
2004-01-24 23:17:43 +00:00
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
|
2004-01-24 23:17:43 +00:00
|
|
|
#pragma weak MPI_File_get_info = PMPI_File_get_info
|
|
|
|
#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_File_get_info";
|
|
|
|
|
|
|
|
|
|
|
|
int MPI_File_get_info(MPI_File fh, MPI_Info *info_used)
|
|
|
|
{
|
2004-09-14 10:55:10 +00:00
|
|
|
int rc;
|
|
|
|
|
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
rc = MPI_SUCCESS;
|
|
|
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
|
|
|
if (ompi_file_invalid(fh)) {
|
|
|
|
rc = MPI_ERR_FILE;
|
|
|
|
fh = MPI_FILE_NULL;
|
|
|
|
} else if (NULL == info_used) {
|
|
|
|
rc = MPI_ERR_ARG;
|
|
|
|
}
|
|
|
|
OMPI_ERRHANDLER_CHECK(rc, fh, rc, FUNC_NAME);
|
2004-08-12 16:56:24 +00:00
|
|
|
}
|
2004-07-30 02:58:53 +00:00
|
|
|
|
2004-09-14 10:55:10 +00:00
|
|
|
/* Copy the handle and increase the refcount if it's not NULL */
|
2004-07-30 02:58:53 +00:00
|
|
|
|
2004-09-14 10:55:10 +00:00
|
|
|
*info_used = fh->f_info;
|
|
|
|
if (NULL != fh->f_info) {
|
|
|
|
OBJ_RETAIN(fh->f_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* One of the few times that we know that we can succeed. Woot! */
|
|
|
|
|
|
|
|
return MPI_SUCCESS;
|
2004-01-24 23:17:43 +00:00
|
|
|
}
|