OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
VnodeMultiBalancer.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPPL Framework
5  *
6  *
7  * Visit http://people.web.psi.ch/adelmann/ for more details
8  *
9  ***************************************************************************/
10 
11 #ifndef VNODE_MULTI_BALANCER_H
12 #define VNODE_MULTI_BALANCER_H
13 
14 //-----------------------------------------------------------------------------
15 // Description:
16 // Vnode-granularity load balancer, based on input container of bool weight
17 // BareFields
18 //-----------------------------------------------------------------------------
19 
20 // include files
21 #include <vector>
22 
23 // Forward declarations:
24 template<unsigned Dim> class FieldLayout;
25 template<class T, unsigned Dim> class BareField;
26 
27 //-----------------------------------------------------------------------------
28 // Full Description:
29 
30 // A fairly simple load balancer inspired by Dan Quinlan's MLB, which balances
31 // at the level of granularity of the vnode, rather than the individual Field
32 // element (BinaryBalancer does the latter).
33 
34 // It requires a FieldLayout expressed as a product of vnodes along each
35 // direction, meaning a power-of-two vnode count or else use of the special
36 // [Centered]FieldLayout constructors specifying vnodes per direction.
37 
38 // Internally, it constructs a Field<...,double,....> having one element for
39 // each vnode along each direction in the input FieldLayout, called vf. It
40 // assigns a weight of 1.0 to each element equal to the total number of unique
41 // Field's having any true elements in each vnode for all the Field's in the
42 // input container (STL vector) of boolean weight Fields. If any vnode is
43 // compressed to false, the corresponding vf element value is left unchanged;
44 // if a vnode is uncompressed, this means that there is at least one true
45 // element in it, and the vf element value is incremented by one; if a vnode is
46 // compressed to true, this means all elements are true and the vf element is
47 // also incremented by 1. Then, it invokes BinaryBalancer on this small Field
48 // of weights, vf, to partition it elementwise among the processors, one
49 // element per PE. Finally, it maps this back to the input FieldLayout (used by
50 // the input Fields of weights), and repartitions the input FieldLayout's
51 // vnodes in a corresponding way among the PE's.
52 
53 // There is one function defined here:
54 
55 // Calculate and apply a local domain for a binary repartition.
56 template<unsigned Dim>
58  std::vector<BareField<bool,Dim>* >& weights);
59 
61 
62 #endif // VNODE_MULTI_BALANCER_H
63 
64 /***************************************************************************
65  * $RCSfile: VnodeMultiBalancer.h,v $ $Author: adelmann $
66  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:27 $
67  * IPPL_VERSION_ID: $Id: VnodeMultiBalancer.h,v 1.1.1.1 2003/01/23 07:40:27 adelmann Exp $
68  ***************************************************************************/
69 
void VnodeMultiRepartition(FieldLayout< Dim > &layout, std::vector< BareField< bool, Dim > * > &weights)
Definition: FFT.h:30