Elements to Threads Allocation for Dimensions Requiring Mapping
Given the rules laid down earlier the worker threads are responsible to allocate both source and target views and clean target view before running any data transformation. Since pDimPar
dimension exists only in the source cube the worker thread must find a mapping between source and target cubes to be able to allocate elements in dimension available in target cube that corresponds to the pDimPar
in the source cube. When constructing the mapping it must be assured that no elements in the target dimension equivalent to pDimPar are shared between two or more threads.
The general case described above applies to cases when data need to be copied from operative to planning cubes and vice versa. In FPM model there are mappings provided between operative and plan dimension by means of bi-directional mapping attributes. These are utilised to provide elements to thread allocation in cases of operative to planning cubes (and vice versa) data transfers.
Let’s consider a process that will copy data from operative to planning cube. The elements to threads mapping technique will have following steps:
Identify a set of source elements in
pDimPar
dimension - this applies if there was a parameter filter specified forpDimPar
when running the processMake a set in a dimension of target cube equivalent to
pDimPar
by projection from the source set by utilizing mapping attributesApply modulo allocation algorithm on the target dimension set to allocate target dimension elements to threads
Use mapping attribute to prepare set of source elements in
pDimPar
- the set will reflect the element allocation to threads provided in previous step
Let’s explore the above algorithm on following example:
The number of working threads
pMaxThreads
is set to4
, main thread is not participating in the data processing. Child threads havepThreadID
set to1
,2
and3
. There was a filter applied through process parameter that restrictedpDimPar
element range. Its value was set toA+B+C+D+E+F+G+H+I+J+K+M
pDimPar
dimension elements (source cube):A
,B
,C
,D
,E
,F
,G
,H
,I
,J
,K
,L
,M
,N
,O
,P
Equivalent dimension elements (target cube):
a
,d
,h
,m
Mapping between pDimPar and the equivalent dimension:
pDimPar |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Equivalent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ad 1) Source set of elements in pDimPar
:
The filter that has been used for elements in
pDimPar
was:A+B+C+D+E+F+G+H+I+J+K+M
The set of source elements is
A
,B
,C
,D
,E
,F
,G
,H
,I
,J
,K
,L
,M
ad 2) Target elements in equivalent dimension to pDimPar
:
Set in equivalent dimension to
pDimPar
is:a
,d
,h
,m
ad 3) Modulo algorithm applied on set as derived in step 2:
Element | a | d | h | m |
---|---|---|---|---|
pThreadID | 1 | 2 | 3 | 1 |
ad 4) Apply mapping on set from step 3) and project pThreadID
to source set of elements in pDimPar
from step 1:
pDimPar |
|
|
|
|
|
|
|
|
|
|
|
|
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Equivalent |
|
|
|
|
|
|
|
|
|
|
|
|
|
pThreadID |
|
|
|
|
|
|
|
|
|
|
|
|
|
We can now create list of elements that were assigned to each worker thread:
| Assigned Elements from Equivalent Dimension to | Assigned Elements from |
---|---|---|
|
|
|
| a, m |
|
| d |
|
| h |
|