Adding LiveViz To Your Code
void matrix::serviceLiveViz() {
  liveVizPollRequestMsg *m;
  while ( (m = liveVizPoll((ArrayElement *)this, timestep))
       != NULL ) {
    requestNextFrame(m);
  }
}
void matrix::startTimeSlice() {
  // Send ghost row north, south, east, west, . . .
  sendMsg(dims.x-2, NORTH, dims.x+1, 1, +0, -1);
  // Now having sent all our ghosts, service liveViz
  // while waiting for neighbor’s ghosts to arrive.
  serviceLiveViz();
}