Discover a web application that visualizes sequential and parallel matrix multiplication in real-time. With OpenMP C++ code sending updates through WebSockets, you can watch parallel computations unfold and explore how work is shared among multiple threads.
The online demo can be found here. (only working for clients connected through the Eduroam network)
-
Backend:
Implemented in C++.- OpenMP for parallel computations.
- Simple-WebSocket-Server for real-time communication.
- spdlog for logging.
- nlohmann/json for JSON serialization/deserialization.
- Interactive Visualization: Users can observe how tasks are distributed among parallel threads.
- Configurable Input Matrices: Users can input their own matrices of any size from 1 to 50.
- Step-by-Step Execution: Pause and step through the multiplication process to understand the distribution of workload and accumulation of partial results.
- Real-Time Feedback: The frontend receives status updates from the backend server for each multiplication step via WebSockets.
-
General Requirements:
-
Dependencies:
-
Install Prerequisites:
-
Build the Backend:
cd backend mkdir build && cd build cmake .. make
-
Run the Backend:
./MatmulServer
-
Install Node.js Dependencies:
cd frontend npm install -
Run the Frontend Development Server:
npm run dev
The frontend uses WebSockets to communicate with the backend server. In the frontend /.env file, ensure the 'VITE_WEBSOCKET_URL' matches the backend’s configured URL. For example, if the backend runs on ws://localhost:9002/matmul/:
VITE_WEBSOCKET_URL="ws://localhost:9002/matmul/";- Start the Backend Server: Ensure
MatmulServeris running. - Start the Frontend: Access
http://localhost:5173in a web browser. - Start playing around!
Contributions are welcome! Feel free to open issues, submit pull requests, or suggest improvements.
This project is licensed under the MIT License. See the LICENSE file for details.