This is a small parallel programming experience for testing what the author has learned in the parallel program designing.
There are mainly three topics which includes the calculation of pi、the test of SPECOMP2012 and the calculation of matrix.
we try to get the specific value as accurate as possible. Besides, it's also our goal to speed up the program with specific machine includeing AVX-float、AVX-double、SSE-float、SSE-double、serial and openmp versions. Set the compling argvs as follows:
gcc -mavx2 -msse2 -fopenmp -O3 pi.c -o result
Get the normal experience according to the results:
AVX-float>AVX-double≈SSE-float>SSE-double>serial
Details can be reached at topic-pi.docx
As to the second, just test the SPECOMP2012 with different threads or setting the environment at dynamic ,static or guided. Details can be reached at topic-SPECOMP2012.docx
The last, may be the most familiar to us.The versions includes tranpose、blocked、openmp+tranpose and MPI. Details can be reached at topic-matrix.docx
gcc -mavx2 -msse2 -O3 -fopenmp matrix.c -o test
Assuming the matrix
Time: ms | 1 | 2 | 3 | 4 | average |
---|---|---|---|---|---|
origin | 6602757.0 | 6284082.0 | 6060442.0 | 6298664.0 | 6311486.3 |
tranpose | 914533.0 | 873473.0 | 931000.0 | 1010096.0 | 932275.5 |
blocked | 6349623.0 | 5452277.0 | 6361220.0 | 6153948.0 | 6079267.0 |
openmp+tranpose | 724606.5 | 796924.2 | 995741.2 | 809043.0 | 831578.7 |
If anything wrong you find, welcome to correct me.