Program: 173252
Project: 173252
Buggy source:
/** 
 * Initialize the data structure
 * @param cfg
 * @param plan
 * @param root
 * @param dests
 */
public SingleTargetBinaryTreeRouter(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.receiveTasks=new HashMap<Integer,Map<Integer,List<Integer>>>();
  sendExternalTasks=new HashMap<>();
  sendInternalTasks=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));
      receiveExecutors.addAll(search.getRemoteChildrenIds());
      recv.addAll(search.getAllChildrenIds());
      Map<Integer,List<Integer>> receivePathMap=new HashMap<>();
      receivePathMap.put(0,new ArrayList<>(recv));
      receiveTasks.put(t,receivePathMap);
      List<Integer> directChildren=search.getDirectChildren();
      for (      int child : directChildren) {
        Map<Integer,Set<Integer>> sendMap=new HashMap<>();
        String log="String_Node_Str";
        Set<Integer> sendTasks=new HashSet<>();
        sendTasks.add(t);
        sendMap.put(MPIContext.DEFAULT_PATH,sendTasks);
        log+=String.format("String_Node_Str",plan.getThisExecutor(),child,t);
        sendInternalTasks.put(child,sendMap);
        LOG.info("String_Node_Str" + log);
      }
      Node parent=search.getParent();
      if (parent != null) {
        Map<Integer,Set<Integer>> mainSendMap=new HashMap<>();
        String log="String_Node_Str";
        Set<Integer> sendTasks=new HashSet<>();
        sendTasks.add(parent.getTaskId());
        mainSendMap.put(MPIContext.DEFAULT_PATH,sendTasks);
        log+=String.format("String_Node_Str",plan.getThisExecutor(),t,parent.getTaskId());
        sendExternalTasks.put(t,mainSendMap);
        LOG.info("String_Node_Str" + log);
      }
 else {
        mainTaskLast=true;
      }
    }
 else {
      LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),t));
    }
  }
}

Fixed version (ground truth):
/** 
 * Initialize the data structure
 * @param cfg
 * @param plan
 * @param root
 * @param dests
 */
public SingleTargetBinaryTreeRouter(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.receiveTasks=new HashMap<Integer,Map<Integer,List<Integer>>>();
  sendExternalTasks=new HashMap<>();
  sendInternalTasks=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));
      for (      int k : search.getRemoteChildrenIds()) {
        receiveExecutors.add(plan.getExecutorForChannel(k));
      }
      recv.addAll(search.getAllChildrenIds());
      Map<Integer,List<Integer>> receivePathMap=new HashMap<>();
      receivePathMap.put(0,new ArrayList<>(recv));
      receiveTasks.put(t,receivePathMap);
      List<Integer> directChildren=search.getDirectChildren();
      for (      int child : directChildren) {
        Map<Integer,Set<Integer>> sendMap=new HashMap<>();
        String log="String_Node_Str";
        Set<Integer> sendTasks=new HashSet<>();
        sendTasks.add(t);
        sendMap.put(MPIContext.DEFAULT_PATH,sendTasks);
        log+=String.format("String_Node_Str",plan.getThisExecutor(),child,t);
        sendInternalTasks.put(child,sendMap);
        LOG.info("String_Node_Str" + log);
      }
      Node parent=search.getParent();
      if (parent != null) {
        Map<Integer,Set<Integer>> mainSendMap=new HashMap<>();
        String log="String_Node_Str";
        Set<Integer> sendTasks=new HashSet<>();
        sendTasks.add(parent.getTaskId());
        mainSendMap.put(MPIContext.DEFAULT_PATH,sendTasks);
        log+=String.format("String_Node_Str",plan.getThisExecutor(),t,parent.getTaskId());
        sendExternalTasks.put(t,mainSendMap);
        LOG.info("String_Node_Str" + log);
      }
 else {
        mainTaskLast=true;
      }
    }
 else {
      LOG.info(String.format("String_Node_Str",plan.getThisExecutor(),t));
    }
  }
}