Modeling of the Consensus in the Allocation of Resources in Distributed Systems

When it comes to processes distributed in process nodes that access critical resources shared in the modality of distributed mutual exclusion, it is important to know how these are managed and the order in which the demand for resources is resolved by the processes. Being in a shared environment, it is necessary to comply with certain rules, for instance, access to resources must be achieved through mutual exclusion. In this work, through an aggregation operator, a consensus mechanism is proposed to establish the order of allocation of resources to the processes. The consensus is understood as the agreement that must be achieved for the allocation of all the resources requested by each process. To model this consensus, it must be taken into account that the processes can form group of processes or be independent, the state of the nodes where each of them is located, the computational load, the number of processes, the priorities of the processes, CPU usage, use of main memory, virtual memory, etc. These characteristics allow the evaluation of the conditions to agree on the order in which allocations of resources to processes will be made. Keywords—Aggregation operators; communication between groups of processes; mutual exclusion; operating systems; processor scheduling


I. INTRODUCTION
The proliferation of computer systems, many of them distributed in different nodes with multiple processes that cooperate for the achievement of a particular function, requires decision models that allows groups of processes to use shared resources that can only be accessed in the modality of mutual exclusion.
The traditional solutions for this problem are found in [1] and [2], both papers describe the main synchronization algorithms in distributed systems.The author in [3] presents an efficient and fault tolerant solution for the problem of distributed mutual exclusion.The authors in [4], [5] and [6] present algorithms to manage the mutual exclusion in computer networks.In [7] are detailed the main algorithms for distributed processes management, distributed global states and distributed mutual exclusion.
The allocation of resources in processes should be performed taking into account the priorities of the processes and also the state in terms of workload of the computational nodes in which the processes are executed.Also, solutions (which may be considered traditional) have been proposed for different types of distributed systems in [8], [9], [10], [11] and [12].Other works that focused on ensuring mutual exclusion have been presented in [13] and [14].An interesting distributed solution based on permissions is presented in [15] and a solution based on process priorities can be found in [16].
In this paper, a new aggregation operator will be presented specifically for solving the aforementioned problem.This falls under the category of OWA (Ordered Weighted Averaging) operators, more specifically Neat OWA.The use of aggregation operators in decision models has been widely studied.For example, [17], develops methodologies that solve problems in the presence of multiple attributes and criteria and in [18] the way to obtain a priority vector is collectively studied, which is created from different formats of expression of the preferences of decision makers.The model can reduce the complexity of decision-making and avoid the loss of information when the different formats are transformed into a single format of expression of preferences.In addition, [19] presents the main mathematical properties and behavioural measures related to the aggregation operators.A review of aggregation operators, especially those of the OWA family, is presented in [20], [21] and [22].OWA operators applied to multicriteria decision making are presented and analysed in [23], and [24] analyse the OWA operators and their applications in the decision making process.In turn, in [25] a complex and dynamic problem of group decision making with multiple attributes is defined and a resolution method is proposed, which uses a consensus process for groups of attributes, alternatives and preferences, resulting in a decision model for problems of the real world.This study will present a variant of an innovative method for the management of shared resources in distributed systems, based on [26] and [27], in which an aggregation operator is developed to assign resources in distributed systems.Here, we establish a consensus model that favours the sequential access of the processes to all the requested resources.The premises, data structures and the operator mentioned in [26] and [27], are used as a starting point to create a new operator in the scenario described next.This paper, which presents an innovative method for the management of shared resources in distributed systems is structured as follows: Section 2 explains the data structures that the proposed operator will use, Section 3 describes the aggregation operator, in Section 4 a detailed example of this is shown, then the Conclusions and the Future lines of work are presented, and then the Acknowledgments, the References and the appendix are shown.www.ijacsa.thesai.org

