rtsIDe (1158448), страница 3
Текст из файла (страница 3)
To delete a processor system the function delobj_ can also be used (see section 17.5).
The function returns zero.
4.5Weights of processor system elements
Let a processor system be n-dimension array, and a function WEIGHTi with the domain of definition in a space of values of i-th dimension index variable and with image in real numbers, more or equal to 1 be defined for every dimension. A value of function WEIGHTi(Pi) will be called the weight of Pi coordinate (1 i n , 0 Pi < PSSIZEi , PSSIZEi is a size of i-th dimension of processor system).
Then processor (P1, ... , Pi, ... , Pn) weight is by definition
| WEIGHT(P1, ... , Pi, ... , Pn) = | n |
The coordinate weights of the initial processor system elements (therefore and processor weights) are parameters of Run-Time System startup. When a user program is running the coordinate weights of the processors of the processor system can be assigned (changed) by the function
| .long setpsw_( | PSRef | *PSRefPtr, |
| *PSRefPtr | | reference to the processor system, whose element coordinate weights will be assigned. |
| *AMViewRefPtr | | reference to the abstract machine representation, to be mapped onto specified processor system with the assigned coordinate weights. |
| CoordWeightArray | | array, containing processor coordinate weights. |
Depending on AMViewRefPtr parameter value there are two ways of setpsw_ function execution.
1. AMViewRefPtr NULL and *AMViewRefPtr 0.
Assigned weights of processor coordinates are intended only for mapping or remapping given representation of abstract machine on given processor system.
When setpsw_ function is called the abstract machine (parental) with representation, specified by *AMViewRefPtr reference, must be already mapped.
All processors of the system, specified by *PSRefPtr reference, must belong to elementary intersection of the current processor system with the processor system, the parental abstract machine is mapped on. NULL value of PSRefPtr pointer or zero value of *PSRefPtr reference means, that coordinate weights of the current processor system elements are assigned.
2. AMViewRefPtr = NULL or *AMViewRefPtr = 0.
Assigned weights of processor coordinates, as the weights, specified at Run-Time System startup, will be used in mapping or remapping of all representations of abstract machines on given processor system (except ones, for those their own procåssor coordinate weights were assigned or will be assigned by setpsw_ function).
All processors of system, specified by *PSRefPtr reference, must be the members of the current processor system. NULL value of PSRefPtr pointer or zero value of *PSRefPtr reference means, that coordinate weights of the current processor system elements are assigned.
The weight of coordinate Pi is specified by a value of
| i-1 |
| (PSSIZEk + Pi)-th |
| k=1 |
element of the array CoordWeightArray. A number of elements of the array CoordWeightArray, containing processor coordinate weights, must be equal to sum of sizes of all processor system dimensions. The coordinate weights in the array CoordWeightArray may be any positive numbers. Executing function setpsw_, Run-Time System updates every weight Pi dividing it by minimal weight of the coordinate in the array CoordWeightArray.
If CoordWeightArray = NULL or CoordWeightArray[0] = 0, then coordinate weights, specified in Run-Time System startup parameters, are used as assigned coordinate weights (for initial processor system; for not initial processor system in this case coordinate weights will be set to 1).
If CoordWeightArray [0] = 1, then the weights of all coordinates will be set to 1 and will not be updated later, i.e. they will be considered as optimal weights of processor coordinates (see below).
The function returns zero.
The processor coordinate weights, considered above, are called computational weights. They determine distribution of data and computations over processors: computational processor loading is proportional to computational weight of the processor (equal to product of computational weights of its coordinates). The computational weights of the processor coordinates reflect calculation heterogeneity of the task being solved and are specified so that to provide balanced processor loading under condition, that they have the same performances.
A difference in processor performance is specified by performance weights: the processor performance is proportional to its performance weight. The performance weights (real numbers, equal to or more then 1) are Run-Time System startup parameters and cannot be updated by a user program.
When Run-Time System is initialized (and when the function setpsw_ is executed) computational weights of processor coordinates are updated according to the processor performance. The result of updating is optimal weights of the processor coordinates, reflecting as calculation heterogeneity of the task being solved as hardware heterogeneity of the processor system. The optimal weights provide the best balance of computations and are specified as follows. Let:
| WEIGHTcalc,i (Pi) | | computational weight of Pi coordinate of the processor system (specified under assumption that performance weights of all the processors are equal to 1; |
| WEIGHTperf (P1, ... , Pi, ... , Pn) | | performance weight of the processor element (P1, ... , Pi, ... , Pn); |
| WEIGHTopt,i (Pi) | | optimal weight of coordinate Pi of the processor system i-th dimension. |
Let us suppose, that processor weight, determining the processor loading by data and computations is:
-
proportional to the processor performance weight;
-
equal to the product of its coordinate weights for any processor performance.
Let us suppose also, that "contribution" of processor performance weight into its coordinate weights is the same.
Therefore a value of processor performance weight WEIGHTperf(P1, ... ,Pi, ... ,Pn) requires to increment the computational weight of any its coordinate by WEIGHTperf1/n(P1, ... ,Pi, ... ,Pn) times.
Since when optimal weight of coordinate Pi is calculated it is necessary to take into account the performance weights of all the processors with coordinate Pi, required weight WEIGHTopt,i(Pi) for any Pi must be a solution of the following optimization task (criterion is best balanced processor loading):
| MAX ( abs( WEIGHTopt,i(Pi) | WEIGHTperf1/n(P1, ... ,Pi, ... Pn) * |
| 0 ≤ p1 < pssize1 | WEIGHTcalc,i(Pi) ) ) MIN |
The solution in domain of real numbers, more then or equal to 1, is
| WEIGHTopt,i (Pi) = | n |
| WEIGHTcalc,i (Pi) * | WEIGHTperf1/n (P1, ... ,Pi, ... Pn) / PSSIZEk |
| 0 ≤ p1 < pssize1 k=1 |
Using optimal weights of processor coordinates for non-uniform distribution of the elements of abstract machine representation (and as consequence, the elements of distributed array and parallel loop iterations) is considered in section 5.7.
Besides setpsw_ function considered above, computational processor coordinate weights can be assigned by the functions
| .long genbli_( | PSRef long | *PSRefPtr, *AxisCountPtr ); |
and
| .long genbld_( | PSRef long | *PSRefPtr, *AxisCountPtr ); |
The parameters PSRefPtr and AMViewRefPtr of the functions are similar to the same named parameters of setpsw_ function. Processor coordinate weights are set in an array, individual for every dimension of the processor system. The array address is contained in AxisWeightAddr array: i-th element of AxisWeightAddr array is the pointer, cast to AddrType, to the array, containing processor coordinate weights of (i+1)-th dimension of the specified processor system. The function genbli_ assumes that processor coordinate weights are represented as positive integer numbers (integer), and the function genbld_ positive float numbers (double).
Zero value of AxisWeightAddr[i] means, that for (i+1)-th dimension of the processor system the processor coordinate weights will be equal to the weights, specified in Run-Time System startup parameters (for initial processor system), or to 1 (for other one).
*AxisCountPtr parameter (non-negative integer) defines a number of AxisWeightAddr array elements. Its value can't exceed specified processor system rank. AxisWeightAddr array elements, lacking up to the processor system rank, will be assumed equal to null. In particular, zero value of *AxisCountPtr means, that the weights of all coordinates of all the processors will be set equal to 1 or to the weights, specified in Run-Time System startup parameters.
The functions return zero values.
Note. genbli_ and genbld_ functions just call the function
| .long genblk_( | PSRef long long | *PSRefPtr, *AxisCountPtr, *DoubleSignPtr ); |
First four parameters of the function are identical to same named parameters of genbli_ and genbld_ functions, and last one, *DoubleSignPtr is non-zero flag to represent processor coordinate weights as positive float numbers (double).
4.6Specifying coordinate weights of processors using their loading weights
| .long setelw_ ( | PSRef | *PSRefPtr, |















