Skip to content

Using matrix multiplication for learning the concepts of parallel systems

Notifications You must be signed in to change notification settings

eelfire/matrix-multiplication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Matrix Multiplication

For learning concepts of Parallel Systems

Dependencies

Run

cd rust/
cargo run --release # --release for optimized build

Optimization Decisions

  • Use rayon for parallelization

    • As I am using rust, I decided to use rayon for parallelization. It is a library that provides parallel iterators and parallel operations on collections. It automatically parallelizes operations and tries to allocate all available cores to the given task.
    • I used the par_iter method of rayon to parallelize the operations on the matrix. This removed the need of manual threads management and also manual matrix partition for each thread (link).
  • Use SIMD for vectorization

    • I used the simd from the experimental features of rust standard library.
    • I converted the data of matrix to a simd vector before performing the required operations on it.

Note: Current implementation uses matrix with normal types and converts to SIMD vector before performing operations. This can be improved by using SIMD types for the matrix itself. This will remove the need of converting the matrix to SIMD vector before performing operations.

Note: my github link of this assignment