# Parallelization of Array Method with Hybrid Programming: OpenMP and MPI
## 6 Levy Random Walks as a Free Resources Search Strategy  
In this section, Levy random walks are defined as strategy for free resources search. The exponential increase in step length gives the Levy random walks the property of being scale invariant, and are used to model data exhibiting clustering. Levy flights are a special class of random walks whose step lengths are not constant, but are selected from a probability distribution with a power law [16; 17; 19; 20]. The random walk is represented by a succession of random variables \(X_{n}\) with \(n\in N\) known as a discrete stochastic process. The sequence \(X_{n},n\in N\) forms infinite sequences \(X_{0},X_{1},\ldots,X_{i}\) with \(X_{i}\in Z\). That is, if a run starts at state 0, at the next time the agent can move to position \(+1\), with probability \(p\), or to position \(-1\) with probability \(q\), with \(p+q=1\). Position \(+1\) is considered the PE to the left of the current PE and position \(-1\) is considered the PE to the right of the current PE. This research work proposes the case of a software agent which starts from a specific cluster and PE, and moves in stages or steps along the target system; at each step, it moves a unit distance to the right or to the left, with respectively equal probabilities. For the movement of the agent, let \(\zeta_{n}\) be the \(nth\) motion of the agent and \(P\) be the probability function, then,  
1. \(P(\zeta_{n}=+1)=p\), the agent moves one PE to the right of the current position. 2. \(P(\zeta_{n}=-1)=q\), the agent moves one PE to the left of the current position. \(\zeta_{n}\) are considered as the independent random variables. The agent moves \(k\) steps in total, before registering idle resources in the resource matrix (see Section 5). For these experiments, Levy flights are used as a search procedure for idle resources. The steps for the execution of the software agent are explained on next section (a reduced algorithm is provided in Algorithm 1). Search for Idle Resources in HPC System Using Levy Random Walks  
For the resource allocation in HPC systems, most research works (as Section 4 explains) assume a centralized resource manager that has a complete vision of network topology, as well as networking and computing resources status; this assumption is not valid for large-scale worldwide grid networks; practically, grid network comprises geographically distributed heterogeneous resources interconnected by multi-domain networks [29]. In this paper, before performing the scheduling and allocation of resources, a resource search engine is proposed in HPC systems, using Levy random walks to extract the characteristics of each processing element, assuming that ignoring computational resource capacity and availability may affect the overall performance significantly, especially in computationally intensive applications [29]. To generalize the problem, let us consider Figure 1, which has a set of geographically dispersed clusters linked by wireless and wired communication; Figure 1 is the most similar to the actual architecture used in the experimentations. For reasons of space, details about network bandwidth, multi-domain environments, inter-domain and intra-domain topology are not specified, in addition to how the different domains interact to provide end-to-end connectivity. In Figure 1, circles represent processing elements, filled circles show occupied PEs, circles filled with lines represent PEs without functionality, while unfilled PEs are idle at time \(t+1\) and can be located by the software agent. Links between processing elements within a cluster and links between clusters are represented by solid lines. The three dots above the solid lines show the possible addition of new clusters to the target system.