2
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3
* University Research and Technology
4
* Corporation. All rights reserved.
5
* Copyright (c) 2004-2005 The University of Tennessee and The University
6
* of Tennessee Research Foundation. All rights
8
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9
* University of Stuttgart. All rights reserved.
10
* Copyright (c) 2004-2005 The Regents of the University of California.
11
* All rights reserved.
14
* Additional copyrights may follow
19
#include "ompi_config.h"
21
#include "ompi/mpi/c/bindings.h"
22
#include "ompi/datatype/datatype.h"
24
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
25
#pragma weak MPI_Type_vector = PMPI_Type_vector
28
#if OMPI_PROFILING_DEFINES
29
#include "ompi/mpi/c/profile/defines.h"
32
static const char FUNC_NAME[] = "MPI_Type_vector";
34
int MPI_Type_vector(int count,
38
MPI_Datatype *newtype)
42
if( MPI_PARAM_CHECK ) {
43
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
44
if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype ||
46
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE,
48
} else if( count < 0 ) {
49
OMPI_ERRHANDLER_RETURN( MPI_ERR_COUNT, MPI_COMM_WORLD,
50
MPI_ERR_COUNT, FUNC_NAME );
51
} else if( blocklength < 0) {
52
OMPI_ERRHANDLER_RETURN( MPI_ERR_ARG, MPI_COMM_WORLD,
53
MPI_ERR_ARG, FUNC_NAME );
57
rc = ompi_ddt_create_vector ( count, blocklength, stride, oldtype, newtype );
58
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME );
63
a_i[1] = &blocklength;
66
ompi_ddt_set_args( *newtype, 3, a_i, 0, NULL, 1, &oldtype, MPI_COMBINER_VECTOR );