Add 3 macros to check for the correctness of a datatype and for it's suitability for a specific operation.
OMPI_CHECK_DATATYPE_FOR_SEND OMPI_CHECK_DATATYPE_FOR_RECV OMPI_CHECK_DATATYPE_FOR_ONE_SIDED BE AWARE ! these macros does not trigger the error handle, they just set a error code in the first argument. You have to check for the error code after the call. This commit was SVN r1782.
Этот коммит содержится в:
родитель
206d6ecfe0
Коммит
cfb28af59a
@ -19,4 +19,33 @@
|
||||
|
||||
extern bool ompi_mpi_param_check;
|
||||
|
||||
/* These macros have to be used to check the corectness of the datatype depending on the
|
||||
* operations that we have to do with them. They can be used on all functions, not only
|
||||
* on the top level MPI functions, as they does not trigger the error handler. Is the user
|
||||
* responsability to do it.
|
||||
*/
|
||||
#define OMPI_CHECK_DATATYPE_FOR_SEND( RC, DDT, COUNT ) \
|
||||
do { \
|
||||
if( (DDT) == MPI_DATATYPE_NULL ) (RC) = MPI_ERR_TYPE; \
|
||||
else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \
|
||||
else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \
|
||||
} while (0)
|
||||
|
||||
#define OMPI_CHECK_DATATYPE_FOR_RECV( RC, DDT, COUNT ) \
|
||||
do { \
|
||||
if( (DDT) == MPI_DATATYPE_NULL ) (RC) = MPI_ERR_TYPE; \
|
||||
else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \
|
||||
else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \
|
||||
else if( ompi_ddt_is_overerlapped((DDT)) ) (RC) = MPI_ERR_TYPE; \
|
||||
} while (0)
|
||||
|
||||
#define OMPI_CHECK_DATATYPE_FOR_ONE_SIDED( RC, DDT, COUNT ) \
|
||||
do { \
|
||||
if( (DDT) == MPI_DATATYPE_NULL ) (RC) = MPI_ERR_TYPE; \
|
||||
else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \
|
||||
else if( !ompi_ddt_is_committed((DDT)) ) (RC) = MPI_ERR_TYPE; \
|
||||
else if( ompi_ddt_is_overerlapped((DDT)) ) (RC) = MPI_ERR_TYPE; \
|
||||
else if( !ompi_ddt_is_acceptable_for_one_sided((DDT)) ) (RC) = MPI_ERR_TYPE; \
|
||||
} while(0)
|
||||
|
||||
#endif /* OMPI_C_BINDINGS_H */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user