@Override
		public void setup(
				BSPPeer<NullWritable, NullWritable, NullWritable, NullWritable, JobMessage> peer)
				throws IOException, SyncException, InterruptedException {
			HamaConfiguration conf = peer.getConfiguration();
			blockSize = conf.getInt(blockSizeString, 2);

			/* Values for rows and columns padded */
			nbRowsA = Utils.getBlockMultiple(conf.getInt(inputMatrixARows, 4),
					blockSize);
			nbColsA = Utils.getBlockMultiple(conf.getInt(inputMatrixACols, 4),
					blockSize);
			nbRowsB = Utils.getBlockMultiple(conf.getInt(inputMatrixBRows, 4),
					blockSize);
			nbColsB = Utils.getBlockMultiple(conf.getInt(inputMatrixBCols, 4),
					blockSize);
			a = new Matrix(Utils.readMatrix(
					new Path(conf.get(inputMatrixAPathString)),
					peer.getConfiguration(), conf.getInt(inputMatrixARows, 4),
					conf.getInt(inputMatrixACols, 4), blockSize), nbRowsA,
					nbColsA);
			b = new Matrix(Utils.readMatrix(
					new Path(conf.get(inputMatrixBPathString)),
					peer.getConfiguration(), conf.getInt(inputMatrixBRows, 4),
					conf.getInt(inputMatrixBCols, 4), blockSize), nbRowsB,
					nbColsB);
			if (peer.getPeerIndex() == 0) {
				/*
				 * System.out.println("A"); a.print(); System.out.println("B");
				 * b.print(); System.out.println("A*B");
				 * System.out.println(a.mult(b).toString());
				 */
			int peerInd = 0;
				indices = new HashMap<Integer, List<Integer[]>>();
				for (int i = 0; i < nbRowsA / blockSize; i++) {
					for (int j = 0; j < nbColsB / blockSize; j++) {
						for (int k = 0; k < nbColsA / blockSize; k++) {
							if (peerInd == 0) {
								if (masterIndices == null) {
									masterIndices = new ArrayList<Integer[]>();
								}
								masterIndices.add(new Integer[] { i, j, k });
							} else {
								JobMessage job = new JobMessage(0, i, j, k);
								peer.send(peer.getPeerName(peerInd), job);
							}

							List<Integer[]> peerIndices = indices.get(peerInd);
							if (peerIndices == null) {
								peerIndices = new ArrayList<Integer[]>();
							}
							peerIndices.add(new Integer[] { i, j });
							indices.put(peerInd, peerIndices);
							peerInd = (peerInd + 1) % peer.getNumPeers();
						}
					}
				}
			}
			peer.sync();
		}