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_write_all_begin = PMPI_File_write_all_begin
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPI_File_write_all_begin MPI_File_write_all_begin
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPI_File_write_all_begin as PMPI_File_write_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 int MPI_File_write_all_begin(MPI_File mpi_fh, void *buf, int count,
00039 MPI_Datatype datatype)
00040 {
00041 int error_code;
00042 static char myname[] = "MPI_FILE_WRITE_ALL_BEGIN";
00043
00044 error_code = MPIOI_File_write_all_begin(mpi_fh, (MPI_Offset) 0,
00045 ADIO_INDIVIDUAL, buf, count,
00046 datatype, myname);
00047
00048 return error_code;
00049 }
00050
00051
00052
00053 int MPIOI_File_write_all_begin(MPI_File mpi_fh,
00054 MPI_Offset offset,
00055 int file_ptr_type,
00056 void *buf,
00057 int count,
00058 MPI_Datatype datatype,
00059 char *myname)
00060 {
00061 int error_code, datatype_size;
00062 ADIO_File fh;
00063
00064 MPIU_THREAD_CS_ENTER(ALLFUNC,);
00065
00066 fh = MPIO_File_resolve(mpi_fh);
00067
00068
00069 MPIO_CHECK_FILE_HANDLE(fh, myname, error_code);
00070 MPIO_CHECK_COUNT(fh, count, myname, error_code);
00071 MPIO_CHECK_DATATYPE(fh, datatype, myname, error_code);
00072 MPIO_CHECK_NOT_SEQUENTIAL_MODE(fh, 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 if (fh->split_coll_count)
00084 {
00085 error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00086 myname, __LINE__, MPI_ERR_IO,
00087 "**iosplitcoll", 0);
00088 error_code = MPIO_Err_return_file(fh, error_code);
00089 goto fn_exit;
00090 }
00091
00092
00093 fh->split_coll_count = 1;
00094
00095 MPI_Type_size(datatype, &datatype_size);
00096
00097 MPIO_CHECK_INTEGRAL_ETYPE(fh, count, datatype_size, myname, error_code);
00098 MPIO_CHECK_COUNT_SIZE(fh, count, datatype_size, myname, error_code);
00099
00100
00101 fh->split_datatype = datatype;
00102 ADIO_WriteStridedColl(fh, buf, count, datatype, file_ptr_type,
00103 offset, &fh->split_status, &error_code);
00104
00105
00106 if (error_code != MPI_SUCCESS)
00107 error_code = MPIO_Err_return_file(fh, error_code);
00108
00109
00110 fn_exit:
00111 MPIU_THREAD_CS_EXIT(ALLFUNC,);
00112
00113 return error_code;
00114 }
00115