Just getting to grips with parallel programming using the Java interface for MPI. Just wondering if someone can explain very simply how the broadcast works?
I have the following:
if (me ==0) { // This is the master process
int bvalue = 4;
MPI.COMM_WORLD.Bcast(bvalue, 0, 4, MPI.INT, 0);
}
else { // The worker processes
MPI.COMM_WORLD.Bcast(bvalue, 0, 4, MPI.INT, 0);
}
So I know the worker process has to call the bcast to receive the bvalue.. How would I go about using this value in the workers section?
If I do:
int workerb = MPI.COMM_WORLD.Bcast(bvalue, 0, 4, MPI.INT, 0);
I get an incompatible type error, void can't be converted into int.
Any help would be greatly appreciated. Thanks, Mike