II. DATA STRUCTURES TO BE USED
The proposed scenario considers the following conditions: In first place, the processes must have access to shared resources in the mutual exclusion modality.In second place, they must be able to form groups of processes (independent processes are considered as unitary groups).In third place, the processes must not require synchronization (that is, to be active in their respective processors at the same time) and they must have strict consensus requirements in order to gain access to the resources (an agreement is required in order to consecutively allocate the resources requested by a process, that is, once the resources allocation sequence is started, it cannot be interrupted to allocate resources to other processes, until the active process releases the resources).
These are groups of processes that are distributed in process nodes that access critical resources.These resources are shared in the form of distributed mutual exclusion and it must be decided, according to the demand for resources by the processes, what the priorities to allocate the resources to the processes that require them will be (only the resources that are available to be assigned in the processes will be taken into account, that is, those not yet allocated in certain processes).
 The access permission to the shared resources of a node will not only depend on whether the nodes are using them or not, but on the aggregation value of the preferences (priorities) of the different nodes regarding granting access to shared resources (alternatives) as well.
 The opinions (priorities) of the different nodes regarding granting access to shared resources (alternatives) will depend on the consideration of the value of variables that represent the state of each one of the different nodes.Each node must express its priorities for assigning the different shared resources according to the resource requirements of each process (which may be part of a group of processes).
These available shared resources hosted on different nodes of the distributed system may be required by the processes (clustered or independent) running on the nodes.
Possible states of each process:  Independent process.
 Process belonging to a group of processes. Additional memory required for each resource requested by each process (depending on the availability of the data).
 Additional estimated processor load required for each resource requested by each process (depending on data availability).
 Additional estimated input / output load required for each resource requested by each process (depending on data availability).
 Status of each one of the shared resources in the distributed mutual exclusion mode in the node:  Assigned to a local or remote process.
 Predisposition (nodal priority) to grant access to each of the r shared resources in the mode of distributed mutual exclusion (will result from the consideration of the variables representing the node status, the priority of the processes and the additional computational load, which would mean allocating the resource to the requesting process).
 Current load of the node, which can be calculated as the average CPU, memory and input / output usage percentages at any given time (these load indicators may vary depending on the case, some may be added or changed); the current load categories, for example, High, Medium and Low, should also be defined, with value ranges for each category being indicated.
The scenario proposed in this study considers resources and processes in distributed operating systems, applied to the telecommunications environment, but without being limited to any specific communications protocol, meaning that it is a generic scheme.It is considered that the application of the proposed method would result in an increase in the traffic of control information, but the overall performance of the system would improve by allocating resources to the processes according to a holistic and cognitive decision-making scheme that also guarantees mutual exclusion in access to shared resources.
Fig. 1 shows the resources requests by the processes, the resources already assigned and the nodes in which they are located.The proposed operator consists of the following steps: 1) Calculation of the current computational load of the nodes.
2) Establishment of the categories of computational load and the vectors of weights associated with them.
3) Calculation of the priorities or preferences of the processes considering the state of the node (in each node for each process).
4) Calculation of the priorities or preferences of the processes to access the available shared resources.(calculated in the centralized manager of shared resources) and determination of the allocation order and to which process the resources will be allocated.
Each one of the steps of Fig. 2 is described in [26] and [27].
In Fig. 2, there is a list of the necessary steps to obtain the final global priorities to assign the resources (DSAF, Distributed Systems Assignment Function).The order or priority of allocation of the resources and the process to which each resource is assigned (ODSAF, Ordered Distributed System Assignment Function) can be seen in Table 1.
The last step is to repeat the procedure but removing the already made allocations from the resources requests (CDSAF, Concatenated Distribution Systems Assignment Function), as shown in Fig. 3.The CDSAF table is obtained from the concatenation of the ODSAF tables of each iteration, as shown in Table 1.

a) Final global priority of the process
Once the CDSAF table is completed (Table 1), the final global priorities of the processes will be calculated in order to access all of its resources, and the order in which each one will be allocated will be established, receiving all the requested resources.For this, the CDSAF table will be considered, the priorities of all the resource/process assignments will be added for each process, and they will be divided by the number of assignments of that process.The process with the higher final global priority will be the first one to get the requested resources.This constitutes what will be called the Final Global Priority of the Process (FGPP), as shown in Fig. 4.  h= total number of processes in the system (summation of processes of the nodes); j=number of resources allocated to the i process.
The elements of the FGPP vector must be ordered from highest to lowest to obtain the global priority order of allocation of resources to processes, as shown in Fig. 5.

