Program: 173171
Project: 173171
Buggy source:
/** 
 * Initialize the data structure
 * @param cfg
 * @param plan
 * @param root
 * @param dests
 */
public BinaryTreeRouter(Config cfg,TaskPlan plan,int root,Set<Integer> dests){
  int interNodeDegree=MPIContext.interNodeDegree(cfg,2);
  int intraNodeDegree=MPIContext.intraNodeDegree(cfg,2);
  mainTaskLast=false;
  BinaryTree tree=new BinaryTree(interNodeDegree,intraNodeDegree,plan,root,dests);
  Node treeRoot=tree.buildInterGroupTree(0);
  Set<Integer> thisExecutorTasks=plan.getChannelsOfExecutor(plan.getThisExecutor());
  Set<Integer> thisExecutorTasksOfOperation=new HashSet<>();
  for (  int t : thisExecutorTasks) {
    if (dests.contains(t) || root == t) {
      thisExecutorTasksOfOperation.add(t);
    }
  }
  LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),thisExecutorTasksOfOperation.toString()));
  this.destinationIdentifiers=new HashMap<>();
  this.receiveTasks=new HashMap<>();
  sendExternalTasksPartial=new HashMap<>();
  sendInternalTasks=new HashMap<>();
  sendExternalTasks=new HashMap<>();
  receiveExecutors=new HashSet<>();
  for (  int t : thisExecutorTasksOfOperation) {
    List<Integer> recv=new ArrayList<>();
    Node search=BinaryTree.search(treeRoot,t);
    if (search != null) {
      mainTask=search.getTaskId();
      LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),mainTask));
      if (search.getParent() != null) {
        receiveExecutors.add(plan.getExecutorForChannel(search.getParent().getTaskId()));
        recv.add(search.getParent().getTaskId());
      }
      receiveTasks.put(t,new ArrayList<>(recv));
      List<Integer> directChildren=search.getDirectChildren();
      for (      int child : directChildren) {
        destinationIdentifiers.put(t,child);
        List<Integer> childReceiveTasks=new ArrayList<>();
        childReceiveTasks.add(t);
        receiveTasks.put(child,childReceiveTasks);
      }
      Set<Integer> mainInternalSendTasks=new HashSet<>(directChildren);
      sendInternalTasks.put(t,mainInternalSendTasks);
      Set<Integer> mainExternalSendTasks=new HashSet<>();
      mainExternalSendTasks.addAll(search.getRemoteChildrenIds());
      sendExternalTasks.put(t,mainExternalSendTasks);
      destinationIdentifiers.put(t,0);
    }
 else {
      LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),t));
    }
  }
  LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),sendInternalTasks));
  LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),sendExternalTasks));
  LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),sendExternalTasksPartial));
  LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),receiveExecutors));
  LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),receiveTasks));
}

Fixed version (ground truth):
/** 
 * Initialize the data structure
 * @param cfg
 * @param plan
 * @param root
 * @param dests
 */
public BinaryTreeRouter(Config cfg,TaskPlan plan,int root,Set<Integer> dests){
  int interNodeDegree=MPIContext.interNodeDegree(cfg,2);
  int intraNodeDegree=MPIContext.intraNodeDegree(cfg,2);
  mainTaskLast=false;
  BinaryTree tree=new BinaryTree(interNodeDegree,intraNodeDegree,plan,root,dests);
  Node treeRoot=tree.buildInterGroupTree(0);
  Set<Integer> thisExecutorTasks=plan.getChannelsOfExecutor(plan.getThisExecutor());
  Set<Integer> thisExecutorTasksOfOperation=new HashSet<>();
  for (  int t : thisExecutorTasks) {
    if (dests.contains(t) || root == t) {
      thisExecutorTasksOfOperation.add(t);
    }
  }
  LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),thisExecutorTasksOfOperation.toString()));
  this.destinationIdentifiers=new HashMap<>();
  this.receiveTasks=new HashMap<>();
  sendExternalTasksPartial=new HashMap<>();
  sendInternalTasks=new HashMap<>();
  sendExternalTasks=new HashMap<>();
  receiveExecutors=new HashSet<>();
  for (  int t : thisExecutorTasksOfOperation) {
    List<Integer> recv=new ArrayList<>();
    Node search=BinaryTree.search(treeRoot,t);
    if (search != null) {
      mainTask=search.getTaskId();
      LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),mainTask));
      if (search.getParent() != null) {
        receiveExecutors.add(plan.getExecutorForChannel(search.getParent().getTaskId()));
        recv.add(search.getParent().getTaskId());
      }
      receiveTasks.put(t,new ArrayList<>(recv));
      List<Integer> directChildren=search.getDirectChildren();
      for (      int child : directChildren) {
        destinationIdentifiers.put(t,child);
        List<Integer> childReceiveTasks=new ArrayList<>();
        childReceiveTasks.add(t);
        receiveTasks.put(child,childReceiveTasks);
      }
      Set<Integer> mainInternalSendTasks=new HashSet<>(directChildren);
      sendInternalTasks.put(t,mainInternalSendTasks);
      Set<Integer> mainExternalSendTasks=new HashSet<>();
      mainExternalSendTasks.addAll(search.getRemoteChildrenIds());
      sendExternalTasks.put(t,mainExternalSendTasks);
      destinationIdentifiers.put(t,0);
    }
 else {
      LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),t));
    }
  }
}