source: CIVL/examples/mpi/collective/bcast_bad.c@ 77030d0

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 77030d0 was 77030d0, checked in by Ziqing Luo <ziqing@…>, 11 years ago

add arguments for main

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@2107 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 371 bytes
Line 
1#include<mpi.h>
2
3int main(int argc, char * argv[])
4{
5 int rank;
6 int procs;
7 int value;
8
9 MPI_Init(&argc,&argv);
10 MPI_Comm_size(MPI_COMM_WORLD, &procs);
11 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
12
13 if (rank == 0)
14 value = 123;
15
16 if (rank != 5)
17 MPI_Bcast(&value, 1, MPI_INT, 0, MPI_COMM_WORLD);
18
19 MPI_Finalize();
20 return 0;
21}
Note: See TracBrowser for help on using the repository browser.