next up previous contents
Next: 8 Neighbour list Up: grape6user Previous: 6 Example

7 Error recovery

As you can see in the previous example and in some of the routines, they might return error, and the application program has to handle these errors to continue calculation.

In particular, if non-zero value is returned by g6calc_lasthalf, it almost always implies an intermittent hardware error. The following code fragment shows the error recovery section of nbody1 with multi-cluster support.

         do ic = 1, g6ncluster
            if (g6error(ic) .eq. 1) then
               write(6,*) 'GRAPE-6 hard error on cluster', ic
               do jj = 1, g6ncluster
                  call g6_reinitialize(jj-1)
                  call g6_set_ti(jj-1,time)
               enddo
               do i = nbh+1, n
                  call g6_set_j_particle(g6jcid(i),g6jcloc(i), i,
     $                 t0(i), step(i), mharp(i), j2,
     $                 fdot(1,i), f(1,i), x0dot(1,i), x0(1,i))
               enddo
               goto 1500
            endif
         enddo

The idea is just to reset the hardware and send all data again if any error occurred. Since the error is intermittent, on the second try the error would normally vanish. If there is real hardware problem, well, contact your friend with hardware knowledge...



Jun Makino
平成17年1月31日