Ordered Final Global Priority of the Process (OFGPP)
j= cardinality of FGPP (number of processes in the system) The OCDSAF will establish the order of the final global priority allocation of processes to access its resources, and the order in which each one will be allocated, getting all the requested resources.For this, the CDSAF and OFGPP tables will be considered, as shown in Fig. 6.
The cardinalities (number of allocation of resources to each process) obtained from each one of the processes of the OFGPP vector in the CDASF table will be calculated.
Then, each one of the allocations of resources to processes in the CDSAF table of each one of the OFGPP vector processes will be obtained.The total number of allocations for each process will be determined by the cardinality calculated in the previous step, as shown in Fig. 7.
In Fig 7, the first step is to calculate the priority of the process p ek , considering all rounds at CDSAF.The second step is to obtain the position in the OFGPP vector according to the calculated priority.The third step is to find all the assignments of the p ek process in the CDSAF and place them in the OCDSAF in the order in which the p ek process appears in the OFGPP.The representation of resources r ij indicate the resources (whose first sub-index represents the node where it is and the second sub-index represents the resource number itself) that are assigned to the p ek process (whose first subindex represents the node where it is and the second sub-index represents the process number itself) in each round.Although the resources have the same sub-indexes, they are not necessarily the same resources, but they can represent different resources that are assigned several times in the different rounds, but always to the same p ek process.The location in the FASDCO table will depend on the location in the PGFPO vector., , , Where b j is the j th highest value of the a n , with the restriction for weights to satisfy For the Neat OWA operator family, the weights will be calculated according to the elements that are added, or more exactly to the values to be orderly added, the b j , maintaining conditions (2) and (3).In this case the weights are This family, in which the weights depend on the aggregation, do not require to meet all properties of OWA operators.
In addition, in order to be able to assert that an aggregation operator is neat, the final aggregation value needs to be independent of the order of the values., , , One of the characteristics to be pointed out by Neat OWA operators is that the values to be added do not need to be sorted out for their process.This implies that the formulation of a neat operator can be defined by the arguments instead of the orderly elements.
In the proposed aggregation operator, the weights are calculated according to context values.From this context, arise the values to be aggregated.

IV. EXAMPLE AND DISCUSSION OF RESULTS
This section will explain in detail an example of application of the proposed aggregation operator.This example takes as a starting point the ordered DSAF vector from [26] and [27], and these steps are shown in Fig. 2.
The example seen in [26] shows the following calculations:  The priorities or preferences of the processes to access the available shared resources.
 The vector of final weights that will be used in the final aggregation process to determine the order or priority of access to the resources.
The greatest of these products made for the different processes in relation to the same resource, will indicate which one of the processes will get access to the resource.
The summation of all these products in relation to the same resource will indicate the priority that said resource will have in order to be assigned.This constitutes the Distributed System Assignment Function (DSAF) that can be seen in Table 2.
The final order of allocation of the resources and the recipient processes is obtained by ordering Table 2, as shown in Table 3.The next step is to repeat the procedure, but removing the requests of already made allocations; it must be noted that the assigned resources will be available once they are released by the processes, and can therefore be allocated to other processes.
In this way, all the resources requests from all the processes will be answered, considering mutual exclusion and priorities of the processes, nodal priorities and final priorities, according to the scenario presented in [26] and [27].
The scenario presented next, starts from the concatenation of the ordered assignment of each one of the iterations corresponding to the above mentioned scenario.
The CDSAF table will be obtained from the concatenation of the ODSAF table of each iteration, as shown in Table 4.The CDSAF table ordered by process, as shown in Table 5.
By calculating the FGPP for all the processes, as shown in Table 5, a vector will be obtained, as shown in Table 6.
The elements of the FGPP vector must be ordered from highest to lowest, in order to obtain the global priority order of allocation of resources to processes, as can be seen in Table 7.The cardinalities (number of allocation of resources to each process) obtained from each one of the OFGPP vector processes in the CDSAF table will be calculated.Then, each one of the allocation of resources to processes in the CDSAF table of each process of OFGPP vector must be obtained.The total number of elements for each process will be determined by the cardinality calculated in the previous step.Table 8 shows the order of all the resource allocations for each process, which one is the first process with greater global priority, and is the one to which the resources are assigned first.The complete table continues for each one of the requests for each process (OCDSAF).In this way, all the requests of resources from all the processes were answered, considering the mutual exclusion and the priorities of the processes, the nodal priorities and the final priorities, taking into account the strict consensus requirements established for this scenario.

