* Q3: numItems? Huh? What? Sorry for the inconsistency on my part... numItems and buffSize are intended to be one and the same thing -- I just failed to use a consistent name for them. The routine should compute head = (head + 1) % numItems (or you can rename the argument buffSize if you prefer) * Q5c: Dynamic iterators in Chapel? Huh? What? I forgot to provide a pointer in the assignment, but Chapel provides some standard dynamic iterators on ranges, similar to those in OpenMP, as a standard library. For full documentation on the options available, see the "AdvancedIters" section in the "Standard Modules" section of the language specification. Here's a brief overview: In order to access any of them in your source code, you'll need to 'use AdvancedIters;' to make the symbols in that module available. A simple example is the 'dynamic' iterator which deals out chunks of iterations from an argument range to tasks. For example: forall i in dynamic(1..1000, chunkSize=10, numTasks=4) { ... } would create 4 tasks to iterate over the range 1..1000, dealing out chunks of 10 iterations at a time to tasks as they need more work. The other iterators currently supported deal out increasingly small chunks and/or steal work from one another as tasks become idle. One correction to the spec: The spec's protoypes suggest that the numTasks argument has a default argument such that you don't have to provide it (it defaults to 0 which is an indication that it should use the global 'dataParTasksPerLocale' value that we discussed in lecture this week). It seems that the implementation doesn't have this default value plugged in correctly, so you do need to supply an argument to specify the number of tasks explicitly (though you can still supply '0' to request the default of dataParTasksPerLocale). Over time, we expect to support such dynamic iterators on domains and arrays as well, but I haven't coerced anyone into writing them yet. This means that for a 2D problem you'll have to iterate over the dimensions independently rather than saying something cool like 'forall (i,j) in dynamic({1..rows, 1..cols}, ...)' You can either name the ranges and/or iterate over them explicitly, or query them back out of a domain or array. Given an array A and domain D: A.domain -- returns an array's domain D.dim(i) -- return the range corresponding to dimension i of the domain