1 /* Copyright (c) 2012-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
11 int main(int argc, char **argv) {
14 double a[SIZE][SIZE] = {{0}};
16 MPI_Datatype columntype;
18 MPI_Init(&argc,&argv);
19 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
21 MPI_Type_vector(SIZE, 1, SIZE, MPI_DOUBLE, &columntype);
22 MPI_Type_commit(&columntype);
31 /* only one column is send
32 * this is an exemple for non-contignous data*/
33 MPI_Bcast(a, 1, columntype, 0, MPI_COMM_WORLD);
35 for(i=0; i<SIZE; i++){
36 for (j=0; j < SIZE; j++) {
37 printf("rank= %d, a[%d][%d]=%f\n",
44 MPI_Type_free(&columntype);