This source file includes following definitions.
- MPI_Type_vector
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
26 #include "ompi/mpi/c/bindings.h"
27 #include "ompi/runtime/params.h"
28 #include "ompi/communicator/communicator.h"
29 #include "ompi/errhandler/errhandler.h"
30 #include "ompi/datatype/ompi_datatype.h"
31 #include "ompi/memchecker.h"
32
33 #if OMPI_BUILD_MPI_PROFILING
34 #if OPAL_HAVE_WEAK_SYMBOLS
35 #pragma weak MPI_Type_vector = PMPI_Type_vector
36 #endif
37 #define MPI_Type_vector PMPI_Type_vector
38 #endif
39
40 static const char FUNC_NAME[] = "MPI_Type_vector";
41
42 int MPI_Type_vector(int count,
43 int blocklength,
44 int stride,
45 MPI_Datatype oldtype,
46 MPI_Datatype *newtype)
47 {
48 int rc;
49
50 MEMCHECKER(
51 memchecker_datatype(oldtype);
52 );
53
54 if( MPI_PARAM_CHECK ) {
55 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
56 if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype ||
57 NULL == newtype) {
58 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE,
59 FUNC_NAME );
60 } else if( count < 0 ) {
61 OMPI_ERRHANDLER_RETURN( MPI_ERR_COUNT, MPI_COMM_WORLD,
62 MPI_ERR_COUNT, FUNC_NAME );
63 } else if( blocklength < 0) {
64 OMPI_ERRHANDLER_RETURN( MPI_ERR_ARG, MPI_COMM_WORLD,
65 MPI_ERR_ARG, FUNC_NAME );
66 }
67 }
68
69 OPAL_CR_ENTER_LIBRARY();
70
71 rc = ompi_datatype_create_vector ( count, blocklength, stride, oldtype, newtype );
72 OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME );
73
74 {
75 const int* a_i[3] = {&count, &blocklength, &stride};
76
77 ompi_datatype_set_args( *newtype, 3, a_i, 0, NULL, 1, &oldtype, MPI_COMBINER_VECTOR );
78 }
79
80 OPAL_CR_EXIT_LIBRARY();
81 return MPI_SUCCESS;
82 }