Documentation of 'edu.rit.hyb.antimatter.AntiprotonHyb' Java class
AntiprotonHyb
edu.rit.hyb.antimatter

Class AntiprotonHyb



  • public class AntiprotonHyb
    extends java.lang.Object
    Class AntiprotonHyb is a hybrid SMP cluster parallel program that calculates the positions of the antiprotons as a function of time.

    Usage: java -Dpj.np=Kp -Dpj.nt=Kt edu.rit.hyb.antimatter.AntiprotonHyb seed N R frames steps dt W file

    The program runs in Kp parallel processes. Within each process, the program runs in Kt parallel threads. The program:

    1. Initializes a pseudorandom number generator with seed.
    2. Generates N antiprotons positioned at random in the square from (0,0) to (R,R).
    3. Sets each antiproton's initial velocity to 0.
    4. Calculates frames visualization frames. For each frame:
      1. Performs steps time steps, calculating the antiprotons' positions after an elapsed time of dt.
      2. Renders a WxW-pixel image of the antiprotons' positions.
      3. Stores the image in a PNG file.
    The image files are named "file_0000.png", "file_0001.png", and so on. The first file depicts the antiprotons' initial positions. Each subsequent file depicts the antiprotons' positions steps time steps after the previous file.

    The computation is performed in parallel in multiple processes. One process computes the visualization. The remaining Kp-1 processes compute the antiproton positions in parallel, with Kt parallel threads in each process. Thus, Kp must be 2 or greater. The program measures the computation's running time.

    Each process holds the entire position array, one slice of the velocity array, and one slice of the force array. At each time step, each process calculates its own slice of the force array using the entire position array. Each process uses its slice of the force array to update its slices of the velocity and position arrays. Then the processes do an all-gather of the position array slices, so every processor has the complete new position array for the next time step.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void main(java.lang.String[] args)
      Main program.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        Main program.
        Throws:
        java.lang.Exception

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.