#include #include #include int main(int argc, char **argv) { int nr, n, i, liczba; MPI_Status st; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &n); MPI_Comm_rank(MPI_COMM_WORLD, &nr); if (nr == 0) { liczba = atoi(argv[1]); MPI_Bcast(&liczba, 1, MPI_INT, 0, MPI_COMM_WORLD); } else { MPI_Bcast(&liczba, 1, MPI_INT, 0, MPI_COMM_WORLD); printf("moj nr to %d, odebralem %d \n", nr, liczba); } MPI_Finalize(); return 0; }