Task 0 initializes a variable to a given value,then modifies the variable (for example, by calculating the square of its value) and finally broadcasts it to all the others tasks.
HINTS: |
|
C |
|
MPI_BCAST |
int MPI_Bcast(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) |
MPI_INIT |
|
MPI_COMM_SIZE | |
MPI_COMM_RANK |
|
MPI_FINALIZE |
|
|
|
MPI_BCAST |
|
MPI_INIT |
|
MPI_COMM_SIZE |
MPI_COMM_SIZE(COMM, SIZE, IERROR) |
MPI_COMM_RANK |
MPI_COMM_RANK(COMM, RANK, IERROR) |
MPI_FINALIZE |