#define CHECK_RDONLY(fh) \
if ((fh)->flags() & MPI_MODE_RDONLY) \
return MPI_ERR_AMODE;
+#define CHECK_WRONLY(fh) \
+ if ((fh)->flags() & MPI_MODE_WRONLY) \
+ return MPI_ERR_AMODE;
#define PASS_ZEROCOUNT(count) \
if ((count) == 0) { \
status->count = 0; \
CHECK_BUFFER(2, buf, count) \
CHECK_COUNT(3, count) \
CHECK_TYPE(4, datatype) \
- CHECK_NULL(5, MPI_ERR_ARG, status)
#define CHECK_FILE_INPUT_OFFSET \
CHECK_FILE(1, fh) \
CHECK_OFFSET(3, offset) \
CHECK_COUNT(4, count) \
CHECK_TYPE(5, datatype) \
- CHECK_NULL(6, MPI_ERR_ARG, status)
extern MPI_Errhandler SMPI_default_File_Errhandler;
int PMPI_File_read(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
CHECK_FLAGS(fh)
+ CHECK_WRONLY(fh)
PASS_ZEROCOUNT(count)
smpi_bench_end();
int rank_traced = simgrid::s4u::this_actor::get_pid();
int PMPI_File_read_shared(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
CHECK_FILE_INPUTS
CHECK_FLAGS(fh)
+ CHECK_WRONLY(fh)
PASS_ZEROCOUNT(count)
smpi_bench_end();
int rank_traced = simgrid::s4u::this_actor::get_pid();
int PMPI_File_read_all(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
CHECK_FILE_INPUTS
CHECK_FLAGS(fh)
+ CHECK_WRONLY(fh)
smpi_bench_end();
int rank_traced = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read_all", count * datatype->size()));
int PMPI_File_read_ordered(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
CHECK_FILE_INPUTS
CHECK_FLAGS(fh)
+ CHECK_WRONLY(fh)
smpi_bench_end();
int rank_traced = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(rank_traced, __func__,
int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
CHECK_FILE_INPUTS
CHECK_FLAGS(fh)
+ CHECK_WRONLY(fh)
PASS_ZEROCOUNT(count);
smpi_bench_end();
int rank_traced = simgrid::s4u::this_actor::get_pid();
int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
CHECK_FILE_INPUT_OFFSET
CHECK_FLAGS(fh)
+ CHECK_WRONLY(fh)
smpi_bench_end();
int rank_traced = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(rank_traced, __func__,