|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* Copyright (C) 1997 University of Chicago.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT notice in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include "mpioimpl.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_WEAK_SYMBOLS
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#if defined(HAVE_PRAGMA_WEAK)
|
|
Packit Service |
c5cf8c |
#pragma weak MPI_File_delete = PMPI_File_delete
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
|
|
Packit Service |
c5cf8c |
#pragma _HP_SECONDARY_DEF PMPI_File_delete MPI_File_delete
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_CRI_DUP)
|
|
Packit Service |
c5cf8c |
#pragma _CRI duplicate MPI_File_delete as PMPI_File_delete
|
|
Packit Service |
c5cf8c |
/* end of weak pragmas */
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_WEAK_ATTRIBUTE)
|
|
Packit Service |
c5cf8c |
int MPI_File_delete(const char *filename, MPI_Info info)
|
|
Packit Service |
c5cf8c |
__attribute__ ((weak, alias("PMPI_File_delete")));
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Include mapping from MPI->PMPI */
|
|
Packit Service |
c5cf8c |
#define MPIO_BUILD_PROFILING
|
|
Packit Service |
c5cf8c |
#include "mpioprof.h"
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/*@
|
|
Packit Service |
c5cf8c |
MPI_File_delete - Deletes a file
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Input Parameters:
|
|
Packit Service |
c5cf8c |
. filename - name of file to delete (string)
|
|
Packit Service |
c5cf8c |
. info - info object (handle)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N fortran
|
|
Packit Service |
c5cf8c |
@*/
|
|
Packit Service |
c5cf8c |
int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int error_code, file_system;
|
|
Packit Service |
c5cf8c |
char *tmp;
|
|
Packit Service |
c5cf8c |
ADIOI_Fns *fsops;
|
|
Packit Service |
c5cf8c |
#ifdef MPI_hpux
|
|
Packit Service |
c5cf8c |
int fl_xmpi;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
HPMP_IO_START(fl_xmpi, BLKMPIFILEDELETE, TRDTBLOCK, MPI_FILE_NULL, MPI_DATATYPE_NULL, -1);
|
|
Packit Service |
c5cf8c |
#endif /* MPI_hpux */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPL_UNREFERENCED_ARG(info);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_ENTER();
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPIR_MPIOInit(&error_code);
|
|
Packit Service |
c5cf8c |
if (error_code != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* resolve file system type from file name; this is a collective call */
|
|
Packit Service |
c5cf8c |
ADIO_ResolveFileType(MPI_COMM_SELF, filename, &file_system, &fsops, &error_code);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
if (error_code != MPI_SUCCESS) {
|
|
Packit Service |
c5cf8c |
/* ADIO_ResolveFileType() will print as informative a message as it
|
|
Packit Service |
c5cf8c |
* possibly can or call MPIR_Err_setmsg. We just need to propagate
|
|
Packit Service |
c5cf8c |
* the error up. In the PRINT_ERR_MSG case MPI_Abort has already
|
|
Packit Service |
c5cf8c |
* been called as well, so we probably didn't even make it this far.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* skip prefixes on file names if they have more than one character;
|
|
Packit Service |
c5cf8c |
* single-character prefixes are assumed to be windows drive
|
|
Packit Service |
c5cf8c |
* specifications (e.g. c:\foo) and are left alone.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
tmp = strchr(filename, ':');
|
|
Packit Service |
c5cf8c |
if (tmp > filename + 1)
|
|
Packit Service |
c5cf8c |
filename = tmp + 1;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* call the fs-specific delete function */
|
|
Packit Service |
c5cf8c |
(fsops->ADIOI_xxx_Delete) (filename, &error_code);
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
if (error_code != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifdef MPI_hpux
|
|
Packit Service |
c5cf8c |
HPMP_IO_END(fl_xmpi, MPI_FILE_NULL, MPI_DATATYPE_NULL, -1);
|
|
Packit Service |
c5cf8c |
#endif /* MPI_hpux */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_EXIT();
|
|
Packit Service |
c5cf8c |
return error_code;
|
|
Packit Service |
c5cf8c |
}
|