473,472 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Load Balancing

I need a decent algorithm to divide work amongst my workers (processors)
which I will use with OpenMP:

More precisely, I have a list of tasks (numbered 1,...n) requiring t_i
(i=1,..,n) time units (flops, whatever). I would like to assign each task
to one of my k workers (processors) so that all workers have about the same
amount of work. Ideal would of course be if all workers have work for T/k
time units, T being the sum over the t_i. As I want the total time I have
to wait for all work to be completed to be minimal, the deviation of the
ideal work time for each worker should be "punished" in the max. norm (or
2-norm). I don't need the best solution, but a work load that is balanced
reasonably well - so I am looking for a heuristic and ideally for a C/C++
implementation that is available in the public domain.

I would be grateful for any hint as to where I can find such an algorithm
(either already implemented or described so that I can program it myself).

(Note: I do not want to use the various OpenMP scheduling techniques,
because I will adapt my data structure in advance so that the data will be
accessed sequentially by each processor. Furthemore, t_i varies
significantly (some may even be 0), and this is unknown to the OpenMP
scheduler...)

Thanks in advance.

Jan
Jun 27 '08 #1
6 6067
On Apr 16, 2:11*pm, "J.M." <jm...@gmx.dewrote:
I need a decent algorithm to divide work amongst my workers (processors)
which I will use with OpenMP:

More precisely, I have a list of tasks (numbered 1,...n) requiring t_i
(i=1,..,n) time units (flops, whatever). I would like to assign each task
to one of my k workers (processors) so that all workers have about the same
amount of work. Ideal would of course be if all workers have work for T/k
time units, T being the sum over the t_i. As I want the total time I have
to wait for all work to be completed to be minimal, the deviation of the
ideal work time for each worker should be "punished" in the max. norm (or
2-norm). I don't need the best solution, but a work load that is balanced
reasonably well - so I am looking for a heuristic and ideally for a C/C++
implementation that is available in the public domain.

I would be grateful for any hint as to where I can find such an algorithm
(either already implemented or described so that I can program it myself).

(Note: I do not want to use the various OpenMP scheduling techniques,
because I will adapt my data structure in advance so that the data will be
accessed sequentially by each processor. Furthemore, t_i varies
significantly (some may even be 0), and this is unknown to the OpenMP
scheduler...)
Search for "multi-processor scheduling". The problem is NP-hard, but
it is common enough that there should be descriptions of heuristics
available fairly easily.
Jun 27 '08 #2
J.M. wrote:
so I am looking for a heuristic and ideally for a C/C++
implementation that is available in the public domain.
Nitpicking, but there's no such thing as program source code in the
"public domain" (at least not with the copyright laws of most western
countries).

http://www.linuxjournal.com/article/6225

(Even if someone *claims* his code is PD, that doesn't make it so.
Copyright is not something you can simply make disappear at a whim.)
Jun 27 '08 #3
<Ho*************@googlemail.comwrote in message
news:83**********************************@d1g2000h sg.googlegroups.com...
On Apr 16, 2:11 pm, "J.M." <jm...@gmx.dewrote:
I need a decent algorithm to divide work amongst my workers (processors)
which I will use with OpenMP:
[...]
Search for "multi-processor scheduling". The problem is NP-hard, but
it is common enough that there should be descriptions of heuristics
available fairly easily.
I would suggest searching for work-stealing algorithms. They work very well
for evenly balancing dynamic workloads.

Jun 27 '08 #4
Juha Nieminen wrote:
J.M. wrote:
>so I am looking for a heuristic and ideally for a C/C++
implementation that is available in the public domain.

Nitpicking, but there's no such thing as program source code in the
"public domain" (at least not with the copyright laws of most western
countries).
[snip]

Sure there is. For instance some code produced and published by US
government agencies:

http://www.copyright.gov/title17/92chap1.html#105
Best

Kai-Uwe Bux
Jun 27 '08 #5
<Ho*************@googlemail.comwrote in message
news:83**********************************@d1g2000h sg.googlegroups.com...
On Apr 16, 2:11 pm, "J.M." <jm...@gmx.dewrote:
I need a decent algorithm to divide work amongst my workers (processors)
which I will use with OpenMP:

More precisely, I have a list of tasks (numbered 1,...n) requiring t_i
(i=1,..,n) time units (flops, whatever). I would like to assign each task
to one of my k workers (processors) so that all workers have about the
same
amount of work. Ideal would of course be if all workers have work for T/k
time units, T being the sum over the t_i. As I want the total time I have
to wait for all work to be completed to be minimal, the deviation of the
ideal work time for each worker should be "punished" in the max. norm (or
2-norm). I don't need the best solution, but a work load that is balanced
reasonably well - so I am looking for a heuristic and ideally for a C/C++
implementation that is available in the public domain.

I would be grateful for any hint as to where I can find such an algorithm
(either already implemented or described so that I can program it myself).

(Note: I do not want to use the various OpenMP scheduling techniques,
because I will adapt my data structure in advance so that the data will be
accessed sequentially by each processor. Furthemore, t_i varies
significantly (some may even be 0), and this is unknown to the OpenMP
scheduler...)
[...]

Here is an algorithm that works very well:

http://research.sun.com/scalable/pub...rkstealing.pdf

This will help you.

Jun 27 '08 #6
On 2008-04-18, James Waldby <no@no.nowrote:
The multiprocessor scheduling problem is known to be NP-complete (see
eg http://en.wikipedia.org/wiki/Multiprocessor_scheduling ).
The usual statement of the multiprocessor scheduling problem is that
each job may require multiple processors simultaneously. I am not
sure that the problem remains NP-complete if all jobs require only
1 CPU. I increasingly suspect that it is not.
- Tim
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Max | last post by:
Frankly, i need session variables to persist regardless of load balancing. My hoster says save them in files, yuk. Are there any other thoughts The problem is that the session variables are lost...
2
by: yagish | last post by:
Hi Techies, Am really new with the Oracle 9i Forms and am searching for a way to perform Load Balancing in Oracle 9i Forms Application. Its not a J2EE application, so cannot go the OC4J way. I...
3
by: Shabam | last post by:
When a web application becomes overloaded with traffic, one can offload it by load balancing and clustering the front end web servers. What happens when the back-end MSSQL database becomes...
2
by: Christopher D. Wiederspan | last post by:
I'm wondering if anybody could give me some tips on a good webfarm load-balancing solution for an ASP.NET application. Here's the rundown: we've got 3 identical servers that each have identical...
10
by: GeekBoy | last post by:
Okay, I have two identical web servers running Windows 2003 web server. I have an ASP.NET application which runs great on one of them. Dedicated IP address, behind our firewall, etc. Everyone's...
6
by: Andrew Robinson | last post by:
I am running two servers with a hardware network load balancing device. I know that to share session information between the two servers I need to implement some type of SQL based session...
0
by: HK | last post by:
I'm wanting to get rid of a hardware load balancer and just use the Windows 2003 software load balancing with 2003 Server Web Edition. I'm wondering if anyone here uploads ASP.NET code to 2 or...
2
by: RahulBose | last post by:
I am trying to implement Load Balancing but facing some problems: A Web farm usually consists of 2 or more computers, orchestrated by some form of load balancing. Consider my scenario: 1. I...
3
by: Anthony Smith | last post by:
Can someone point me to a resource or something were I can set this up cleanly. I don't want to re-invest the wheel. I just want the most common way to do this. I know there is a database option...
1
by: m.a | last post by:
Hello, I am looking for a hosting solution for my asp.net application. I found that some ISP stated that session states are not preserved in a load balancing system. As I know, if the asp.net is...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.