00001
00002
00003
00004
00005
00006
00007
00008 #ifdef _UNICOS
00009 #include <fortran.h>
00010 #endif
00011 #include "adio.h"
00012 #include "mpio.h"
00013
00014
00015 #if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS)
00016
00017 #if defined(HAVE_WEAK_SYMBOLS)
00018 #if defined(HAVE_PRAGMA_WEAK)
00019 #if defined(FORTRANCAPS)
00020 extern FORTRAN_API void FORT_CALL MPI_FILE_DELETE( char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL );
00021 #pragma weak MPI_FILE_DELETE = PMPI_FILE_DELETE
00022 #elif defined(FORTRANDOUBLEUNDERSCORE)
00023 extern FORTRAN_API void FORT_CALL mpi_file_delete__( char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL );
00024 #pragma weak mpi_file_delete__ = pmpi_file_delete__
00025 #elif !defined(FORTRANUNDERSCORE)
00026 extern FORTRAN_API void FORT_CALL mpi_file_delete( char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL );
00027 #pragma weak mpi_file_delete = pmpi_file_delete
00028 #else
00029 extern FORTRAN_API void FORT_CALL mpi_file_delete_( char * FORT_MIXED_LEN_DECL, MPI_Fint *, MPI_Fint * FORT_END_LEN_DECL );
00030 #pragma weak mpi_file_delete_ = pmpi_file_delete_
00031 #endif
00032
00033 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00034 #if defined(FORTRANCAPS)
00035 #pragma _HP_SECONDARY_DEF PMPI_FILE_DELETE MPI_FILE_DELETE
00036 #elif defined(FORTRANDOUBLEUNDERSCORE)
00037 #pragma _HP_SECONDARY_DEF pmpi_file_delete__ mpi_file_delete__
00038 #elif !defined(FORTRANUNDERSCORE)
00039 #pragma _HP_SECONDARY_DEF pmpi_file_delete mpi_file_delete
00040 #else
00041 #pragma _HP_SECONDARY_DEF pmpi_file_delete_ mpi_file_delete_
00042 #endif
00043
00044 #elif defined(HAVE_PRAGMA_CRI_DUP)
00045 #if defined(FORTRANCAPS)
00046 #pragma _CRI duplicate MPI_FILE_DELETE as PMPI_FILE_DELETE
00047 #elif defined(FORTRANDOUBLEUNDERSCORE)
00048 #pragma _CRI duplicate mpi_file_delete__ as pmpi_file_delete__
00049 #elif !defined(FORTRANUNDERSCORE)
00050 #pragma _CRI duplicate mpi_file_delete as pmpi_file_delete
00051 #else
00052 #pragma _CRI duplicate mpi_file_delete_ as pmpi_file_delete_
00053 #endif
00054
00055
00056 #endif
00057
00058 #include "mpioprof.h"
00059 #endif
00060
00061 #ifdef FORTRANCAPS
00062 #define mpi_file_delete_ PMPI_FILE_DELETE
00063 #elif defined(FORTRANDOUBLEUNDERSCORE)
00064 #define mpi_file_delete_ pmpi_file_delete__
00065 #elif !defined(FORTRANUNDERSCORE)
00066 #if defined(HPUX) || defined(SPPUX)
00067 #pragma _HP_SECONDARY_DEF pmpi_file_delete pmpi_file_delete_
00068 #endif
00069 #define mpi_file_delete_ pmpi_file_delete
00070 #else
00071 #if defined(HPUX) || defined(SPPUX)
00072 #pragma _HP_SECONDARY_DEF pmpi_file_delete_ pmpi_file_delete
00073 #endif
00074 #define mpi_file_delete_ pmpi_file_delete_
00075 #endif
00076
00077 #else
00078
00079 #ifdef FORTRANCAPS
00080 #define mpi_file_delete_ MPI_FILE_DELETE
00081 #elif defined(FORTRANDOUBLEUNDERSCORE)
00082 #define mpi_file_delete_ mpi_file_delete__
00083 #elif !defined(FORTRANUNDERSCORE)
00084 #if defined(HPUX) || defined(SPPUX)
00085 #pragma _HP_SECONDARY_DEF mpi_file_delete mpi_file_delete_
00086 #endif
00087 #define mpi_file_delete_ mpi_file_delete
00088 #else
00089 #if defined(HPUX) || defined(SPPUX)
00090 #pragma _HP_SECONDARY_DEF mpi_file_delete_ mpi_file_delete
00091 #endif
00092 #endif
00093 #endif
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 FORTRAN_API void FORT_CALL mpi_file_delete_(char *filename FORT_MIXED_LEN_DECL, MPI_Fint *info, MPI_Fint *ierr FORT_END_LEN_DECL);
00109
00110 #ifdef _UNICOS
00111 void mpi_file_delete_(_fcd filename_fcd, MPI_Fint *info, MPI_Fint *ierr)
00112 {
00113 char *filename = _fcdtocp(filename_fcd);
00114 int str_len = _fcdlen(filename_fcd);
00115 #else
00116 FORTRAN_API void FORT_CALL mpi_file_delete_(char *filename FORT_MIXED_LEN(str_len), MPI_Fint *info, MPI_Fint *ierr FORT_END_LEN(str_len))
00117 {
00118 #endif
00119 char *newfname;
00120 int real_len, i;
00121 MPI_Info info_c;
00122
00123 info_c = MPI_Info_f2c(*info);
00124
00125
00126 if (filename <= (char *) 0) {
00127 FPRINTF(stderr, "MPI_File_delete: filename is an invalid address\n");
00128 MPI_Abort(MPI_COMM_WORLD, 1);
00129 }
00130 for (i=str_len-1; i>=0; i--) if (filename[i] != ' ') break;
00131 if (i < 0) {
00132 FPRINTF(stderr, "MPI_File_delete: filename is a blank string\n");
00133 MPI_Abort(MPI_COMM_WORLD, 1);
00134 }
00135 real_len = i + 1;
00136
00137 newfname = (char *) ADIOI_Malloc((real_len+1)*sizeof(char));
00138 ADIOI_Strncpy(newfname, filename, real_len);
00139 newfname[real_len] = '\0';
00140
00141 *ierr = MPI_File_delete(newfname, info_c);
00142
00143 ADIOI_Free(newfname);
00144 }