Download presentation
Presentation is loading. Please wait.
Published byMaryann Campbell Modified over 9 years ago
1
Simple Load Balancing CS550 Operating Systems
2
Announcements Project will be posted – TBA This project will use the client-server model and will require implementation of load balancing We will review square matrix multiplication as an example of load balancing
3
Parallel decomposition and load balancing Parallel decomposition - how do we divide up work and do work in parallel. Load balancing - how do we distribute this work so that it is best divided between resources (CPUs/nodes for cluster computing) For addition of square matrices A and B, we could divide the work by rows and try to allocate the same number of rows to each thread or process.
4
Example Assume we have two N by N matrices, A and B Assume we have K threads or processes where K < N. We can divide up the work as follows: – Allocate N / K rows to each process or thread and perform addition. – Note that N / K is an integer division.
5
Example Given two 16*16 matrices A and B, divide the work between 4 threads So, each thread should calculate 16 / 4 = 4 rows of addition.
6
What if things don't divide up evenly? Given two 1024 * 1024 matrices, divide the work between 5 threads. Using the previous formula, we would allocate 1024 / 5 = 204 rows to each thread to perform addition. But 204 * 5 = 1020. What about the other 4 rows? Notice that 1024 % 5 gives the remainder. We must allocate the rest of the work to at least one of our existing threads. We could try to balance the work again if necessary.
7
Other Load Balancing Problems Finding pi Numerical Integration Particle Physics Simulations Computational Chemistry Weather Air Traffic Control Sometimes dividing work (load balancing) can be very difficult – see IEEE and ACM journals.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.