root/ompi/mca/io/romio321/romio/adio/ad_pvfs/ad_pvfs_flush.c

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

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_PVFS_Flush

   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 "ad_pvfs.h"
   9 
  10 void ADIOI_PVFS_Flush(ADIO_File fd, int *error_code)
  11 {
  12     int err, rank, dummy=0, dummy_in=0;
  13     static char myname[] = "ADIOI_PVFS_FLUSH";
  14 
  15     /* a collective routine: because we do not cache data in PVFS1, one process
  16      * can initiate the fsync operation and broadcast the result to the others.
  17      * One catch: MPI_File_sync has special meaning with respect to file system
  18      * consistency.  Ensure no clients have outstanding write operations.
  19      */
  20 
  21     MPI_Comm_rank(fd->comm, &rank);
  22     MPI_Reduce(&dummy_in, &dummy, 1, MPI_INT, MPI_SUM, 
  23                     fd->hints->ranklist[0], fd->comm);
  24     if (rank == fd->hints->ranklist[0]) {
  25             err = pvfs_fsync(fd->fd_sys);
  26     }
  27     MPI_Bcast(&err, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
  28 
  29     if (err == -1) {
  30         *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  31                                            myname, __LINE__, MPI_ERR_IO,
  32                                            "**io",
  33                                            "**io %s", strerror(errno));
  34     }
  35     else *error_code = MPI_SUCCESS;
  36 }

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