Gravity Pipes (GRAPEs)

Using and Programming the GRAPE-6 at IU

Plug & Run

The GRAPE-6 uses a fourth-order, individual-timestep ``Hermite'' predictor-corrector scheme as described by Makino and Aarseth. It is anticipated that the Starlab project will adapt their Kira N-Body integrater to use the GRAPE-6 as the force calculator. Please check the StarLab page for the latest information.

Source Code Access to the GRAPE-6 Boards

The GRAPE-6 boards are accessed through the m2 libraries. Example source code can be found in $GRAPE6/g6demo Include files and link libraries are located at $GRAPE4/include and $GRAPE4/lib respectively. An example compile command would look like:

         f77 -I$GRAPE6/include -L$GRAPE6/lib -lg6hib program.f

Using the GRAPE-6 essentially revoloves calls to the GRAPE-6 hardware. At each timestep the acceleration generated by the N body interactions is returned from a a call to calculate_accel_by_grape6_noopen() Since the Research SP is a multiuser system it is wise to allocate/deallocate the GRAPE-6 hardware on each call. If the performance overhead is unacceptable, then it is the programmers responsiblity to ensure that the data loaded and returned form the GRAPE-6 is valid. i.e. someone else has not run another program at the same time and loaded different virtual particles. A basic timestep would be handled as follows:

   g6_open_(&clusterid);
   calculate_accel_by_grape6_noopen(clusterid,n,x,v,m,a,jerk, pot,eps2);
   g6close_(&clusterid);
Where the g6_open and g6_close function calls allocate/deallocate the GRAPE-6 hardware and the parameters to calculate_accel_by_grape6_noopen are
      n = number of particles (up to approximately 1,500,00)
      x = the 3-space coordinates of n bodies
      v = 3-space velocities of n bodies
      m = mass of n bodies
      a = 3-space accelerations of n bodies
      jerk = time derivative of the accelerations of n bodies
      pot = potential energies of n bodies(?)
      eps2 = epsilon squared; a softening parameter(?)

Troubleshooting the GRAPE-6 Hardware

A simple test to see if you have access to the GRAPE-6 hardware and whether it is functioning properly would be :

export GRAPE6_CONFIG_FILE $GRAPE6/g6config.dat

# test PCI hardware
cd $GRAPE6/phibdd/phib
./phibtest 7

# basic hardware test
cd $GRAPE6/g6hib(?)
./g6libtest < testparm | tail

# shared-timestep example
cd $GRAPE6/simple-grape
./grape6 < testparm | tail

# individual timestep example
cd $GRAPE6/pit
./pit -i test128 | tail
Report any errors or unexpected results to the High Performance Systems group, hps-admin@iu.edu.

Links of Interest to GRAPE-6 Users

GRAPE-6 software & document repository : software and documentation.
GRAPE-6 User's Guide: complete documentation for programming the GRAPE-6 hardware.
GRAPE-6 Install Guide : useful test and example programs.