uwsampa / grappa

Grappa: scaling irregular applications on commodity clusters
grappa.io
BSD 3-Clause "New" or "Revised" License
159 stars 50 forks source link

Provide additional debug info in loop decompositions #167

Open nelsonje opened 10 years ago

nelsonje commented 10 years ago

One of our collaborators tried writing code like this:

delegate( v, [g] (Vertex & v) {
  forall(adj(g, v), [] (Vertex & n) {
    doSomethingTo(n);
  }
}

and of course got the always-fun "Trying to context switch in no-switch region" message. The backtrace showed a big mess of templated loop decomposition stuff; it was not clear how to the error back to this line of code.

Can we plumb FILE, LINE, and/or func down the decomposition through the FORALL_OVERLOAD macro to make this sort of debugging easier?

Are there other places we could add additional debugging info in our templated code?

bholt commented 10 years ago

Good question. We're still not gonna escape the messy backtrace -- nesting lambdas is just terrible for naming. But it may be that we can surface the original source code line better in the error message.