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

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_File_sync

   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_sync = PMPI_File_sync
  14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  15 #pragma _HP_SECONDARY_DEF PMPI_File_sync MPI_File_sync
  16 #elif defined(HAVE_PRAGMA_CRI_DUP)
  17 #pragma _CRI duplicate MPI_File_sync as PMPI_File_sync
  18 /* end of weak pragmas */
  19 #elif defined(HAVE_WEAK_ATTRIBUTE)
  20 int MPI_File_sync(MPI_File fh) __attribute__((weak,alias("PMPI_File_sync")));
  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_sync - Causes all previous writes to be transferred
  30                     to the storage device
  31 
  32 Input Parameters:
  33 . fh - file handle (handle)
  34 
  35 .N fortran
  36 @*/
  37 int MPI_File_sync(MPI_File fh)
  38 {
  39     int error_code;
  40     ADIO_File adio_fh;
  41     static char myname[] = "MPI_FILE_SYNC";
  42 #ifdef MPI_hpux
  43     int fl_xmpi;
  44 
  45     HPMP_IO_START(fl_xmpi, BLKMPIFILESYNC, TRDTBLOCK, adio_fh,
  46                   MPI_DATATYPE_NULL, -1);
  47 #endif /* MPI_hpux */
  48     ROMIO_THREAD_CS_ENTER();
  49 
  50     adio_fh = MPIO_File_resolve(fh);
  51     /* --BEGIN ERROR HANDLING-- */
  52     if ((adio_fh == NULL) || ((adio_fh)->cookie != ADIOI_FILE_COOKIE))
  53     {
  54         error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  55                                           myname, __LINE__, MPI_ERR_ARG,
  56                                           "**iobadfh", 0);
  57         error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
  58         goto fn_exit;
  59     }
  60     MPIO_CHECK_WRITABLE(fh, myname, error_code);
  61     /* --END ERROR HANDLING-- */
  62 
  63     ADIO_Flush(adio_fh, &error_code);
  64     /* --BEGIN ERROR HANDLING-- */
  65     if (error_code != MPI_SUCCESS)
  66         error_code = MPIO_Err_return_file(adio_fh, error_code);
  67     /* --END ERROR HANDLING-- */
  68 
  69 #ifdef MPI_hpux
  70     HPMP_IO_END(fl_xmpi, adio_fh, MPI_DATATYPE_NULL, -1);
  71 #endif /* MPI_hpux */
  72  
  73 fn_exit:
  74     ROMIO_THREAD_CS_EXIT();
  75     return error_code;
  76 }

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