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_read_all_begin = PMPI_File_read_all_begin
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPI_File_read_all_begin MPI_File_read_all_begin
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPI_File_read_all_begin as PMPI_File_read_all_begin
00018
00019 #endif
00020
00021
00022 #define MPIO_BUILD_PROFILING
00023 #include "mpioprof.h"
00024 #endif
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 int MPI_File_read_all_begin(MPI_File mpi_fh, void *buf, int count,
00040 MPI_Datatype datatype)
00041 {
00042 int error_code;
00043 static char myname[] = "MPI_FILE_READ_ALL_BEGIN";
00044
00045 error_code = MPIOI_File_read_all_begin(mpi_fh, (MPI_Offset) 0,
00046 ADIO_INDIVIDUAL, buf, count,
00047 datatype, myname);
00048
00049 return error_code;
00050 }
00051
00052
00053
00054 int MPIOI_File_read_all_begin(MPI_File mpi_fh,
00055 MPI_Offset offset,
00056 int file_ptr_type,
00057 void *buf,
00058 int count,
00059 MPI_Datatype datatype,
00060 char *myname)
00061 {
00062 int error_code, datatype_size;
00063 ADIO_File fh;
00064
00065 MPIU_THREAD_CS_ENTER(ALLFUNC,);
00066
00067 fh = MPIO_File_resolve(mpi_fh);
00068
00069
00070 MPIO_CHECK_FILE_HANDLE(fh, myname, error_code);
00071 MPIO_CHECK_COUNT(fh, count, myname, error_code);
00072 MPIO_CHECK_DATATYPE(fh, datatype, myname, error_code);
00073
00074 if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0)
00075 {
00076 error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00077 myname, __LINE__, MPI_ERR_ARG,
00078 "**iobadoffset", 0);
00079 error_code = MPIO_Err_return_file(fh, error_code);
00080 goto fn_exit;
00081 }
00082
00083
00084 MPI_Type_size(datatype, &datatype_size);
00085
00086
00087 MPIO_CHECK_INTEGRAL_ETYPE(fh, count, datatype_size, myname, error_code);
00088 MPIO_CHECK_READABLE(fh, myname, error_code);
00089 MPIO_CHECK_NOT_SEQUENTIAL_MODE(fh, myname, error_code);
00090
00091 if (fh->split_coll_count) {
00092 error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00093 myname, __LINE__, MPI_ERR_IO,
00094 "**iosplitcoll", 0);
00095 error_code = MPIO_Err_return_file(fh, error_code);
00096 goto fn_exit;
00097 }
00098 MPIO_CHECK_COUNT_SIZE(fh, count, datatype_size, myname, error_code);
00099
00100
00101 fh->split_coll_count = 1;
00102
00103 ADIO_ReadStridedColl(fh, buf, count, datatype, file_ptr_type,
00104 offset, &fh->split_status, &error_code);
00105
00106
00107 if (error_code != MPI_SUCCESS)
00108 error_code = MPIO_Err_return_file(fh, error_code);
00109
00110
00111 fn_exit:
00112 MPIU_THREAD_CS_EXIT(ALLFUNC,);
00113
00114 return error_code;
00115 }
00116