V. EVALUATION
The data structure mentioned above and the aggregation method used are not fully covered by traditional methods.This work considers the global average of priorities that each process has over all the resources of all its assignments in the different rounds, but for the final global allocation, it respects the same order of allocation of each resource in the different rounds in which they were assigned in the general scenario.That is, the choice of which process will be granted resources, is established with the global average of priorities in all assignments, but the order in which those assignments are to be made, respects the one in the table FASD, for each process.
The proposed model manages to establish a consensus that allows processes to access all their resources sequentially and that these cannot be removed until the process that holds them releases them.The order of assignment will be determined by the overall average priority of all the assignments.The distributed system regulates and constantly updates the local state of each node, the decisions of access to resources modify these states so it must be readjusted repeatedly, guaranteeing mutual exclusion and reordering new priorities.The method must be repeated whenever there are processes that require shared resources.

VI. CONCLUSIONS
The proposed model includes, as a particular case, a method that consists in considering the global priority of the processes, instead of a group of state variables of each node.As the processes are executed in different processors using all their resources, there is no conflict in running several processes in the same processor.In this scenario, no account is taken of the amount of time each process will use in a processor of a particular node.Nor is the amount of time in which each resource will be assigned to a particular process Another notable feature of the proposal is its ease of implementation in the environment of a centralized administrator of shared resources of a distributed system.

VII. FUTURE LINES OF RESEARCH
It is considered to develop decision models from the cognitive point of view for decision making in groups of processes, contemplating the principles of cybernetics of second order, in the context of complex systems of selfregulation, which transcend the traditional approach of computer science considering the possibility of imputation of missing data, for example, as a consequence of problems in communications between processes, and fuzzyfication of variables to support situations where it is not possible or convenient to express exact values.
In addition, the aim is to investigate the impact on data traffic of applying the proposed method and comparing it with other classical methods.To this end, a simulator will be developed in which the different possible scenarios will be considered to allow the system to predict, compare and optimise the behaviour of its simulated processes in a very short time without the cost or risk of carrying them out, making it possible to represent the processes, resources and nodes in a dynamic model.
Another possible line of research considers aspects related to security in the execution of processes, access to resources and communication between nodes.


Possible state of each one of the nodes:  Number of processes. Priorities of the processes. CPU usage. Main memory usage. Use of virtual memory.

Fig. 1 .
Fig. 1.Resources and Processes at Nodes in Distributed Systems.

Fig. 5 .
Fig. 5.An example of the calculation of the OFGPP of each process.

Fig. 6 .
Fig. 6.Steps to go from the CDSAF to the OCDSAF.

Fig. 7 .
Fig. 7. Calculation of Priorities for the Pek Process with the Highest Priority in PGFPO.

TABLE I .
CONCATENATION OF THE ORDERED ASSIGNMENT TABLES (ODSAF) OF EACH ONE OF THE ITERATIONS CORRESPONDING TO THE GENERAL METHOD

TABLE II .
FINAL GLOBAL PRIORITIES FOR ALLOCATING THE RESOURCES (DSAF) IN THE FIRST ITERATION

TABLE IV .
ORDER OR FINAL PRIORITY OF ASSIGNMENT OF RESOURCES AND PROCESS TO WHICH IS ALLOCATED EACH RESOURCE IN ALL ITERATIONS (CDSAF)

TABLE V .
FINAL GLOBAL PRIORITY ORDERED BY PROCESS

TABLE VI .
FINAL GLOBAL PRIORITY OF THE PROCESS (FGPP)

TABLE VIII .
FINAL ORDER OF ALLOCATION OF EACH ONE OF THE RESOURCES TO EACH OF ONE PROCESSES OF THE (OCDSAF)