@Override
public void bsp(BSPPeerProtocol bspPeer) throws IOException,
KeeperException, InterruptedException {
byte[] dummyData = new byte[sizeOfMsg];
BSPMessage msg = null;
String[] peers = bspPeer.getAllPeerNames();
String peerName = bspPeer.getPeerName();
for (int i = 0; i < nSupersteps; i++) {
for (int j = 0; j < nCommunications; j++) {
String tPeer = peers[r.nextInt(peers.length)];
String tag = peerName + " to " + tPeer;
msg = new BSPMessage(Bytes.toBytes(tag), dummyData);
bspPeer.send(tPeer, msg);
}
bspPeer.sync();
BSPMessage received;
while ((received = bspPeer.getCurrentMessage()) != null) {
LOG.info(Bytes.toString(received.getTag()) + " : " + received.getData().length);
}
}
}