root/ompi/mca/io/romio321/romio/mpi-io/get_posn_sh.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. MPI_File_get_position_shared

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
   2 /* 
   3  *
   4  *   Copyright (C) 1997 University of Chicago. 
   5  *   See COPYRIGHT notice in top-level directory.
   6  */
   7 
   8 #include "mpioimpl.h"
   9 
  10 #ifdef HAVE_WEAK_SYMBOLS
  11 
  12 #if defined(HAVE_PRAGMA_WEAK)
  13 #pragma weak MPI_File_get_position_shared = PMPI_File_get_position_shared
  14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  15 #pragma _HP_SECONDARY_DEF PMPI_File_get_position_shared MPI_File_get_position_shared
  16 #elif defined(HAVE_PRAGMA_CRI_DUP)
  17 #pragma _CRI duplicate MPI_File_get_position_shared as PMPI_File_get_position_shared
  18 /* end of weak pragmas */
  19 #elif defined(HAVE_WEAK_ATTRIBUTE)
  20 int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset) __attribute__((weak,alias("PMPI_File_get_position_shared")));
  21 #endif
  22 
  23 /* Include mapping from MPI->PMPI */
  24 #define MPIO_BUILD_PROFILING
  25 #include "mpioprof.h"
  26 #endif
  27 
  28 /*@
  29     MPI_File_get_position_shared - Returns the current position of the 
  30                shared file pointer in etype units relative to the current view
  31 
  32 Input Parameters:
  33 . fh - file handle (handle)
  34 
  35 Output Parameters:
  36 . offset - offset of shared file pointer (nonnegative integer)
  37 
  38 .N fortran
  39 @*/
  40 int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset)
  41 {
  42     int error_code;
  43     ADIO_File adio_fh;
  44     static char myname[] = "MPI_FILE_GET_POSITION_SHARED";
  45 
  46     adio_fh = MPIO_File_resolve(fh);
  47 
  48     /* --BEGIN ERROR HANDLING-- */
  49     MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
  50     MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code);
  51     MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code);
  52     /* --END ERROR HANDLING-- */
  53 
  54     ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code);
  55 
  56     ADIO_Get_shared_fp(adio_fh, 0, offset, &error_code);
  57     /* --BEGIN ERROR HANDLING-- */
  58     if (error_code != MPI_SUCCESS)
  59         error_code = MPIO_Err_return_file(adio_fh, error_code);
  60     /* --END ERROR HANDLING-- */
  61 
  62 fn_exit:
  63     return error_code;
  64 }

/* [<][>][^][v][top][bottom][index][help] */