X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cf71783d4bf34090b9ba489365fcf85b22b04e50..0757a654e51fe5da06ed31d7b918d60e720ab62e:/teshsuite/smpi/type-vector/type-vector.c diff --git a/teshsuite/smpi/type-vector/type-vector.c b/teshsuite/smpi/type-vector/type-vector.c new file mode 100644 index 0000000000..2a9a129e60 --- /dev/null +++ b/teshsuite/smpi/type-vector/type-vector.c @@ -0,0 +1,42 @@ +/* Copyright (c) 2012-2014. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +#include +#include "mpi.h" +#define SIZE 4 + +int main(int argc, char **argv) { + int rank, i, j; + double a[SIZE][SIZE] = {{0}}; + + MPI_Datatype columntype; + + MPI_Init(&argc,&argv); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + + MPI_Type_vector(SIZE, 1, SIZE, MPI_DOUBLE, &columntype); + MPI_Type_commit(&columntype); + + if (rank == 0) { + for(i=0; i