- if (fh==MPI_FILE_NULL){\r
- return MPI_ERR_FILE;\r
- } else if (buf==nullptr && count > 0){\r
- return MPI_ERR_BUFFER;\r
- } else if ( count < 0){\r
- return MPI_ERR_COUNT;\r
- } else if ( datatype == MPI_DATATYPE_NULL && count > 0){\r
- return MPI_ERR_TYPE;\r
- } else if (status == nullptr){\r
- return MPI_ERR_ARG;\r
- } else if (fh->flags() & MPI_MODE_SEQUENTIAL){\r
- return MPI_ERR_AMODE;\r
- } else {\r
+ CHECK_FILE(fh);
+ CHECK_BUFFER(buf, count);\r
+ CHECK_COUNT(count);\r
+ PASS_ZEROCOUNT(count);\r
+ CHECK_DATATYPE(datatype, count);\r
+ CHECK_STATUS(status);\r
+ CHECK_FLAGS(fh);\r
+ else {\r
+ smpi_bench_end();\r
+ int rank_traced = simgrid::s4u::this_actor::get_pid();\r
+ TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read", static_cast<double>(count*datatype->size())));\r
+ int ret = simgrid::smpi::File::read(fh, buf, count, datatype, status);\r
+ TRACE_smpi_comm_out(rank_traced);\r
+ smpi_bench_begin();\r
+ return ret;\r
+ }\r
+}\r