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

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

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_PVFS_Resize

   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_Resize(ADIO_File fd, ADIO_Offset size, int *error_code)
  11 {
  12     int err;
  13     int rank;
  14     static char myname[] = "ADIOI_PVFS_RESIZE";
  15 
  16     /* because MPI_File_set_size is a collective operation, and PVFS1 clients
  17      * do not cache metadata locally, one client can resize and broadcast the
  18      * result to the others */
  19     MPI_Comm_rank(fd->comm, &rank);
  20     if (rank == fd->hints->ranklist[0]) {
  21         err = pvfs_ftruncate64(fd->fd_sys, size);
  22     }
  23     MPI_Bcast(&err, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
  24 
  25     if (err == -1) {
  26         *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  27                                            myname, __LINE__, MPI_ERR_IO,
  28                                            "**io",
  29                                            "**io %s", strerror(errno));
  30     }
  31     else *error_code = MPI_SUCCESS;
  32 }

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