33 * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
44 * University Research and Technology
55 * Corporation. All rights reserved.
6- * Copyright (c) 2004-2005 The University of Tennessee and The University
6+ * Copyright (c) 2004-2016 The University of Tennessee and The University
77 * of Tennessee Research Foundation. All rights
88 * reserved.
99 * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
@@ -45,7 +45,7 @@ int MPI_Unpack_external (const char datarep[], const void *inbuf, MPI_Aint insiz
4545 MPI_Aint * position , void * outbuf , int outcount ,
4646 MPI_Datatype datatype )
4747{
48- int rc ;
48+ int rc = MPI_SUCCESS ;
4949 opal_convertor_t local_convertor ;
5050 struct iovec outvec ;
5151 unsigned int iov_count ;
@@ -62,9 +62,11 @@ int MPI_Unpack_external (const char datarep[], const void *inbuf, MPI_Aint insiz
6262 return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD , MPI_ERR_ARG , FUNC_NAME );
6363 } else if (outcount < 0 ) {
6464 return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD , MPI_ERR_COUNT , FUNC_NAME );
65- } else if (MPI_DATATYPE_NULL == datatype || NULL == datatype ) {
66- return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD , MPI_ERR_TYPE , FUNC_NAME );
6765 }
66+ OMPI_CHECK_DATATYPE_FOR_RECV (rc , datatype , outcount );
67+ OMPI_ERRHANDLER_CHECK (rc , MPI_COMM_WORLD , rc , FUNC_NAME );
68+ OMPI_CHECK_USER_BUFFER (rc , outbuf , datatype , outcount );
69+ OMPI_ERRHANDLER_CHECK (rc , MPI_COMM_WORLD , rc , FUNC_NAME );
6870 }
6971
7072 OPAL_CR_ENTER_LIBRARY ();
@@ -73,7 +75,9 @@ int MPI_Unpack_external (const char datarep[], const void *inbuf, MPI_Aint insiz
7375
7476 /* the resulting convertor will be set to the position ZERO */
7577 opal_convertor_copy_and_prepare_for_recv ( ompi_mpi_external32_convertor ,
76- & (datatype -> super ), outcount , outbuf , 0 , & local_convertor );
78+ & (datatype -> super ), outcount , outbuf ,
79+ 0 ,
80+ & local_convertor );
7781
7882 /* Check for truncation */
7983 opal_convertor_get_packed_size ( & local_convertor , & size );
0 commit comments