Pairwise
Description
Generally, each rank has only one RDMA network port. If the RDMA link uses the Mesh algorithm for AllToAll, it sends and receives data to and from multiple ranks simultaneously. This causes resource contention and degrades the overall performance.
The Pairwise algorithm is a step-by-step execution version of the Mesh algorithm. It divides communication into several steps. In each step, data is exchanged with only one rank. For example, for a rank whose rankid is i, the first step is to receive data from the (i – 1) rank and send data to the (i + 1) rank. The second step is to receive data from the (i – 2) rank and send data to the (i + 2) rank, and so on.

Required Time Calculation
The size of data that rank i needs to send to rank j is defined as nij.
In step k, rank i sends data of size ni,i+k to rank i+k. The time required for step k is as follows.

The time required for the entire Pairwise operation is as follows.
