@Override
	public OptimusData readDouble(ArrayID aid, PID pid,OptimusShape pshape, OptimusShape starts,
			OptimusShape offs) throws IOException {

		int[] start = starts.getShape();
		int[] off = offs.getShape();

		Partition p = this.rmanger.getPartitionById(aid, pid);
		if( p == null)
		{
			System.out.println("Wrong partion");
			return null;
		}
		System.out.println("Reading partition:" + p.toString());

		OptimusZone zone = this.rmanger.getZone(p.getZid());
		Vector<int[]> shapes = zone.getStrategy().getShapes();

		
		DataChunk chunk = new DataChunk(pshape.getShape(),
				shapes.get(p.getRid().getId()));

		int rsize = 1;
		for (int i = 0; i < off.length; i++)
			rsize *= off[i];
		Set<DataChunk> chunks = chunk.getAdjacentChunks(start, off);

		double[] rdata = new double[rsize];
		TRANSDataIterator ritr = new TRANSDataIterator(rdata, start,off);
		
		p.open();
		for (DataChunk c : chunks) {
			System.out.println(c);
			double[] data = p.read(c);
			int[] nstart = new int[start.length];
			int[] noff = new int[start.length];

			int[] cstart = c.getStart();
			int[] coff = c.getChunkSize();
			TRANSDataIterator citr = new TRANSDataIterator(data,cstart,coff);
			ritr.init(cstart, coff);
			citr.init(start, off);
			while(citr.next()&&ritr.next())
			{
				ritr.set(citr.get());
			}
			
			for (int i = 0; i < start.length; i++) {
				nstart[i] = start[i] > cstart[i] ? start[i] : cstart[i];
				noff[i] = start[i] + off[i] < cstart[i] + coff[i] ? start[i]
						+ off[i] : cstart[i] + coff[i];
				noff[i] -= nstart[i];
			}
			try {
				readFromMem(nstart, noff, c.getChunkSize(), off, data,
						c.getStart(), rdata, start);
			} catch (Exception e) {
				System.out.print("Exception");

			}

		}

		return new OptimusData(rdata, starts, offs, offs);

	}