After sorting, each process has potentially several leaves.
If we have two processes $P_{i}$ and $P_{j}$ with $i < j$ the sort guarantees that all leaves from node i are inferior than the leaves on the node j in a Morton indexing way.
But the leaves are randomly distributed among the nodes and we need to balance them.
It is a simple reordoring of the data, but the data has to stayed sorted.
After sorting, each process has potentially several leaves. If we
have two processes $P_{i}$ and $P_{j}$ with $i < j$ the sort
guarantees that all leaves from node i are inferior than the leaves on
the node j in a Morton indexing way. But the leaves are randomly
distributed among the nodes and we need to balance them. It is a
simple reordoring of the data, but the data has to stayed sorted.
\begin{enumerate}
\item Each process informs other to tell how many leaves it holds.
\item Each process compute how many leaves it has to send or to receive from left or right.
\item Each process compute how many leaves it has to send or to
receive from left or right. \label{balRef}
\end{enumerate}
At the end of the algorithm our system is completely balanced with the same number of leaves on each process.
At the end of the algorithm our system is completely balanced with the
same number of leaves on each process. If another kind of balancing
algorithm is needed, one can only change the BalanceAlgorithm class
that is given in parameter to the ArrayToTree static method in the
step \ref{balRef}.
\subsection{Balancing algorithms supported}
Any balancing algorithm can be used, but it has to provide at least
two method, as showed in the class FAbstractBalancingAlgorithm.
Those methods are :
\begin{enumerate}
\item GetLeft : return the number of leaves that will belongs only to
proc on the left of given proc.
\item GetRight : return the number of leaves that will belongs only to
proc on the right of given proc.
\end{enumerate}
In the parameters of those two methods, one can find the total number
of leaves, the total number of particles, the number of proc, and the
The M2L operator is relatively similar to the P2P.
Hence P2P is done at the leaves level, M2L is done on several levels from Height - 2 to 2.
Hence P2P is done at the leaves level, M2L is done on several levels from $Height -2$ to 2.
At each level, a node needs to have access to all the distant neighbors of the cells it is the proprietary and those ones can be hosted by any other node.
Anyway, each node can compute a part of the M2L with the data it has.
\subsection{Original Algorithm}
The algorithm can be viewed as several tasks:
\begin{enumerate}
\item Compute to know what data has to be sent
...
...
@@ -436,7 +527,7 @@ The algorithm can be viewed as several tasks: