Notes/Clarifications on Assignment #4 ------------------------------------- * Q2: In answering a student question on the message boards (Q: lecture 4 slide pp 10), I found an error in the math I used in lecture to compute imbalance in the 3D array case. I'll work on updating my slides when I get a chance, but in the meantime, see the topic on the discussion board (made sticky) for the correction as well as a more thorough explanation for how the number was derived. * Q4 (added 2/2): I wrote up the code framework with a problem size of 10 and a maxval of 100 simply for the sake of easy debugging. In approaching the problem, assume that n >> maxval for a "production" run of the reduction (i.e., reducing 10 things in parallel isn't generally very interesting). For that reason, storing state that's O(maxval) is fine. Others have pointed out that printing out the results of a large run isn't very easy to read; feel free to set n and maxval to values that make your output (a) not overwhelming and (b) interesting. * Q4: If, while working on writing your user-defined reduction, you get a warning that the 'reduce has been serialized', the implication in the context of this assignment is that your combine() function contains a problem that prevented it from compiling correctly; what happens is that, since the combine() routine isn't functional, the compiler will fall back to an implementation that only uses the accumulator and generator (and is therefore, by definition, serial). The best way to debug such cases is to call into the combine() function directly rather than having the compiler do it through a reduce operation. This should reveal the root cause of the problem. For example, if my mostFrequent.combine() function contained an unresolved function call to 'foo()', using the following code snippet: var debug1 = new mostFrequent(eltType=int), debug2 = new mostFrequent(eltType=int); debug1.combine(debug2); would generate the error message "unresolved call 'foo()'" rather than the more general 'reduce has been serialized' message. * Q5: As noted on email and the webpage, part d ("Use a d-ary tree") is now completely optional and will not be graded.x