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 = PMPI_File_write_all
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPI_File_write_all MPI_File_write_all
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPI_File_write_all as PMPI_File_write_all
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
00040
00041
00042 int MPI_File_write_all(MPI_File mpi_fh, void *buf, int count,
00043 MPI_Datatype datatype, MPI_Status *status)
00044 {
00045 int error_code;
00046 static char myname[] = "MPI_FILE_WRITE_ALL";
00047 #ifdef MPI_hpux
00048 int fl_xmpi;
00049
00050 HPMP_IO_START(fl_xmpi, BLKMPIFILEWRITEALL, TRDTBLOCK, fh, datatype, count);
00051 #endif
00052
00053 error_code = MPIOI_File_write_all(mpi_fh, (MPI_Offset) 0,
00054 ADIO_INDIVIDUAL, buf,
00055 count, datatype, myname, status);
00056
00057 #ifdef MPI_hpux
00058 HPMP_IO_END(fl_xmpi, fh, datatype, count);
00059 #endif
00060
00061 return error_code;
00062 }
00063
00064
00065
00066 int MPIOI_File_write_all(MPI_File mpi_fh,
00067 MPI_Offset offset,
00068 int file_ptr_type,
00069 void *buf,
00070 int count,
00071 MPI_Datatype datatype,
00072 char *myname,
00073 MPI_Status *status)
00074 {
00075 int error_code, datatype_size;
00076 ADIO_File fh;
00077
00078 MPIU_THREAD_CS_ENTER(ALLFUNC,);
00079
00080 fh = MPIO_File_resolve(mpi_fh);
00081
00082
00083 MPIO_CHECK_FILE_HANDLE(fh, myname, error_code);
00084 MPIO_CHECK_COUNT(fh, count, myname, error_code);
00085 MPIO_CHECK_DATATYPE(fh, datatype, myname, error_code);
00086
00087 if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0)
00088 {
00089 error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00090 myname, __LINE__, MPI_ERR_ARG,
00091 "**iobadoffset", 0);
00092 error_code = MPIO_Err_return_file(fh, error_code);
00093 goto fn_exit;
00094 }
00095
00096
00097 MPI_Type_size(datatype, &datatype_size);
00098
00099
00100 MPIO_CHECK_INTEGRAL_ETYPE(fh, count, datatype_size, myname, error_code);
00101 MPIO_CHECK_WRITABLE(fh, myname, error_code);
00102 MPIO_CHECK_NOT_SEQUENTIAL_MODE(fh, myname, error_code);
00103 MPIO_CHECK_COUNT_SIZE(fh, count, datatype_size, myname, error_code);
00104
00105
00106 ADIO_WriteStridedColl(fh, buf, count, datatype, file_ptr_type,
00107 offset, status, &error_code);
00108
00109
00110 if (error_code != MPI_SUCCESS)
00111 error_code = MPIO_Err_return_file(fh, error_code);
00112
00113
00114 fn_exit:
00115 MPIU_THREAD_CS_EXIT(ALLFUNC,);
00116
00117 return error_code;
00118 }
00119