00001
00002
00003
00004
00005
00006
00007
00008 #include "mpioimpl.h"
00009
00010 #ifdef HAVE_WEAK_SYMBOLS
00011
00012 #if defined(HAVE_PRAGMA_WEAK)
00013 #pragma weak MPI_File_get_view = PMPI_File_get_view
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPI_File_get_view MPI_File_get_view
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPI_File_get_view as PMPI_File_get_view
00018
00019 #endif
00020
00021
00022 #define MPIO_BUILD_PROFILING
00023 #include "mpioprof.h"
00024 #endif
00025 #ifdef MPISGI
00026 #include "mpisgi2.h"
00027 #endif
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 int MPI_File_get_view(MPI_File mpi_fh,
00044 MPI_Offset *disp,
00045 MPI_Datatype *etype,
00046 MPI_Datatype *filetype,
00047 char *datarep)
00048 {
00049 int error_code;
00050 ADIO_File fh;
00051 static char myname[] = "MPI_FILE_GET_VIEW";
00052 int i, j, k, combiner;
00053 MPI_Datatype copy_etype, copy_filetype;
00054
00055 MPIU_THREAD_CS_ENTER(ALLFUNC,);
00056
00057 fh = MPIO_File_resolve(mpi_fh);
00058
00059
00060 MPIO_CHECK_FILE_HANDLE(fh, myname, error_code);
00061
00062 if (datarep <= (char *) 0)
00063 {
00064 error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00065 myname, __LINE__, MPI_ERR_ARG,
00066 "**iodatarepnomem", 0);
00067 error_code = MPIO_Err_return_file(fh, error_code);
00068 goto fn_exit;
00069 }
00070
00071
00072 *disp = fh->disp;
00073 ADIOI_Strncpy(datarep, "native", MPI_MAX_DATAREP_STRING);
00074
00075 MPI_Type_get_envelope(fh->etype, &i, &j, &k, &combiner);
00076 if (combiner == MPI_COMBINER_NAMED) *etype = fh->etype;
00077 else {
00078
00079
00080
00081 MPI_Type_contiguous(1, fh->etype, ©_etype);
00082
00083
00084 MPI_Type_commit(©_etype);
00085 *etype = copy_etype;
00086 }
00087
00088 MPI_Type_get_envelope(fh->filetype, &i, &j, &k, &combiner);
00089 if (combiner == MPI_COMBINER_NAMED) *filetype = fh->filetype;
00090 else {
00091 MPI_Type_contiguous(1, fh->filetype, ©_filetype);
00092
00093 MPI_Type_commit(©_filetype);
00094 *filetype = copy_filetype;
00095 }
00096
00097 fn_exit:
00098 MPIU_THREAD_CS_EXIT(ALLFUNC,);
00099
00100 return MPI_SUCCESS;
00101 }