Skip to Content.
Sympa Menu

charm - Re: [charm] Invoking the Load Balancer on a Workstation

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] Invoking the Load Balancer on a Workstation


Chronological Thread 
  • From: Chris Wailes <chris.wailes AT gmail.com>
  • To: "Galvez Garcia, Juan Jose" <jjgalvez AT illinois.edu>
  • Cc: "charm AT lists.cs.illinois.edu" <charm AT lists.cs.illinois.edu>
  • Subject: Re: [charm] Invoking the Load Balancer on a Workstation
  • Date: Thu, 25 May 2017 16:18:58 -0400

Juan,

Thanks, that made things a lot clearer.

- Chris

On Wed, May 24, 2017 at 12:17 PM, Galvez Garcia, Juan Jose <jjgalvez AT illinois.edu> wrote:

Yes, you can enable load balancing in any Charm++ program. Chapter 7 of the Charm++ manual has detailed information on how to enable load balancing. If you use the more common AtSync mode, here is a summary of things to do:

 

  • When building the executable, make sure to link with the load balancers (e.g. -module CommonLBs). Looks like you are already doing this.
  • In AtSync mode, application periodically synchronizes to perform load balancing. Chare array elements have to set usesAtSync to true in their constructor. Each chare array element has to call AtSync when it is ready to do load balancing (e.g. at the end of some number of iterations). When every element calls AtSync, load balancing is triggered. It is then common to leave objects idle and you have to implement a ResumeFromSync() method that gets called on each element when load balancing has finished. The jacobi3d only calls AtSync if CMK_MESSAGE_LOGGING is defined, which is why you weren’t seeing any load balancing. And kNeighbor test doesn’t call AtSync at all. You can check the manual for more details, or the load balancing examples.
  • Array elements have to be migratable (they must implement a PUP method).
  • To actually do load balancing, the period between AtSync calls has to be >= LBPERIOD, which by default is 0.5 seconds. LBPERIOD can be modified by a command line parameter when launching the application (e.g. +LBPeriod 5.0 would say that you only want to balance load every 5 seconds even if the frequency of AtSync calls is higher).

 

-Juan

 

From: Chris Wailes
Sent: Tuesday, May 23, 2017 3:57 PM
To: Galvez Garcia, Juan Jose


Cc: charm
Subject: Re: [charm] Invoking the Load Balancer on a Workstation

 

Juan,

Thanks for your response.  I tried the stencil3d and examples version of kNeighbors today and they worked great.

I had modified the Makefiles for the jacobi3d and test version of kNeighbors to compile the programs with load balancers, thinking that this would allow me to enable them when running the applications.  It appears, however, that the applications need to do something to enable them to be load balanced.  Could you point me to some resources to read about what this might be?  I had thought all Charm++ programs could be load balanced.

- Chris

On Mon, May 22, 2017 at 5:08 PM, Galvez Garcia, Juan Jose <jjgalvez AT illinois.edu> wrote:

Hi Chris,

 

Those tests are not intended to be used for load balancing (looks like the Makefile doesn’t link any load balancers).

 

Instead, I would suggest trying the load balancing examples in examples/charm++/load_balancing (stencil3d and kNeighbor).

 

-Juan

 

From: Chris Wailes
Sent: Monday, May 22, 2017 3:12 PM
To: Miller, Philip B
Cc: charm
Subject: Re: [charm] Invoking the Load Balancer on a Workstation

 

Thanks for your help.  I tried running each of the three programs I'm testing (lb_test, kNeighbor, and jacobi3d) with `+p8` (in the multicore build), and that did cause the lb_test program to print out load balancing data, but kNeighbors segfaulted during LB step 1 and jacobi3d failed to print any load balancing info.  This is all using the 6.7.1 tag from the main Git repository.

Is jacobi3d able to be load balanced?  Do I need to give it other options?  Are there other applications in the test directory that would be better for evaluating load balancing techniques?

- Chris

P.S. I can provide output for the program executions if that would be helpful.

On Thu, May 18, 2017 at 6:01 PM, Phil Miller <mille121 AT illinois.edu> wrote:
You'll need to add a flag "+p N", where N is the number of actual worker threads the runtime should use - by default, when run as a standalone command from the shell, it will occupy only one.

On the multicore build, this will work directly. On the other builds, you'll need to use our multi-process launcher, charmrun, or pass an additional '+ppn M' flag to indicate a number of threads to run in each process.

See the relevant manual section for details:

On Thu, May 18, 2017 at 4:54 PM, Chris Wailes <chris.wailes AT gmail.com> wrote:
First, I'd like to thank everyone for their hard work on the Charm++ project.  My life would be a lot more complicated right now without all of your efforts.

Now, to get to the issue I'm having:

I'm attempting to work with Charm++'s load balancing infrastructure.  Right now, I'd like to develop things on my workstation, which has a single quad-core, hyperthreaded CPU in it.

I've compiled Charm++ with the following versions:
  • multicore-linux64
  • net-linux-x86_64-smp
  • net-linux-x86_64
  • netlrts-linux-x86_64-smp
  • netlrts-linux-x86_64

I've tried running lb_test, jacobi3d, and kNeighbor with each of these versions using the following commands:

  • ./lb_test.every +isomalloc_sync +balancer GreedyLB +LBDebug 9 +LBPrintSummary 1024 100 10 10 100 100 mesh2d
  • ./jacobi3d +isomalloc_sync +balancer GreedyLB +LBDebug 9 +LBPrintSummary 128 32
  • ./kNeighbor +isomalloc_sync +balancer GreedyLB +LBDebug 9 +LBPrintSummary 128 16 32

So far none of these combinations have resulted in any load balancer summaries or debugging prints besides the following (this output was from the netlrts-linux-x86_64 version):

CharmLB> Verbose level 9, load balancing period: 0.5 seconds
CharmLB> Topology torus_nd_5 alpha: 3.500000e-05s beta: 8.500000e-09s.
CharmLB> Load balancer print summary of load balancing result.
CharmLB> Load balancer assumes all CPUs are same.
Charm++> Running on 1 unique compute nodes (8-way SMP).
Charm++> cpu topology info is gathered in 0.011 seconds.
[0] GreedyLB created

It seems like the line `Running on 1 unique compute nodes (8-way SMP).` might indicate that the load balancer isn't running because there is only 1 "node" or processing element.  I tried and failed to find any way to force the creation of 8 processing elements for my 8 logical cores.

Cold anyone tell me what I need to do to get the load balancer firing when I run these applications on my workstation?

- Chris







Archive powered by MHonArc 2.6.19.

Top of Page