Class HotSpotClu

  extended by edu.rit.clu.heat.HotSpotClu

public class HotSpotClu
extends Object

Class HotSpotClu is a cluster parallel program that calculates the temperature distribution over a metal plate with hot spots.

Usage: java edu.rit.clu.heat.HotSpotClu imagefile H W rl1 cl1 ru1 cu1 temp1 [ rl2 cl2 ru2 cu2 temp2 . . . ]
K = Number of parallel processes
imagefile = Output image file name
H = Mesh height in pixels (H >= 1)
W = Mesh width in pixels (W >= 1)
rl1 = First hot spot lower row (1 <= rl1 <= W)
cl1 = First hot spot lower column (1 <= cl1 <= W)
ru1 = First hot spot upper row (1 <= ru1 <= W)
cu1 = First hot spot upper column (1 <= cu1 <= W)
temp1 = First hot spot temperature (0.0 <= temp1 <= 100.0)

The program sets up a mesh of equally-spaced points with H+2 rows and W+2 columns. The temperature of each boundary point [r,c], where r = 0, r = H+1, c = 0, or c = W+1, is fixed at 0.0. The temperatures at certain interior points, known as "hot spots," are fixed at certain values greater than 0.0. Specifically, the temperature of each point in the rectangle from [rl1,cl1] to [ru1,cu1] inclusive is fixed at temp1, the temperature of each point in the rectangle from [rl2,cl2] to [ru2,cu2] inclusive is fixed at temp2, and so on. The program calculates the temperature at every interior point (other than the hot spots) using successive overrelaxation with Chebyshev acceleration and red-black updating. The program outputs a PJG color image H+2 pixels high and W+2 pixels wide. Each pixel's hue depends on the corresponding mesh point's temperature. A temperature of 0.0 is blue; a temperature of 100.0 is red; intermediate temperatures are intermediate hues. Each process writes its own PJG image file with a slice of the image. If imagefile is specified as "out.pjg", for example, then process 0 writes file "out_0.pjg", process 1 writes file "out_1.pjg", and so on.

The computation is performed in parallel in multiple processors. The program measures the computation's running time.

Method Summary
static void main(String[] args)
          Main program.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public static void main(String[] args)
                 throws Exception
Main program.


Copyright © 2005-2012 by Alan Kaminsky. All rights reserved. Send comments to ark­@­