Skip to content

Commit a1fbd9d

Browse files
author
alielabridi
committed
adding readme
1 parent bc6b796 commit a1fbd9d

File tree

10 files changed

+80
-0
lines changed

10 files changed

+80
-0
lines changed

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Parallel Programming of Strassen Algorithm for Matrix Multiplication using Charm++
2+
3+
EGR 4303 – Applied Research – Fall 2016 - Al Akhawayn University
4+
5+
Student: Ali ELABRIDI – [a.elabridi@aui.ma](mailto:a.elabridi@aui.ma) - alielabridi@gmail.com
6+
7+
Supervisor: Dr. Naeem Nisar Sheikh
8+
9+
**_Procedure/ Methodology Installation/Environment_**
10+
11+
The parallelization of Strassen algorithm and its performance analysis needs high performance computing power. I used the Knuth machine of Harvey Mudd College (64 cores, 500GB of RAM).
12+
13+
Running and Testing
14+
15+
To Run the program execute the following command
16+
17+
➢ ./charmrun ./strassen (size) (threshold) (verbosity) +p(# of procs)
18+
19+
The output line:
20+
21+
Charm++ - Correct: matrix size = 1024, Threshold = 32,# of proc = 2 , Exec time = 11.5419
22+
23+
**_Design Structure of Strassen Algorithm using Charm++_**
24+
25+
• Strassen Chare fires the StrassenSub to compute the 7 M partitions
26+
27+
• StrassenSub Chare fires Additition Chare and Substraction Chare in each partition in parrallel
28+
29+
• StrassenSub fires a smaller in size Strassen Chare to perform Multiplication on the result of Addition/Substraction
30+
31+
![image alt text](readme_images/image_0.png)
32+
33+
**_Implementation_**
34+
35+
**Main Class **https://github.com/alielabridi/Strassen-Algorithm-parallelization-charm- /blob/master/strassen.C
36+
37+
1. Generates a matrix of 1’s and an identitiy matrix 2. Provides Strassen future with the two matrices 3. Records the waiting time for the Strassen future Matrix computation 4. Test the resulting matrix return (check if it is a matrix of 1’s)
38+
39+
**• Strassen Chare Class**
40+
41+
https://github.com/alielabridi/Strassen-Algorithm-parallelization-charm- /blob/master/strassen.C
42+
43+
**1. **Check if size below a certain threshold to run it naively otherwise using Strassen
44+
45+
![image alt text](readme_images/image_1.png)
46+
47+
**2.** If not naively, Partition the two A and B matrices into 4 partitions each
48+
49+
(A11,A12,...B11,...B22)
50+
51+
![image alt text](readme_images/image_2.png)
52+
53+
**3. **Fires the 7 sub-matrices with strassenSub future
54+
55+
![image alt text](readme_images/image_3.png)
56+
57+
**4.** Wait for the different futures of the 7 sub matrices
58+
59+
![image alt text](readme_images/image_4.png)
60+
61+
**5.** Use the 7 sub matrices (n/2) to form the size (n) matrix
62+
63+
![image alt text](readme_images/image_5.png)
64+
65+
**6.** Send the result back to the future using a message of size n
66+
67+
**StrassenSub Chare Class** https://github.com/alielabridi/Strassen-Algorithm-parallelization-charm- /blob/master/StrassenSub.h
68+
69+
Depending on which of the 7 sub matrices, it will run the appropriate formula by calling addition or subtraction chares, and wrap the result in a message and send it back to the future
70+
71+
![image alt text](readme_images/image_6.png)
72+
73+
**Addition/Subtraction Chare class **https://github.com/alielabridi/Strassen-Algorithm-parallelization-charm- /blob/master/AddSubMat.h Perform the addition or subtraction of two matrices, and wrap the result in a message of size n and send it back to the future
74+
75+
![image alt text](readme_images/image_7.png)
76+
77+
**Message Class** https://github.com/alielabridi/Strassen-Algorithm-parallelization-charm- /blob/master/ValueMsg.h The message is dynamically allocated at run time. It also contains the definition of the static methods: packing & unpacking. The purpose of packing and unpacking is to be able to move the message across multiple processors by marshalling it and reconstructing it in another memory space.
78+
79+
![image alt text](readme_images/image_8.png)
80+

readme_images/image_0.png

42.3 KB
Loading

readme_images/image_1.png

46.1 KB
Loading

readme_images/image_2.png

101 KB
Loading

readme_images/image_3.png

173 KB
Loading

readme_images/image_4.png

86.7 KB
Loading

readme_images/image_5.png

112 KB
Loading

readme_images/image_6.png

95.7 KB
Loading

readme_images/image_7.png

111 KB
Loading

readme_images/image_8.png

220 KB
Loading

0 commit comments

Comments
 (0)