This source file includes following definitions.
- MPI_Status_set_elements_x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include "ompi_config.h"
25 #include <stdio.h>
26
27 #include "ompi/mpi/c/bindings.h"
28 #include "ompi/runtime/params.h"
29 #include "ompi/communicator/communicator.h"
30 #include "ompi/errhandler/errhandler.h"
31 #include "ompi/datatype/ompi_datatype.h"
32 #include "ompi/memchecker.h"
33
34 #if OMPI_BUILD_MPI_PROFILING
35 #if OPAL_HAVE_WEAK_SYMBOLS
36 #pragma weak MPI_Status_set_elements_x = PMPI_Status_set_elements_x
37 #endif
38 #define MPI_Status_set_elements_x PMPI_Status_set_elements_x
39 #endif
40
41 static const char FUNC_NAME[] = "MPI_Status_set_elements_x";
42
43 int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count count)
44 {
45 int rc = MPI_SUCCESS;
46 size_t size;
47
48 MEMCHECKER(
49 if(status != MPI_STATUSES_IGNORE) {
50
51
52
53
54 opal_memchecker_base_mem_defined(&status->MPI_ERROR, sizeof(int));
55 memchecker_status (status);
56 memchecker_datatype(datatype);
57 }
58 );
59
60 OPAL_CR_NOOP_PROGRESS();
61
62 if (MPI_PARAM_CHECK) {
63 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
64 if (NULL == datatype || MPI_DATATYPE_NULL == datatype) {
65 rc = MPI_ERR_TYPE;
66 } else if (count < 0) {
67 rc = MPI_ERR_COUNT;
68 }
69 OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
70 }
71
72
73
74 if (MPI_STATUS_IGNORE == status || MPI_STATUSES_IGNORE == status) {
75 return MPI_SUCCESS;
76 }
77
78 if( ompi_datatype_is_predefined(datatype) ) {
79 ompi_datatype_type_size( datatype, &size );
80 status->_ucount = count * size;
81 } else {
82 ompi_datatype_set_element_count( datatype, count, &size );
83 status->_ucount = size;
84 }
85 return MPI_SUCCESS;
86 }