Implement Block Multiply Matrix Mpi4/22/2021
Common parallel methods include matrix decomposition by row and column decomposition and block decomposition, although decomposition by row and column Simple, but its scalability is poor, n times the square matrix of n, the communication volume is O(N), at this time, the communication volume is only O(sqrt(N)) according to the block decomposition method, and the Cannon algorithm is based on this.The combination of the right picture is to make the next subscript of the A block and the previous subscript of the B block equal, which is beneficial to multiplication.In each calculation, each single core calculates the matrix multiplication in a small block.
After the calculation is completed, all A blocks are moved to the left by one block, from the leftmost to the rightmost, and all B blocks are moved up by one block to ensure the subscript There is still a correspondence, and the product is being multiplied by the original result. The openmp used in this article is also used for acceleration. After testing, the 4-core calculation of the 10001000 matrix has about 3 times the acceleration effect than the naive calculation. I recommend a short book blog: This blog is to refer to the algorithm ide. For the A and B matrices, first divide them into small matr. After I searched for information on the Internet, I found that some places could not be realized. So I used the online example and stepped on various kinds of thunder. The idea of MPI parallel computing MPI parallel computing is an idea of multi-process implementation by specifying the allocation process by the user. MPI (Message-Passing-Interface messaging interface) implementation parallelism is process-level, communicating between processes through communication. MPI is not a new development language, it is a library of functions that can be called by C, C and Fortran programs. These function libraries mainly involve functions that communicate between two processes. MPI can have corresponding libraries in both Windows and Linux environments. Implement Block Multiply Matrix Mpi Windows 10 As AThis article uses Windows 10 as a demonstration development environment. Here, in order to debug the code conveniently, It is best to set the environment variable: in the user variable PATH, add: C:Program FilesMicrosoft HPC Pack 2008 R2Bin.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |