|
Assignment
Your assignment is to use TotalView to locate
an error in the following program.
3-P MPI scatter example.
In this example,
one process is generated a 3-elements array and scatters
one element to each of the processes. But when running the
job, I got the results very strange:
Details
cut and paste the code into the file scatter.f
ifort -g -lmpi -o scatter scatter.f
mpirun -np 3 ./scatter
Tips
Use TotalView
- Set breakpoints to determine what each MPI task is doing.
A solution
The MPI_Scatter call must occur outside of the last if statement. Otherwise, only the root MPI task will see the scatter command.
|