|
Assignment
Your assignment is to locate
an error in the following program. The program is hanging before it gets to the print statement.
Compile the code with ifort and locate the source of the error.
Details
cut and paste the program into send.c
icc -g -lmpi -o send send.c
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"
- Using totalview to set the breakpoint on either
process 1 or process 2 to see till which line the job
is going and at which line the job hangs.
- After finding the line at which line the job hangs
examine the variables and arguments, which have been
used till that line and analyze what can be the culprit
to cause the 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.
|