@Override
		public void bsp(
				BSPPeer<NullWritable, NullWritable, NullWritable, NullWritable, NullWritable> peer)
				throws IOException, SyncException, InterruptedException {
			int nbRowsBlocks = nbRowsA / blockSize;
			int nbColsBlocks = nbColsB / blockSize;
			int nbBlocks = nbRowsBlocks * nbColsBlocks;
			int blocksPerPeer = nbBlocks / peer.getNumPeers();
			int p = peer.getPeerIndex();
			int lastBlock = (p+1)*blocksPerPeer;
			if (p==peer.getNumPeers()-1) {
				lastBlock = nbBlocks;
			}
			ArrayList<Block> aBlocks = new ArrayList<Block>();
			ArrayList<Block> bBlocks = new ArrayList<Block>();
			for (int block = p*blocksPerPeer; block<lastBlock; block++){
				int i = block/nbColsBlocks;
				int j = block%nbColsBlocks;			
				for (int k = 0; k < nbRowsBlocks; k++) {
					Block aBlock = new Block(i, k, blockSize);
					aBlocks.add(aBlock);
					Block bBlock = new Block(k,j,blockSize);
					bBlocks.add(bBlock);
				}
			}
			
			int aILast = ((lastBlock-1)/nbColsBlocks)*blockSize+blockSize;
			int bILast = nbRowsBlocks*blockSize;
			
			HamaConfiguration conf = peer.getConfiguration();
			int rows = conf.getInt(inputMatrixARows, 4);
			int cols = conf.getInt(inputMatrixACols, 4);

			String[] parts = conf.get(inputMatrixAPathString).split("/");
			String aName = parts[parts.length-1];
			Utils.readMatrixBlocks(conf.get(inputMatrixAPathString)+"/"+aName, peer.getConfiguration(), rows, cols, blockSize, aILast, aBlocks);
			rows = conf.getInt(inputMatrixBRows, 4);
			cols = conf.getInt(inputMatrixBCols, 4);
			parts = conf.get(inputMatrixBPathString).split("/");
			String bName = parts[parts.length-1];
			Utils.readMatrixBlocks(conf.get(inputMatrixBPathString)+"/"+bName, peer.getConfiguration(), rows, cols, blockSize, bILast, bBlocks);
			
			HashMap<String, Matrix> resBlocks = new HashMap<String, Matrix>();
			
			for (int b = 0; b<aBlocks.size(); b++){
				Block aBlock = aBlocks.get(b);
				Block bBlock = bBlocks.get(b);
				String ind = aBlock.getI() + "," + bBlock.getJ();
				Matrix resBlock = resBlocks.get(ind);
				if (resBlock==null){
					resBlock = new Matrix(blockSize,blockSize);
					resBlock.zeroes();
				}
				resBlock = resBlock.sum(aBlock.getBlock().strassen(bBlock.getBlock()));
				resBlocks.put(ind, resBlock);
			}
			
			parts = conf.get(inputMatrixCPathString).split("/");
			String cName = parts[parts.length-1];
			for (String ind : resBlocks.keySet()){
				Matrix block = resBlocks.get(ind);
				Path path = new Path(conf.get(inputMatrixCPathString)+"/"+cName+ind.split(",")[0]+"_"+ind.split(",")[1]+".mat");
				Utils.writeMatrix(block.getValues(), path, conf);
			}
		}