root/ompi/mca/io/romio321/romio/adio/ad_gpfs/ad_gpfs_close.c

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

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_GPFS_Close

   1 /* ---------------------------------------------------------------- */
   2 /* (C)Copyright IBM Corp.  2007, 2008                               */
   3 /* ---------------------------------------------------------------- */
   4 /**
   5  * \file ad_gpfs_close.c
   6  * \brief ???
   7  */
   8 
   9 /* -*- Mode: C; c-basic-offset:4 ; -*- */
  10 /* 
  11  *   Copyright (C) 1997 University of Chicago. 
  12  *   See COPYRIGHT notice in top-level directory.
  13  */
  14 
  15 #include "ad_gpfs.h"
  16 #include "ad_gpfs_tuning.h"
  17 #include <unistd.h>
  18 
  19 void ADIOI_GPFS_Close(ADIO_File fd, int *error_code)
  20 {
  21   int err, derr=0;
  22   static char myname[] = "ADIOI_GPFS_CLOSE";
  23 
  24 #ifdef PROFILE
  25   MPE_Log_event(9, 0, "start close");
  26 #endif
  27 
  28   if (fd->null_fd >= 0)
  29       close(fd->null_fd);
  30 
  31   err = close(fd->fd_sys);
  32   if (fd->fd_direct >= 0)
  33   {
  34     derr = close(fd->fd_direct);
  35   }
  36 
  37 #ifdef PROFILE
  38   MPE_Log_event(10, 0, "end close");
  39 #endif
  40 
  41 /*  FPRINTF(stderr,"%s(%d):'%s'. Free %#X\n",myname,__LINE__,fd->filename,(int)fd->fs_ptr);*/
  42   if (fd->fs_ptr != NULL) {
  43           ADIOI_Free(fd->fs_ptr);
  44           fd->fs_ptr = NULL;
  45   }
  46   fd->fd_sys    = -1;
  47   fd->fd_direct = -1;
  48 
  49   if (err == -1 || derr == -1)
  50   {
  51     *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  52                                        myname, __LINE__, MPI_ERR_IO,
  53                                        "**io",
  54                                        "**io %s", strerror(errno));
  55   }
  56   else *error_code = MPI_SUCCESS;
  57 }

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