Program: 173259
Project: 173259
Buggy source:
/** 
 * Progress the communications that are pending
 */
public void progress(){
  while (pendingSends.size() > 0) {
    MPISendRequests sendRequests=pendingSends.poll();
    postMessage(sendRequests);
    waitForCompletionSends.add(sendRequests);
  }
  for (int i=0; i < registeredReceives.size(); i++) {
    MPIReceiveRequests receiveRequests=registeredReceives.get(i);
    if (receiveRequests.availableBuffers.size() > 0) {
      LOG.info(String.format("String_Node_Str",executor,receiveRequests.rank));
      postReceive(receiveRequests);
    }
  }
  for (int i=0; i < waitForCompletionSends.size(); i++) {
    MPISendRequests sendRequests=waitForCompletionSends.get(i);
    Iterator<MPIRequest> requestIterator=sendRequests.pendingSends.iterator();
    while (requestIterator.hasNext()) {
      MPIRequest r=requestIterator.next();
      try {
        Status status=r.request.testStatus();
        if (status != null) {
          LOG.log(Level.INFO,executor + "String_Node_Str");
          requestIterator.remove();
        }
      }
 catch (      MPIException e) {
        throw new RuntimeException("String_Node_Str" + sendRequests.rank,e);
      }
    }
    if (sendRequests.pendingSends.size() == 0) {
      sendRequests.callback.onSendComplete(sendRequests.rank,sendRequests.edge,sendRequests.message);
    }
  }
  for (int i=0; i < registeredReceives.size(); i++) {
    MPIReceiveRequests receiveRequests=registeredReceives.get(i);
    try {
      Iterator<MPIRequest> requestIterator=receiveRequests.pendingRequests.iterator();
      while (requestIterator.hasNext()) {
        MPIRequest r=requestIterator.next();
        Status status=r.request.testStatus();
        if (status != null) {
          if (!status.isCancelled()) {
            LOG.log(Level.INFO,executor + "String_Node_Str" + status.getCount(MPI.BYTE));
            r.buffer.setSize(status.getCount(MPI.BYTE));
            receiveRequests.callback.onReceiveComplete(receiveRequests.rank,receiveRequests.edge,r.buffer);
            requestIterator.remove();
          }
 else {
            throw new RuntimeException("String_Node_Str");
          }
        }
      }
    }
 catch (    MPIException e) {
      LOG.severe("String_Node_Str");
      throw new RuntimeException("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Progress the communications that are pending
 */
public void progress(){
  while (pendingSends.size() > 0) {
    MPISendRequests sendRequests=pendingSends.poll();
    postMessage(sendRequests);
    waitForCompletionSends.add(sendRequests);
  }
  for (int i=0; i < registeredReceives.size(); i++) {
    MPIReceiveRequests receiveRequests=registeredReceives.get(i);
    if (receiveRequests.availableBuffers.size() > 0) {
      LOG.info(String.format("String_Node_Str",executor,receiveRequests.rank));
      postReceive(receiveRequests);
    }
  }
  for (int i=0; i < waitForCompletionSends.size(); i++) {
    MPISendRequests sendRequests=waitForCompletionSends.get(i);
    Iterator<MPIRequest> requestIterator=sendRequests.pendingSends.iterator();
    while (requestIterator.hasNext()) {
      MPIRequest r=requestIterator.next();
      try {
        Status status=r.request.testStatus();
        if (status != null) {
          requestIterator.remove();
        }
      }
 catch (      MPIException e) {
        throw new RuntimeException("String_Node_Str" + sendRequests.rank,e);
      }
    }
    if (sendRequests.pendingSends.size() == 0) {
      sendRequests.callback.onSendComplete(sendRequests.rank,sendRequests.edge,sendRequests.message);
    }
  }
  for (int i=0; i < registeredReceives.size(); i++) {
    MPIReceiveRequests receiveRequests=registeredReceives.get(i);
    try {
      Iterator<MPIRequest> requestIterator=receiveRequests.pendingRequests.iterator();
      while (requestIterator.hasNext()) {
        MPIRequest r=requestIterator.next();
        Status status=r.request.testStatus();
        if (status != null) {
          if (!status.isCancelled()) {
            r.buffer.setSize(status.getCount(MPI.BYTE));
            receiveRequests.callback.onReceiveComplete(receiveRequests.rank,receiveRequests.edge,r.buffer);
            requestIterator.remove();
          }
 else {
            throw new RuntimeException("String_Node_Str");
          }
        }
      }
    }
 catch (    MPIException e) {
      LOG.severe("String_Node_Str");
      throw new RuntimeException("String_Node_Str",e);
    }
  }
}