Class AntiprotonHyb
- java.lang.Object
-
- edu.rit.hyb.antimatter.AntiprotonHyb
-
public class AntiprotonHyb extends java.lang.ObjectClass 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:
- Initializes a pseudorandom number generator with seed.
- Generates N antiprotons positioned at random in the square from (0,0) to (R,R).
- Sets each antiproton's initial velocity to 0.
-
Calculates frames visualization frames. For each frame:
- Performs steps time steps, calculating the antiprotons' positions after an elapsed time of dt.
- Renders a WxW-pixel image of the antiprotons' positions.
- Stores the image in a PNG 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 voidmain(java.lang.String[] args)Main program.
-
DMelt 3.0 © DataMelt by jWork.ORG