3.3 Random Walk
3.3.2 Two-Step Random Walk (TSRW) Method
One of the major drawbacks of random walk algorithm is that the degree of time com- plexity is limited by the average walk length of the random walk [82]. With the increase in the walk length and size of power distribution network, the degree of time complexity in- creases linearly. The objective of Two-Step Random Walk (TSRW) method is to reduce the walk length up to a certain limit by analyzing power distribution network in two steps. To begin the process, entire power distribution network is divided into small horizontal blocks of equal size called subcircuits as shown in Figure 3.3(a). In the first step, boundary nodes of all the subcircuits are solved by random walk method and these boundary nodes are marked as new homes. Later in the second step, the nodes inside the subcircuits are solved by the same random walk method. In this way, walk length is reduced in a significant manner, which in turn speeds up the solution process. In the second step, the random walks are confined within each subcircuit and each walk is terminated as soon as home nodes are reached. This reduces average walk length in each subcircuit. The details of the proposed algorithm is explained in the form of a flowchart in Figure 3.3(b) and the pseudocode is described in Algorithm 4 (refer section 3.3.2.2).
3.3.2.1 Scalability Analysis
Scalability of a parallel system is a measure of its capacity to increase the speed up pro- portional to the number of processors [107]. To examine the capability of an algorithm for utilizing an increasing number of processing resources effectively on a parallel architecture, several metrics are used, such as isoefficiency analysis [108]. Isoefficiency function of a par-
3.3 Random Walk
. . . .
subcircuit 1
subcircuit 3
subcircuit M subcircuit 2
. . . .
N x N Powergrid Network Structure in Block format
subcircuit 1
(N/M x N nodes)
(a)
update new homes
check for error
stop solve boundary nodes
solve each subcircuit
convergence ? convergence ? powergrid network
(N x N)
horizontal geometric partitioning
yes no
no
yes First StepSecond Step
subcircuits (M x 1)
(b)
Figure 3.3:(a) Horizontal geometric partitioning, (b) flowchart of TSRW method.
allel algorithm correlates a problem size to a number of processing resources to sustain a fixed efficiency. Efficiency of a parallel system is a performance measure of scalability. If a paral- lel system havingnnumber of processors is used to solve a problem instance of fixed sizeH with a total computational overhead ofT0(H, n), then the efficiencyEcan be represented by (3.14),
E = H
H+T0(H, n) (3.14)
We have evaluated TSRW method for different number of threads to examine the scalability of this method. The result of this experiment is shown in Figure 3.4. In TSRW approach, an entire power distribution network of size N ×N is decomposed into rectangularM ×1 subcircuits1, each havingMN ×N nodes. The proposed TSRW approach requires each task to have at least one subcircuit. Therefore, maximum 32 processing elements (hardware threads) can be used productively when n=32 or 64 processing elements (hardware threads) when n=64 to maintain an efficiency (E) of 50%. As there are 32 logical cores available in Intel Xeon processor, it is observed that performance of TSRW method is optimum in terms of percentage error for 32 threads on this processor while analyzing different power distribution networks2.
2 4 8 16 32 64 128
Number of threads 0
1 2 3 4 5 6 7
Percentage error
pgnw1M pgnw4M pgnw9M pgnw16M pgnw25M
Figure 3.4:Scalability Analysis of proposed TSRW method for different power distribution networks (i.e. pgnw1M (1 million), pgnw4M (4 million), pgnw9M (9 million), pgnw16M (16 million) and pgnw25M (25 million)). Variation of percentage error with the increase in number of threads.
1 Here each power distribution network is decomposed into 10×1 subcircuits during implementation of TSRW method.
2Details on power distribution network benchmarks are provided in Appendix A.
3.3 Random Walk
3.3.2.2 Implementation Details
The implementation of parallel TSRW algorithm for steady state analysis of power distri- bution network is described below along with the pseudocode of TSRW, which is exhibited in Algorithm 4.
(i) Reading input file: At first, the circuit is read from the input file provided in SPICE netlist file format. After that all other necessary informations for every node such as neighbors, path conductances, current source values and types of the nodes are extracted SPICE netlist.
(ii) Initial setup:The probability is evaluated for every adjacent nodes connected with each node in the power distribution network along with the rewards or pay off values using (3.10) and (3.11). If the node is aVDDPAD, then it is treated as a home and the potential at each node in the path is treated as the average value of the reward.
Algorithm 4: Two-Step Random Walk (TSRW) Input :A power grid network of sizeN ×N. Output:Node potential at each nodei∈PN×N.
Data:i∈Bn, such thatBn⊆SandBn∪In=S, whereS is a set of all subcircuits of power grid networkPN×N.Bnis set of boundary nodes andInis set of inner nodes of each subcircuitnrespectively.
1: VboundaryN ode←−0 2: VinnerN ode←−0 3: #pragma omp parallel 4: fori∈Bndo
5: RANDOMWALK(i) ▷solving boundary nodes 6: findVboundaryN odei
7: end for
8: #pragma omp parallel 9: fork∈Indo
10: RANDOMWALK(k) ▷solving inner nodes 11: findVinnerN odek
12: end for
(iii) Starting the walk: After setting the initial requirements, random walk is started from any node chosen at random. As the walks are independent, it can be started simultane- ously from many nodes in parallel. Once the walk gets completed for a node, the node
Algorithm 5:RANDOMWALK(x)
1: #pragma omp parallel 2: forw←1, no of walksdo 3: total reward←0
4: whilenode type̸=homedo 5: pick a rand num
6: for k←1, Nneighbordo
7: ifrand num < probabilitythen
8: break ▷probability is evaluated using (3.10)
9: end if
10: find node id ofkthnode 11: update neighbor
12: update total reward 13: end for
14: update node potential 15: end while
16: node potential←node potential walks 17: node type←home
18: reward←node potential 19: end for
20: ifstopping criteria metthen 21: break
22: end if
is assigned to be a new home and the reward value becomes equal to the potential of the node calculated by the random walk. As the number of completed walks grows, the number of home nodes increases in the network and the computational time required to complete the walk for subsequent nodes reduces significantly.
(iv) Stopping criteria: If Vx is the walk gain from nodex andW is the number of walks from nodex, the estimate of varianceVxcan be represented as,
σx2 = 1 W −1
∑W w=1
(Vxw−vx′)2 (3.15)
The error is estimated for each solutionvx, wherexis the starting node of walk. This error should be smaller than a given threshold△.
− △< vx−v′x<△ (3.16)
′