00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "mpioimpl.h"
00010
00011 #ifdef HAVE_WEAK_SYMBOLS
00012
00013 #if defined(HAVE_PRAGMA_WEAK)
00014 #pragma weak MPI_File_get_position = PMPI_File_get_position
00015 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00016 #pragma _HP_SECONDARY_DEF PMPI_File_get_position MPI_File_get_position
00017 #elif defined(HAVE_PRAGMA_CRI_DUP)
00018 #pragma _CRI duplicate MPI_File_get_position as PMPI_File_get_position
00019
00020 #endif
00021
00022
00023 #define MPIO_BUILD_PROFILING
00024 #include "mpioprof.h"
00025 #endif
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 int MPI_File_get_position(MPI_File fh, MPI_Offset *offset)
00041 {
00042 #ifndef PRINT_ERR_MSG
00043 int error_code;
00044 static char myname[] = "MPI_FILE_GET_POSITION";
00045 #endif
00046
00047 #ifdef PRINT_ERR_MSG
00048 if ((fh <= (MPI_File) 0) || (fh->cookie != ADIOI_FILE_COOKIE)) {
00049 FPRINTF(stderr, "MPI_File_get_position: Invalid file handle\n");
00050 MPI_Abort(MPI_COMM_WORLD, 1);
00051 }
00052 #else
00053 ADIOI_TEST_FILE_HANDLE(fh, myname);
00054 #endif
00055
00056 if (fh->access_mode & MPI_MODE_SEQUENTIAL) {
00057 #ifdef PRINT_ERR_MSG
00058 FPRINTF(stderr, "MPI_File_get_position: Can't use this function because file was opened with MPI_MODE_SEQUENTIAL\n");
00059 MPI_Abort(MPI_COMM_WORLD, 1);
00060 #else
00061 error_code = MPIR_Err_setmsg(MPI_ERR_UNSUPPORTED_OPERATION, MPIR_ERR_AMODE_SEQ,
00062 myname, (char *) 0, (char *) 0);
00063 return ADIOI_Error(fh, error_code, myname);
00064 #endif
00065 }
00066
00067 ADIOI_Get_position(fh, offset);
00068
00069 return MPI_SUCCESS;
00070 }