Acceleration of a MonteCarlo Simulation by parallelisation - PowerPoint PPT Presentation

1 / 25
About This Presentation
Title:

Acceleration of a MonteCarlo Simulation by parallelisation

Description:

Objective: To simulate the scattering of Gamma rays on a certain type of detector I=I(x) ... SLAVE1. SLAVEn. SLAVE2. MAIN. SLAVE. MAIN. SLAVE. MAIN. SLAVE ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 26
Provided by: herm155
Category:

less

Transcript and Presenter's Notes

Title: Acceleration of a MonteCarlo Simulation by parallelisation


1
Acceleration of a Monte-Carlo Simulation by
parallelisation
  • LPDS SZTAKI HU
  • NUCLEAR LAB OF TU BUDAPEST

2
THE ORIGINAL PROGRAM
  • Objective To simulate the scattering of Gamma
    rays on a certain type of detector II(x)
  • Method Calculate the interactions ( Compton,
    photoelectric and pair production effects) along
    the traversal of a big number of randomly
    generated rays.
  • Implementation In FORTRAN

3
ReStructuring of the original program
  • Initialisation Read the physical
    parameters Read the number of rays to be
    simulated Clear the array representing
    the distribution integer
    distribution(1024)
  • Loop over the next free process
    Clear the local array of distribution
    Loop over the local number of rays
    Calculate a random ray. Investigate
    the interactions. If the result X is
    in the defined normalised range,
    book the hit in the sampled range of
    the target i 1024 X
    localdistribution(i) localdistribution(i)
    1 Add localdistribution to distribution
  • Print the results do i 1, 1024
    write() i, distribution(i)

4
Restructuring of the original program
  • Initialisation Read the physical
    parameters Read the number of rays to be
    simulated Clear the array representing
    the distribution integer
    distribution(1024)
  • Loop over the next free process
    Clear the local array of distribution
    Loop over the local number of rays
    Calculate a random ray. Investigate
    the interactions. If the result X is
    in the defined normalised range
    book the hit in the sampled range of
    the target i 1024 X
    localdistribution(i) localdistribution(i)
    1 Add localdistribution to distribution
  • Print the results do i 1, 1024
    write() i, distribution(i)

MAIN
SLAVE
MAIN
5
MAIN
  • Read Initialise
  • Produce seeds for random generators
  • Start Slave processes
  • Gather results

SLAVEn
SLAVE1
SLAVE2
  • Report ready to run
  • Read data from Main
  • Execute the loop of calculation
  • Submit partial results
  • Report ready to run
  • Read data from Main
  • Execute the loop of calculation
  • Submit partial results
  • Report ready to run
  • Read data from Main
  • Execute the loop of calculation
  • Submit partial results

6
(No Transcript)
7
MAIN
8
SLAVE
9
(No Transcript)
10
(No Transcript)
11
Slave executes the job, and returns its value
12
Slave reports its existence, but there is no new
job to do Main terminates Slavei and waits for
the termination of other active Slaves
13
Monitor Full( 100 000 000 rays, 11 processors)
14
MONITOR START
15
MONITOR MIDDLE
16
MONITOR END
17
Monitor Full( 100 000 000 rays, 11 processors)
18
Monitor Full( 100 000 000 rays, 21 processors)
19
Monitor Full( 100 000 000 rays, 41 processors)
20
Monitor Full(1000 000 000 rays, 41 processors)
21
Monitor Full( 1000 000 000 rays, 81 processors)
22
Scalability Timesec/Processes

23
Speed
24
Histogramm of the result
0
1023
Distribution of hits after 2000 million rounds
25
RESUMEE
  • 1300 line of original FORTRAN code
  • Parallelisation effort 2 work days
  • Fairly good, almost linear scalability
Write a Comment
User Comments (0)
About PowerShow.com