|
Assignment
Your assignment is to locate
an error in the following program. The program is hanging before it gets to the print statement.
The program is supposed to generate the number 10 on the process with rank-0, and send the number 10 to the
other process. Compile the code with ifort and locate the source of the error.
Details
cut and paste the program into send.f
ifort -g -lmpi -o send send.f
mpirun -np 2 ./send
This program will hang and produce no output. Press
Control-C to kill the job.
Tips
- Launch totalview with:
totalview mpirun -a -np 2 ./send
- Click the button "Go"
- When asked if you want to stop the job, respond "Yes"
- You can set a breakpoint on either
process 0 or process 1.
- Determine which process is causing the program to hang.
A solution
In the loop that incriments isbuf, it should only incriment by 1 at a time instead of 2. Alternatively, the initial value of isbuf could be set to a small even number.
|