Professional Documents
Culture Documents
Taken from “An Atlas of Fullerenes” by P.W. Fowler and D.E. Manolopoulos
A Fullerene Graph
Taken from “An Atlas of Fullerenes” by P.W. Fowler and D.E. Manolopoulos
A Fullerene Graph
Taken from “An Atlas of Fullerenes” by P.W. Fowler and D.E. Manolopoulos
A Fullerene Graph
Taken from “An Atlas of Fullerenes” by P.W. Fowler and D.E. Manolopoulos
The Spiral Algorithm
The Fullerene Isomer Problem
... C32:6
The Spiral Algorithm
65656566656656656566566565656566
Taken from “An Atlas of Fullerenes” by P.W. Fowler and D.E. Manolopoulos
The Spiral Algorithm
n
2 2 spiral combinations.
12
The Spiral Algorithm
• Becomes rapidly 14
13
continue
continue
12 continue
complex as n increases 11
10
continue
continue
beyond 100 9
8
continue
continue
7 continue
6 continue
5 continue
4 continue
3 continue
2 continue
1 continue
FORTRAN Implementation
16
O(n )
NOTE: THIS IS BAD!!!
Sequential Implementation
Sequential Implementation Using C++
OBJECTIVES
• Translate main FORTRAN code to C++
800
700
600
300
200
100
0
30 35 40 45 50 55 60
Number of Vertices
Sequential Implementation Using C++
gprof profile for n = 50
Flat profile: (Each sample counts as 0.01 seconds.)
9000.000
8000.000
7000.000
6000.000
Time 5000.000
C++ time
FORTRAN time
(sec)
4000.000
3000.000
2000.000
1000.000
0.000
32 42 52 62 72 82
# of Vertices
Strategy for Parallelization
Strategy for Parallelization
do 1 j1 = 1, m-11*jpr
do 2 j2 =j1 +jpr, m-10*jpr
do 3 j3 =j2 +jpr, m- 9*jpr MASTER NODE
do 4 j4 =j3 +jpr, m- 8*jpr
do 5 j5 =j4 +jpr, m- 7*jpr
do 6 j6 =j5 +jpr, m- 6*jpr
do 7 j7 =j6 +jpr, m- 5*jpr
do 8 j8 =j7 +jpr, m- 4*jpr
do 9 j9 =j8 +jpr, m- 3*jpr
do 10 j10=j9 +jpr, m- 2*jpr
do 11 j11=j10+jpr, m- 1*jpr
do 12 j12=j11+jpr, m
do 14 j=1,m
.
.
14
.
continue
. WORKER NODES
13 continue
12 continue
11 continue
10 continue
9 continue
8 continue
7 continue
6 continue
5 continue
4 continue
3 continue
2
1
continue
continue
MASTER NODE
Strategy for Parallelization
MASTER
Set j1 to 1 Set count to 0
Set j2 to j1+jpr wait for a message
Set j3 to j2+jpr switch on Message Type
Set j4 to j3+jpr case: Get Data
wait for message send end
switch on message type case: Point Found
case: get data Receive (j1-j12, nmr[], group[])
Send (j1, j2, j3, j4) until count = processes
Increment (j1, j2, j3, j4) organize and output data
case: point found
Receive (j1-j12, nmr[], group[])
until all j1-j4 are sent.
Strategy for Parallelization
WORKER
do
Request Data
for j5 = j4 + jpr
for j6 = j5 + jpr
.
.
for j12 = j11 + jpr
build sequence
pass to math functions
if point found:
send point
until request returns end
Strategy for Parallelization
node 0
MASTER
6000.000
5000.000
Time 4000.000
(sec) Sequential time
Parallel time
3000.000
2000.000
1000.000
0.000
32 42 52 62 72 82
Number of vertices
Results: Benchmark Tests
Sp 3 Speedup
0
1 2 3 4 5 6 7
Number of processes
Results
User(s) Skynet
Run
Scheduler
WEB SERVER
DBMS
User(s)
References
• Questions?