-:    0:Source:/home/MPI/testing/mpich2/mpich2/src/mpi/romio/mpi-io/delete.c
        -:    0:Graph:delete.gcno
        -:    0:Data:delete.gcda
        -:    0:Runs:165
        -:    0:Programs:45
        -:    1:/* -*- Mode: C; c-basic-offset:4 ; -*- */
        -:    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:#endif
        -:   20:
        -:   21:/* Include mapping from MPI->PMPI */
        -:   22:#define MPIO_BUILD_PROFILING
        -:   23:#include "mpioprof.h"
        -:   24:#endif
        -:   25:
        -:   26:/*@
        -:   27:    MPI_File_delete - Deletes a file
        -:   28:
        -:   29:Input Parameters:
        -:   30:. filename - name of file to delete (string)
        -:   31:. info - info object (handle)
        -:   32:
        -:   33:.N fortran
        -:   34:@*/
        -:   35:int MPI_File_delete(char *filename, MPI_Info info)
      408:   36:{
        -:   37:    int error_code, file_system;
        -:   38:    char *tmp;
        -:   39:    ADIOI_Fns *fsops;
        -:   40:    static char myname[] = "MPI_FILE_DELETE";
      408:   41:    MPIU_THREADPRIV_DECL;
        -:   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:
      408:   51:    MPIU_THREAD_CS_ENTER(ALLFUNC,);
      408:   52:    MPIR_Nest_incr();
        -:   53:
      408:   54:    MPIR_MPIOInit(&error_code);
      408:   55:    if (error_code != MPI_SUCCESS) goto fn_exit;
        -:   56:
        -:   57:    /* resolve file system type from file name; this is a collective call */
      408:   58:    ADIO_ResolveFileType(MPI_COMM_SELF, filename, &file_system, &fsops, 
        -:   59:			 &error_code);
        -:   60:
        -:   61:    /* --BEGIN ERROR HANDLING-- */
      408:   62:    if (error_code != MPI_SUCCESS)
        -:   63:    {
        -:   64:	/* ADIO_ResolveFileType() will print as informative a message as it
        -:   65:	 * possibly can or call MPIR_Err_setmsg.  We just need to propagate 
        -:   66:	 * the error up.  In the PRINT_ERR_MSG case MPI_Abort has already
        -:   67:	 * been called as well, so we probably didn't even make it this far.
        -:   68:	 */
    #####:   69:	error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
    #####:   70:	goto fn_exit;
        -:   71:    }
        -:   72:    /* --END ERROR HANDLING-- */
        -:   73:
        -:   74:    /* skip prefixes on file names if they have more than one character;
        -:   75:     * single-character prefixes are assumed to be windows drive
        -:   76:     * specifications (e.g. c:\foo) and are left alone.
        -:   77:     */
      408:   78:    tmp = strchr(filename, ':');
      408:   79:    if (tmp > filename + 1)
    #####:   80:	filename = tmp + 1;
        -:   81:
        -:   82:    /* call the fs-specific delete function */
      408:   83:    (fsops->ADIOI_xxx_Delete)(filename, &error_code);
        -:   84:    /* --BEGIN ERROR HANDLING-- */
      408:   85:    if (error_code != MPI_SUCCESS)
        2:   86:	error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
        -:   87:    /* --END ERROR HANDLING-- */
        -:   88:	
        -:   89:#ifdef MPI_hpux
        -:   90:    HPMP_IO_END(fl_xmpi, MPI_FILE_NULL, MPI_DATATYPE_NULL, -1);
        -:   91:#endif /* MPI_hpux */
        -:   92:
      408:   93:fn_exit:
      408:   94:    MPIR_Nest_decr();
      408:   95:    MPIU_THREAD_CS_EXIT(ALLFUNC,);
      408:   96:    return error_code;
        -:   97:}