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

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_File_delete

   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_delete = PMPI_File_delete
  14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  15 #pragma _HP_SECONDARY_DEF PMPI_File_delete MPI_File_delete
  16 #elif defined(HAVE_PRAGMA_CRI_DUP)
  17 #pragma _CRI duplicate MPI_File_delete as PMPI_File_delete
  18 /* end of weak pragmas */
  19 #elif defined(HAVE_WEAK_ATTRIBUTE)
  20 int MPI_File_delete(const char *filename, MPI_Info info) __attribute__((weak,alias("PMPI_File_delete")));
  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_delete - Deletes a file
  30 
  31 Input Parameters:
  32 . filename - name of file to delete (string)
  33 . info - info object (handle)
  34 
  35 .N fortran
  36 @*/
  37 int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info)
  38 {
  39     int error_code, file_system;
  40     char *tmp;
  41     ADIOI_Fns *fsops;
  42 #ifdef MPI_hpux
  43     int fl_xmpi;
  44   
  45     HPMP_IO_START(fl_xmpi, BLKMPIFILEDELETE, TRDTBLOCK,
  46                 MPI_FILE_NULL, MPI_DATATYPE_NULL, -1);
  47 #endif /* MPI_hpux */
  48 
  49     MPIU_UNREFERENCED_ARG(info);
  50 
  51     ROMIO_THREAD_CS_ENTER();
  52 
  53     MPIR_MPIOInit(&error_code);
  54     if (error_code != MPI_SUCCESS) goto fn_exit;
  55 
  56     /* resolve file system type from file name; this is a collective call */
  57     ADIO_ResolveFileType(MPI_COMM_SELF, filename, &file_system, &fsops, 
  58                          &error_code);
  59 
  60     /* --BEGIN ERROR HANDLING-- */
  61     if (error_code != MPI_SUCCESS)
  62     {
  63         /* ADIO_ResolveFileType() will print as informative a message as it
  64          * possibly can or call MPIR_Err_setmsg.  We just need to propagate 
  65          * the error up.  In the PRINT_ERR_MSG case MPI_Abort has already
  66          * been called as well, so we probably didn't even make it this far.
  67          */
  68         error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
  69         goto fn_exit;
  70     }
  71     /* --END ERROR HANDLING-- */
  72 
  73     /* skip prefixes on file names if they have more than one character;
  74      * single-character prefixes are assumed to be windows drive
  75      * specifications (e.g. c:\foo) and are left alone.
  76      */
  77     tmp = strchr(filename, ':');
  78     if (tmp > filename + 1)
  79         filename = tmp + 1;
  80 
  81     /* call the fs-specific delete function */
  82     (fsops->ADIOI_xxx_Delete)(filename, &error_code);
  83     /* --BEGIN ERROR HANDLING-- */
  84     if (error_code != MPI_SUCCESS)
  85         error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
  86     /* --END ERROR HANDLING-- */
  87         
  88 #ifdef MPI_hpux
  89     HPMP_IO_END(fl_xmpi, MPI_FILE_NULL, MPI_DATATYPE_NULL, -1);
  90 #endif /* MPI_hpux */
  91 
  92 fn_exit:
  93     ROMIO_THREAD_CS_EXIT();
  94     return error_code;
  95 }

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