Class CommPattern

java.lang.Object
edu.rit.pj.cluster.CommPattern

public class CommPattern extends Object
Class CommPattern provides static methods for calculating communication patterns for collective communication operations.
Version:
15-Mar-2008
Author:
Alan Kaminsky
  • Method Details

    • broadcastPattern

      public static int[] broadcastPattern(int size, int rank, int root)
      Calculate the communication pattern for a parallel broadcast tree. This is also used in reverse for a parallel reduction tree.
      Parameters:
      size - Size of the communicator. Must be >= 1.
      rank - Rank of this process in the communicator. Must be in the range 0 .. size-1.
      root - Rank of the root process for the broadcast. Must be in the range 0 .. size-1.
      Returns:
      Array of process ranks for the parallel broadcast pattern. The element at index 0 is the parent process rank, or -1 if there is no parent process. The elements at indexes 1 and above, if any, are the child process ranks.
      Throws:
      IllegalArgumentException - (unchecked exception) Thrown if any argument is illegal.