00001 package edu.rice.cs.hpc.data.experiment.extdata; 00002 00003 import java.io.IOException; 00004 00005 /******* 00006 * 00007 * basic implementation of IBaseData 00008 * 00009 */ 00010 public class BaseData extends AbstractBaseData { 00011 00012 public BaseData(String filename, int headerSize, int recordSz) throws IOException 00013 { 00014 super(filename, headerSize, recordSz); 00015 } 00016 00017 /* 00018 * (non-Javadoc) 00019 * @see edu.rice.cs.hpc.data.experiment.extdata.IBaseData#getListOfRanks() 00020 */ 00021 public String[] getListOfRanks() { 00022 return baseDataFile.getRankLabels(); 00023 } 00024 00025 /* 00026 * (non-Javadoc) 00027 * @see edu.rice.cs.hpc.data.experiment.extdata.IBaseData#getNumberOfRanks() 00028 */ 00029 public int getNumberOfRanks() { 00030 return baseDataFile.getNumberOfRanks(); 00031 } 00032 00033 00034 @Override 00035 public long getMinLoc(int rank) { 00036 final long offsets[] = baseDataFile.getOffsets(); 00037 return offsets[rank] + headerSize; 00038 } 00039 00040 @Override 00041 public long getMaxLoc(int rank, int recordSize) { 00042 final long offsets[] = baseDataFile.getOffsets(); 00043 long maxloc = ( (rank+1<baseDataFile.getNumberOfRanks())? 00044 offsets[rank+1] : baseDataFile.getMasterBuffer().size()-1 ) 00045 - recordSize; 00046 return maxloc; 00047 } 00048 00049 @Override 00050 public int getFirstIncluded() { 00051 return 0; 00052 } 00053 00054 @Override 00055 public int getLastIncluded() { 00056 return baseDataFile.getNumberOfRanks()-1; 00057 } 00058 00059 @Override 00060 public boolean isDenseBetweenFirstAndLast() { 00061 return true;//No filtering 00062 } 00063 00064 00065 }