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_GET_VIEW( MPI_Fint *, MPI_Offset*, MPI_Fint*, MPI_Fint*, char * FORT_MIXED_LEN_DECL, MPI_Fint * FORT_END_LEN_DECL );
00021 #pragma weak MPI_FILE_GET_VIEW = PMPI_FILE_GET_VIEW
00022 #elif defined(FORTRANDOUBLEUNDERSCORE)
00023 extern FORTRAN_API void FORT_CALL mpi_file_get_view__( MPI_Fint *, MPI_Offset*, MPI_Fint*, MPI_Fint*, char * FORT_MIXED_LEN_DECL, MPI_Fint * FORT_END_LEN_DECL );
00024 #pragma weak mpi_file_get_view__ = pmpi_file_get_view__
00025 #elif !defined(FORTRANUNDERSCORE)
00026 extern FORTRAN_API void FORT_CALL mpi_file_get_view( MPI_Fint *, MPI_Offset*, MPI_Fint*, MPI_Fint*, char * FORT_MIXED_LEN_DECL, MPI_Fint * FORT_END_LEN_DECL );
00027 #pragma weak mpi_file_get_view = pmpi_file_get_view
00028 #else
00029 extern FORTRAN_API void FORT_CALL mpi_file_get_view_( MPI_Fint *, MPI_Offset*, MPI_Fint*, MPI_Fint*, char * FORT_MIXED_LEN_DECL, MPI_Fint * FORT_END_LEN_DECL );
00030 #pragma weak mpi_file_get_view_ = pmpi_file_get_view_
00031 #endif
00032
00033 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00034 #if defined(FORTRANCAPS)
00035 #pragma _HP_SECONDARY_DEF PMPI_FILE_GET_VIEW MPI_FILE_GET_VIEW
00036 #elif defined(FORTRANDOUBLEUNDERSCORE)
00037 #pragma _HP_SECONDARY_DEF pmpi_file_get_view__ mpi_file_get_view__
00038 #elif !defined(FORTRANUNDERSCORE)
00039 #pragma _HP_SECONDARY_DEF pmpi_file_get_view mpi_file_get_view
00040 #else
00041 #pragma _HP_SECONDARY_DEF pmpi_file_get_view_ mpi_file_get_view_
00042 #endif
00043
00044 #elif defined(HAVE_PRAGMA_CRI_DUP)
00045 #if defined(FORTRANCAPS)
00046 #pragma _CRI duplicate MPI_FILE_GET_VIEW as PMPI_FILE_GET_VIEW
00047 #elif defined(FORTRANDOUBLEUNDERSCORE)
00048 #pragma _CRI duplicate mpi_file_get_view__ as pmpi_file_get_view__
00049 #elif !defined(FORTRANUNDERSCORE)
00050 #pragma _CRI duplicate mpi_file_get_view as pmpi_file_get_view
00051 #else
00052 #pragma _CRI duplicate mpi_file_get_view_ as pmpi_file_get_view_
00053 #endif
00054
00055
00056 #endif
00057
00058 #include "mpioprof.h"
00059 #endif
00060
00061 #ifdef FORTRANCAPS
00062 #define mpi_file_get_view_ PMPI_FILE_GET_VIEW
00063 #elif defined(FORTRANDOUBLEUNDERSCORE)
00064 #define mpi_file_get_view_ pmpi_file_get_view__
00065 #elif !defined(FORTRANUNDERSCORE)
00066 #if defined(HPUX) || defined(SPPUX)
00067 #pragma _HP_SECONDARY_DEF pmpi_file_get_view pmpi_file_get_view_
00068 #endif
00069 #define mpi_file_get_view_ pmpi_file_get_view
00070 #else
00071 #if defined(HPUX) || defined(SPPUX)
00072 #pragma _HP_SECONDARY_DEF pmpi_file_get_view_ pmpi_file_get_view
00073 #endif
00074 #define mpi_file_get_view_ pmpi_file_get_view_
00075 #endif
00076
00077 #else
00078
00079 #ifdef FORTRANCAPS
00080 #define mpi_file_get_view_ MPI_FILE_GET_VIEW
00081 #elif defined(FORTRANDOUBLEUNDERSCORE)
00082 #define mpi_file_get_view_ mpi_file_get_view__
00083 #elif !defined(FORTRANUNDERSCORE)
00084 #if defined(HPUX) || defined(SPPUX)
00085 #pragma _HP_SECONDARY_DEF mpi_file_get_view mpi_file_get_view_
00086 #endif
00087 #define mpi_file_get_view_ mpi_file_get_view
00088 #else
00089 #if defined(HPUX) || defined(SPPUX)
00090 #pragma _HP_SECONDARY_DEF mpi_file_get_view_ mpi_file_get_view
00091 #endif
00092 #endif
00093 #endif
00094
00095 #if defined(MPIHP) || defined(MPILAM)
00096
00097 void mpi_file_get_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Fint *etype,
00098 MPI_Fint *filetype,char *datarep, MPI_Fint *ierr, int str_len );
00099
00100 void mpi_file_get_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Fint *etype,
00101 MPI_Fint *filetype,char *datarep, MPI_Fint *ierr, int str_len )
00102 {
00103 MPI_File fh_c;
00104 MPI_Datatype etype_c, filetype_c;
00105 int i, tmpreplen;
00106 char *tmprep;
00107
00108 if (datarep <= (char *) 0) {
00109 FPRINTF(stderr, "MPI_File_get_view: datarep is an invalid address\n");
00110 MPI_Abort(MPI_COMM_WORLD, 1);
00111 }
00112
00113 tmprep = (char *) ADIOI_Malloc((MPI_MAX_DATAREP_STRING+1) * sizeof(char));
00114 fh_c = MPI_File_f2c(*fh);
00115 *ierr = MPI_File_get_view(fh_c, disp, &etype_c, &filetype_c, tmprep);
00116
00117 tmpreplen = strlen(tmprep);
00118 if (tmpreplen <= str_len) {
00119 ADIOI_Strncpy(datarep, tmprep, tmpreplen);
00120
00121
00122 for (i=tmpreplen; i<str_len; i++) datarep[i] = ' ';
00123 }
00124 else {
00125
00126 ADIOI_Strncpy(datarep, tmprep, str_len);
00127
00128 *ierr = MPI_ERR_UNKNOWN;
00129 }
00130
00131 *etype = MPI_Type_c2f(etype_c);
00132 *filetype = MPI_Type_c2f(filetype_c);
00133 ADIOI_Free(tmprep);
00134 }
00135
00136 #else
00137
00138 #ifdef _UNICOS
00139 void mpi_file_get_view_(MPI_Fint *fh,MPI_Offset *disp,MPI_Fint *etype,
00140 MPI_Fint *filetype, _fcd datarep_fcd, MPI_Fint *ierr)
00141 {
00142 char *datarep = _fcdtocp(datarep_fcd);
00143 int str_len = _fcdlen(datarep_fcd);
00144 #else
00145
00146 FORTRAN_API void FORT_CALL mpi_file_get_view_( MPI_Fint *fh, MPI_Offset *disp, MPI_Fint *etype, MPI_Fint *filetype, char *datarep FORT_MIXED_LEN_DECL, MPI_Fint *ierr FORT_END_LEN_DECL );
00147
00148 FORTRAN_API void FORT_CALL mpi_file_get_view_( MPI_Fint *fh, MPI_Offset *disp, MPI_Fint *etype, MPI_Fint *filetype, char *datarep FORT_MIXED_LEN(str_len), MPI_Fint *ierr FORT_END_LEN(str_len) )
00149 {
00150 #endif
00151 MPI_File fh_c;
00152 int i, tmpreplen;
00153 MPI_Datatype etype_c, filetype_c;
00154
00155 char *tmprep;
00156
00157
00158 if (datarep <= (char *) 0) {
00159 FPRINTF(stderr, "MPI_File_get_view: datarep is an invalid address\n");
00160 MPI_Abort(MPI_COMM_WORLD, 1);
00161 }
00162
00163 tmprep = (char *) ADIOI_Malloc((MPI_MAX_DATAREP_STRING+1) * sizeof(char));
00164 fh_c = MPI_File_f2c(*fh);
00165 etype_c = MPI_Type_f2c(*etype);
00166 filetype_c = MPI_Type_f2c(*filetype);
00167 *ierr = MPI_File_get_view(fh_c, disp, &etype_c, &filetype_c, tmprep);
00168
00169 tmpreplen = strlen(tmprep);
00170 if (tmpreplen <= str_len) {
00171 ADIOI_Strncpy(datarep, tmprep, tmpreplen);
00172
00173
00174 for (i=tmpreplen; i<str_len; i++) datarep[i] = ' ';
00175 }
00176 else {
00177
00178 ADIOI_Strncpy(datarep, tmprep, str_len);
00179
00180 *ierr = MPI_ERR_UNKNOWN;
00181 }
00182
00183 ADIOI_Free(tmprep);
00184 }
00185 #endif