gt: 		n.posy = py * m;
context: /*
  Galois, a framework to exploit amorphous data-parallelism in irregular
  programs.
  
  Copyright (C) 2010, The University of Texas at Austin. All rights reserved.
  UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING THIS SOFTWARE
  AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR ANY
  PARTICULAR PURPOSE, NON-INFRINGEMENT AND WARRANTIES OF PERFORMANCE, AND ANY
  WARRANTY THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE.
  NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF THE
  SOFTWARE OR DOCUMENTATION. Under no circumstances shall University be liable
  for incidental, special, indirect, direct or consequential damages or loss of
  profits, interruption of business, or related expenses which may arise from use
  of Software or Documentation, including but not limited to those resulting from
  defects in Software and/or Documentation, or loss or inaccuracy of data of any
  kind.
  
  File: Main.java 
  
   */
  
  package barneshut.main;
  
  import galois.objects.MethodFlag;
  import galois.objects.graph.ArrayIndexedTree;
  import galois.objects.graph.GNode;
  import galois.objects.graph.IndexedGraph;
  import galois.runtime.ForeachContext;
  import galois.runtime.wl.ChunkedFIFO;
  import galois.runtime.wl.FIFO;
  import galois.runtime.wl.Priority;
  import galois_scj.GaloisSCJComputation;
  import galois_scj.GaloisSCJProcess;
  import galois_scj.ReducedGaloisRuntime;
  import galois_scj.UnorderedGaloisSCJComputation;
  
  import java.io.BufferedReader;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.FileReader;
  import java.io.IOException;
  import java.text.DecimalFormat;
  import java.util.Arrays;
  import java.util.Locale;
  import java.util.Scanner;
  import java.util.zip.GZIPInputStream;
  
  import scj.Task;
  import util.Launcher;
  
  /**
   * Main class of the Barnes Hut application.
   */
  public final class SCJMain {
  	private static int nbodies; // number of bodies in system
  	private static int ntimesteps; // number of time steps to run
  	private static double dtime; // length of one time step
  	private static double eps; // potential softening parameter
  	private static double tol; // tolerance for stopping recursion, should be less than 0.57 for 3D case to bound error
  
  	private static double dthf, epssq, itolsq;
  	private static OctTreeLeafNodeData body[]; // the n bodies
  	private static GNode<OctTreeNodeData> leaf[];
  	private static double diameter, centerx, centery, centerz;
  	private static int curr;
  
  	/*
  	 * Reads the input from a gzipped or clear text file.
  	 */
  	@SuppressWarnings("unchecked")
  	private static void ReadInput(String filename, boolean print) {
  		double vx, vy, vz;
  		Scanner in = null;
  		try {
  			if (filename.endsWith(".gz")) {
  				in = new Scanner(new GZIPInputStream(new FileInputStream(filename)));
  			} else {
  				in = new Scanner(new BufferedReader(new FileReader(filename)));
  			}
  			in.useLocale(Locale.US);
  		} catch (FileNotFoundException e) {
  			System.err.println(e);
  			System.exit(-1);
  		} catch (IOException e) {
  			System.err.println(e);
  			System.exit(-1);
  		}
  		nbodies = in.nextInt();
  		ntimesteps = in.nextInt();
  		dtime = in.nextDouble();
  		eps = in.nextDouble();
  		tol = in.nextDouble();
  		dthf = 0.5 * dtime;
  		epssq = eps * eps;
  		itolsq = 1.0 / (tol * tol);
  		if (print) {
  			System.err.println("configuration: " + nbodies + " bodies, " + ntimesteps + " time steps");
  			System.err.println();
  		}
  		body = new OctTreeLeafNodeData[nbodies];
  		leaf = new GNode[nbodies];
  		for (int i = 0; i < nbodies; i++) {
  			body[i] = new OctTreeLeafNodeData();
  		}
  		for (int i = 0; i < nbodies; i++) {
  			body[i].mass = in.nextDouble();
  			body[i].posx = in.nextDouble();
  			body[i].posy = in.nextDouble();
  			body[i].posz = in.nextDouble();
  			vx = in.nextDouble();
  			vy = in.nextDouble();
  			vz = in.nextDouble();
  			body[i].setVelocity(vx, vy, vz);
  		}
  	}
  
  	/*
  	 * Computes a bounding box around all the bodies.
  	 */
  	private static void ComputeCenterAndDiameter() {
  		double minx, miny, minz;
  		double maxx, maxy, maxz;
  		double posx, posy, posz;
  		minx = miny = minz = Double.MAX_VALUE;
  		maxx = maxy = maxz = Double.MIN_VALUE;
  		for (int i = 0; i < nbodies; i++) {
  			posx = body[i].posx;
  			posy = body[i].posy;
  			posz = body[i].posz;
  			if (minx > posx) {
  				minx = posx;
  			}
  			if (miny > posy) {
  				miny = posy;
  			}
  			if (minz > posz) {
  				minz = posz;
  			}
  			if (maxx < posx) {
  				maxx = posx;
  			}
  			if (maxy < posy) {
  				maxy = posy;
  			}
  			if (maxz < posz) {
  				maxz = posz;
  			}
  		}
  		diameter = maxx - minx;
  		if (diameter < (maxy - miny)) {
  			diameter = (maxy - miny);
  		}
  		if (diameter < (maxz - minz)) {
  			diameter = (maxz - minz);
  		}
  		centerx = (maxx + minx) * 0.5;
  		centery = (maxy + miny) * 0.5;
  		centerz = (maxz + minz) * 0.5;
  	}
  
  	/*
  	 * Recursively inserts a body into the octree.
  	 */
  	private static void Insert(IndexedGraph<OctTreeNodeData> octree, GNode<OctTreeNodeData> root, OctTreeLeafNodeData b,
  			double r) {
  		double x = 0.0, y = 0.0, z = 0.0;
  		OctTreeNodeData n = root.getData();
  		int i = 0;
  		if (n.posx < b.posx) {
  			i = 1;
  			x = r;
  		}
  		if (n.posy < b.posy) {
  			i += 2;
  			y = r;
  		}
  		if (n.posz < b.posz) {
  			i += 4;
  			z = r;
  		}
  		GNode<OctTreeNodeData> child = octree.getNeighbor(root, i);
  		if (child == null) {
  			GNode<OctTreeNodeData> newnode = octree.createNode(b);
  			octree.add(newnode);
  			octree.setNeighbor(root, newnode, i);
  		} else {
  			double rh = 0.5 * r;
  			OctTreeNodeData ch = child.getData();
  			if (!(ch.isLeaf())) {
  				Insert(octree, child, b, rh);
  			} else {
  				GNode<OctTreeNodeData> newnode = octree.createNode(new OctTreeNodeData(n.posx - rh + x, n.posy - rh + y, n.posz
  						- rh + z));
  				octree.add(newnode);
  				Insert(octree, newnode, b, rh);
  				Insert(octree, newnode, (OctTreeLeafNodeData) ch, rh);
  				octree.setNeighbor(root, newnode, i);
  			}
  		}
  	}
  
  	/*
  	 * Traverses the tree bottom up to compute the total mass and the center of
  	 * mass of all the bodies in the subtree rooted in each internal octree node.
  	 */
  	private static void ComputeCenterOfMass(IndexedGraph<OctTreeNodeData> octree, GNode<OctTreeNodeData> root) {
  		double m, px = 0.0, py = 0.0, pz = 0.0;
  		OctTreeNodeData n = root.getData();
  		int j = 0;
  		n.mass = 0.0;
  		for (int i = 0; i < 8; i++) {
  			GNode<OctTreeNodeData> child = octree.getNeighbor(root, i);
  			if (child != null) {
  				if (i != j) {
  					octree.removeNeighbor(root, i);
  					octree.setNeighbor(root, child, j); // move non-null children to the
  					// front (needed later to make other code faster)
  				}
  				j++;
  				OctTreeNodeData ch = child.getData();
  				if (ch.isLeaf()) {
  					leaf[curr++] = child; // sort bodies in tree order (approximation of
  					// putting nearby nodes together for locality)
  				} else {
  					ComputeCenterOfMass(octree, child);
  				}
  				m = ch.mass;
  				n.mass += m;
  				px += ch.posx * m;
  				py += ch.posy * m;
  				pz += ch.posz * m;
  			}
  		}
  		m = 1.0 / n.mass;
  		n.posx = px * m;
  