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

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_File_get_byte_offset

   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 #include "adioi.h" /* ADIOI_Get_byte_offset() prototype */
  10 
  11 #ifdef HAVE_WEAK_SYMBOLS
  12 
  13 #if defined(HAVE_PRAGMA_WEAK)
  14 #pragma weak MPI_File_get_byte_offset = PMPI_File_get_byte_offset
  15 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  16 #pragma _HP_SECONDARY_DEF PMPI_File_get_byte_offset MPI_File_get_byte_offset
  17 #elif defined(HAVE_PRAGMA_CRI_DUP)
  18 #pragma _CRI duplicate MPI_File_get_byte_offset as PMPI_File_get_byte_offset
  19 /* end of weak pragmas */
  20 #elif defined(HAVE_WEAK_ATTRIBUTE)
  21 int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp) __attribute__((weak,alias("PMPI_File_get_byte_offset")));
  22 #endif
  23 
  24 /* Include mapping from MPI->PMPI */
  25 #define MPIO_BUILD_PROFILING
  26 #include "mpioprof.h"
  27 #endif
  28 
  29 /*@
  30     MPI_File_get_byte_offset - Returns the absolute byte position in 
  31                 the file corresponding to "offset" etypes relative to
  32                 the current view
  33 
  34 Input Parameters:
  35 . fh - file handle (handle)
  36 . offset - offset (nonnegative integer)
  37 
  38 Output Parameters:
  39 . disp - absolute byte position of offset (nonnegative integer)
  40 
  41 .N fortran
  42 @*/
  43 int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp)
  44 {
  45     int error_code;
  46     ADIO_File adio_fh;
  47     static char myname[] = "MPI_FILE_GET_BYTE_OFFSET";
  48 
  49     adio_fh = MPIO_File_resolve(fh);
  50 
  51     /* --BEGIN ERROR HANDLING-- */
  52     MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
  53 
  54     if (offset < 0)
  55     {
  56         error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  57                                           myname, __LINE__, MPI_ERR_ARG,
  58                                           "**iobadoffset", 0);
  59         error_code = MPIO_Err_return_file(adio_fh, error_code);
  60         goto fn_exit;
  61     }
  62 
  63     MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code);
  64     /* --END ERROR HANDLING-- */
  65 
  66     ADIOI_Get_byte_offset(adio_fh, offset, disp);
  67 
  68 fn_exit:
  69 
  70     return MPI_SUCCESS;
  71 }

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