while ( (msg = peer.getCurrentMessage()) != null) {
MatrixWritable tmp = (MatrixWritable) msg.get(msgFeatureMatrix);
res.add(tmp.getMatrix());
incomingMsgCount++;
}
res.divide(incomingMsgCount);
}
if (broadcast) {
if (peer.getPeerName().equals(master)) {
// broadcast to all