1 /* Copyright (c) 2009. 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. */
10 int main(int argc, char **argv)
17 MPI_Init(&argc, &argv);
18 MPI_Comm_size(MPI_COMM_WORLD, &size);
19 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
21 if (argc > 1 && !strcmp(argv[1], "-q"))
24 start_timer = MPI_Wtime();
29 MPI_Bcast(&value, 1, MPI_INT, 0, MPI_COMM_WORLD);
31 printf("node %d has value %d after broadcast\n", rank, value);
34 MPI_Barrier(MPI_COMM_WORLD);
35 if (0 == rank && !quiet)
36 printf("Elapsed time on rank %d: %lf s\n", rank,
37 MPI_Wtime() - start_timer);