General Comments about Homework 2 All Problems Testing. Use corner cases and random numbers. C and Unix are not topics of this class. They are just tools we happen to use. Feel free to ask questions on the mailing list or to me. The tools should not be in the way of our progress. However, I will continue to mark poor indentation, and questionable C practices, such as compile time warnings. If you are not sure about something, or can't solve a C or Unix problem, ask. The rest of the class and I will be happy to assist before you turn in your homework. Problem 1 Will discuss in class. Problem 2 The answer is No. A lot of people got it right, but I am not totally convinced everybody understood exactly why. I'll explain in class. During the initial broadcast, a rank may get done early. Imagine we are doing a broadcast by sending values around a ring. When a rank receives the value from its left neighbor, it can send it on to its right neighbor and then proceed to the reduction. If one of the ranks comes later to the broadcast, it will delay ranks that are after it in the rings, but earlier ranks can already proceed to the reduction. Some ranks in the reduction, only need to submit their value and can go on. If an early rank from the broadcast happens to be one of those, it can go through the "barrier" very quickly, long before some other ranks have even reached the broadcast. Problem 3 Some students assumed that MPI_Send() or MPI_Isend() followed by an MPI_Wait() would block. These sends can finish, and usually do with short messages, before the corresponding receive starts. Problem 4 Problem statement is not very clear. Also, it should refer to the root node, not rank 0. My intent was that each rank submits a single number, and the reduction function makes sure the values are in rank order. The problem can only be solved if we make the INVALID assumption that MPI evaluates the expression from right to left. That is usually the case, but not mandated by the standard. I apologize for the confusion. Everybody who tried their hands on a solution got 20 points. Problem 5 The specification for this program was not all that clear either. Most of you made reasonable assumptions for the unspecified parts.