**3.1 Resource discovery**

When any user sends his request to one of the nodes of our resource discovery tree which should be in the form of bitmaps stored in nodes, i.e. in the previous tree structure, the user's query should be in the form of a bitmap with the length of six positions (Fig. 4). The user should allocate number 1 in the pair position (1 1) related to the resource he requires. In Fig. 5, we show the method of resource discovery.


Fig. 4. A sample of query bitmap.

Suppose that a user needs the operating system XP. The user should create a query in the form of a bitmap that has been shown in Fig. 4. All positions of the query bitmap are multiplied with the stored bitmap in the nodes. If the result is 0, the query will be sent to the father node. Otherwise the resulted numbers will be used for resource discovery.

76 Grid Computing – Technology and Applications, Widespread Coverage and New Horizons

Fig. 3. Our proposed tree after gathering the children information.

Fig. 5, we show the method of resource discovery.

When any user sends his request to one of the nodes of our resource discovery tree which should be in the form of bitmaps stored in nodes, i.e. in the previous tree structure, the user's query should be in the form of a bitmap with the length of six positions (Fig. 4). The user should allocate number 1 in the pair position (1 1) related to the resource he requires. In

Suppose that a user needs the operating system XP. The user should create a query in the form of a bitmap that has been shown in Fig. 4. All positions of the query bitmap are multiplied with the stored bitmap in the nodes. If the result is 0, the query will be sent to the

father node. Otherwise the resulted numbers will be used for resource discovery.

**3.1 Resource discovery** 

Fig. 4. A sample of query bitmap.

Suppose in this example, the query is first sent to node H. All positions are multiplied with each other and the result would be 0. So, the request will be sent to its father node i.e. C (as Fig. 5). In node C, all positions of request are multiplied with the stored bitmap in this node and the result again would be 0. So the request will be sent to its father node i.e. A. It is observed that the result of multiplication in the node would be the numbers except 0 (5 5). So, number 5 should be changed into a binary number with length 5 so the result is 00101. Using this binary number, we can directly obtain the node which contains the requested resource; the binary number is taken through left to right and goes forward in the edges of the path. The result node would be the target node. Fig. 5 shows this search which resulted in the resource discovery in node K. As soon as a number except zero is achieved, we can directly refer to the destination node without any referring to an extra and unnecessary node.

Fig. 5. An example of resource discovery in our weighted tree.

#### **3.2 Improvement the method in a real grid environment**

In the current method, the weight of edges in each node is identified and after changing into a decimal number, they are stored in their related places.

The method can be corrected in a real grid environment, because if we suppose a real grid environment with many nodes and edges, the number of 0 and 1s which are to be attached

A New Approach to Resource Discovery in Grid Computing 79

several query bitmaps. It means that a lot of information will not be sent in the form of a unique query. But, we should identify the queries in nodes, i.e. if the query reached, relates

We can add some bits to any query bitmap to identify the resource. For example, if there are 16 types of resources in our grid environment, we can add 4 bits to any query bitmap, in order that the receiver can identify with which resource the bitmap should be compared to.

Here, the time and space complexities for our method will be investigated. We suppose that there are n nodes and r resources in the grid environment. Every resource has a attributes and the length of the bitmap would be b bits (Chang & Hu, 2010). Also assume the

Our method applies to a tree structure. Users send their requests to one of the nodes and the request moves in the tree paths for the proper resource to be found. The consumed time

The computation time would be the time consumed in every node to compare the query bitmap with local bitmaps. So, we can calculate the number of nodes visited in resource

The latter would be the time lost between nodes to send a query. Here we can also calculate the number of links. The number of links and visited nodes in resource discovery would be in the same order in tree paths, so both times are supposed the same. One of these times would be larger depending on the network conditions and type of nodes. Because most nodes in the grid environment are of good computation power, but are located in distant intervals in various networks, in the following we assume the communication time through

In Our method like (Chang & Hu, 2010), the worst case in the resource discovery is the number of visited links from a leaf node upward to the root then downward to another leaf node. Therefore, the time complexity for our method will be O (logn m) in the worst case.

To calculate the space complexity, every node in our tree requires 2 × r × a × b places for the path bitmap (any attribute needs two places in the path bitmap) and r × a × b places for the counter bitmap and (m + 1) links. Like (Chang & Hu, 2010), if supposing that every place and each link needs 32 bits, the total number of bits required is n × (32 × (2 × r × a × b + r × a ×

For updating, an extra bitmap called a ''counter bitmap'' will be used. The number of positions in this bitmap depends on the number of types of resources in the grid

to resource 1 or resource 2 etc. (for example OS, CPU, . . . ).

maximum number of children for a node would be m.

discovery in our tree for computation time.

a link is larger than the computation time in a node.

**3.3 Complexity analysis** 

**3.3.1 Time complexity** 

**3.3.2 Space complexity** 

b + (m + 1))) = O(nrab + nm).

**3.4 Update method** 

This enables us to manage several resources in the grid environment.

includes the required time for computations and communications.

to each other will be large and in storing or converting them into their equivalent decimal, a very large number will result (maybe incomputable).

The solution would be that for storing 0 and 1s, we suppose a threshold number. When a node takes information from its children nodes, including the bitmap, the node first takes the contents of this bitmap then converts the contents of the path position to its equivalent binary number (in the length of counter) and attaches the weight of edge. If the resulted binary number is larger than threshold, this node instead of storing this large number, supposes that the node which this a large number comes from there, is a target node, namely this resource exists in this node, and so stores just the related weight of the edge in the counter, and in fact, the counter in the bitmap starts again. Then this information is sent to the father node and the above operation again will be performed.

Now, when the request reaches one of the nodes and is directed to the target node, a comparison should be made in the target node to identify if the stored number in the target node is 0 and 1, which means the resource is available in this node, otherwise the existing number moves forward of the target node and the above operation again will be performed. Fig. 6, shows this method with threshold = 2 bit, that when the length of bits becomes large in node B from 2 bits, so node B supposes that node C is a target node and stores the address of node C in its bitmap, and in fact from node B the counter will start again.

Fig. 6. An example of resource discovery tree with threshold = 2.

Another problem is the large number of the participating nodes and heterogeneity of their available resources. A user may need several resources which may send them in the form of several query bitmaps. It means that a lot of information will not be sent in the form of a unique query. But, we should identify the queries in nodes, i.e. if the query reached, relates to resource 1 or resource 2 etc. (for example OS, CPU, . . . ).

We can add some bits to any query bitmap to identify the resource. For example, if there are 16 types of resources in our grid environment, we can add 4 bits to any query bitmap, in order that the receiver can identify with which resource the bitmap should be compared to. This enables us to manage several resources in the grid environment.
