virtual IData* getNext()
	{
	    if (m_pNext == 0) return 0;

	    RTree::Data* ret = m_pNext;
	    m_pNext = 0;
	    readNextEntry();
	    return ret;
	}
	GEOSDataStream(map<int,Geometry*> * inputColl ) : m_pNext(0), len(0),m_id(0)
    {
	if (inputColl->empty())
	    throw Tools::IllegalArgumentException("Input size is ZERO.");
	shapes = inputColl;
	len = inputColl->size();
	iter = shapes->begin();
	readNextEntry();
    }
	virtual void rewind()
	{
	    if (m_pNext != 0)
	    {
		delete m_pNext;
		m_pNext = 0;
	    }

	    m_id  = 0;
	    iter = shapes->begin();
	    readNextEntry();
	}
示例#4
0
bool TuningDataBase::queryFastestFFTPlanDescriptor(char* hostName, int procCount, int L0, int L1, int L2, int L3, int paraOpMode, int threadPerNodeCount, int xFFT, int useP, int useQ, int useR, int QHM, int xtrSize1, int xtrSize2, int xtrSize3, char* &fftPlanDescriptor) {
  fftPlanDescriptor = new char[10000];
  snprintf(fftPlanDescriptor, 10000, " ");
  double bestTiming = 0;

  FILE* file = fopen(DBFileName, "r");
  if (file == NULL) return false;
  bool avail = false;
  DBEntryType entry;
  
  while (readNextEntry(file, entry)) {
    bool mismatch = false;
    if (!matchHostNames(hostName, entry.hostName)) mismatch = true;
//    if (procCount != entry.procCount) mismatch = true;
    if (L0 != entry.L0) mismatch = true;
    if (L1 != entry.L1) mismatch = true;
    if (L2 != entry.L2) mismatch = true;
    if (L3 != entry.L3) mismatch = true;
    if (paraOpMode != entry.paraOpMode) mismatch = true;
    if (threadPerNodeCount != entry.threadPerNodeCount) mismatch = true;
    if (xFFT != entry.xFFT) mismatch = true;
    if ((useP != entry.useP) && (!QHM)) mismatch = true;
    if ((useQ != entry.useQ) && (!QHM)) mismatch = true;
    if ((useR != entry.useR) && (QHM)) mismatch = true;
    if (QHM != entry.QHM) mismatch = true;
    if (xtrSize1 != entry.xtrSize1) mismatch = true;
    if (xtrSize2 != entry.xtrSize2) mismatch = true;
    if (xtrSize3 != entry.xtrSize3) mismatch = true;
    
    if (!mismatch) {
      double timing = entry.runCount / entry.deltaT;
      if ((!avail) || (timing > bestTiming)) {
        snprintf(fftPlanDescriptor, 10000, "%s", entry.fftPlanDescriptor);
	bestTiming = timing;
      }
    
      avail = true;
    }
  
    freeDBEntry(entry);
  }
    
  freeDBEntry(entry);

  fclose(file);
  return avail;
}
示例#5
0
bool TuningDataBase::queryFastestEmbedding(char* hostName, int procCount, int L0, int L1, int L2, int L3, int paraOpMode, int threadPerNodeCount, int xFFT, int useP, int useQ, int useR, int QHM, int& xtrSize1, int& xtrSize2, int& xtrSize3) {
  xtrSize1 = 0;
  xtrSize2 = 0;
  xtrSize3 = 0;
  double bestTiming = 0;

  FILE* file = fopen(DBFileName, "r");
  if (file == NULL) return false;
  bool avail = false;
  DBEntryType entry;
  
  while (readNextEntry(file, entry)) {
    bool mismatch = false;
    if (!matchHostNames(hostName, entry.hostName)) mismatch = true;
//    if (procCount != entry.procCount) mismatch = true;
    if (L0 != entry.L0) mismatch = true;
    if (L1 != entry.L1) mismatch = true;
    if (L2 != entry.L2) mismatch = true;
    if (L3 != entry.L3) mismatch = true;
    if (paraOpMode != entry.paraOpMode) mismatch = true;
    if (threadPerNodeCount != entry.threadPerNodeCount) mismatch = true;
    if (xFFT != entry.xFFT) mismatch = true;
    if ((useP != entry.useP) && (!QHM)) mismatch = true;
    if ((useQ != entry.useQ) && (!QHM)) mismatch = true;
    if ((useR != entry.useR) && (QHM)) mismatch = true;
    if (QHM != entry.QHM) mismatch = true;
    
    if (!mismatch) {
      double timing = entry.runCount / entry.deltaT;
      if ((!avail) || (timing > bestTiming)) {
        xtrSize1 = entry.xtrSize1;
        xtrSize2 = entry.xtrSize2;
        xtrSize3 = entry.xtrSize3;
	bestTiming = timing;
      }
    
      avail = true;
    }
  
    freeDBEntry(entry);
  }
    
  freeDBEntry(entry);

  fclose(file);
  return avail;
}
示例#6
0
bool TuningDataBase::isDBEntryAvail(char* hostName, int procCount, int L0, int L1, int L2, int L3, int paraOpMode, int threadPerNodeCount, int xFFT, int useP, int useQ, int useR, int QHM, int xtrSize1, int xtrSize2, int xtrSize3) {
  FILE* file = fopen(DBFileName, "r");
  if (file == NULL) return false;
  bool avail = false;
  DBEntryType entry;

  while (readNextEntry(file, entry)) {
    bool mismatch = false;
    if (!matchHostNames(hostName, entry.hostName)) mismatch = true;
    if (procCount != entry.procCount) mismatch = true;
    if (L0 != entry.L0) mismatch = true;
    if (L1 != entry.L1) mismatch = true;
    if (L2 != entry.L2) mismatch = true;
    if (L3 != entry.L3) mismatch = true;
    if (paraOpMode != entry.paraOpMode) mismatch = true;
    if (threadPerNodeCount != entry.threadPerNodeCount) mismatch = true;
    if (xFFT != entry.xFFT) mismatch = true;
    if ((useP != entry.useP) && (!QHM)) mismatch = true;
    if ((useQ != entry.useQ) && (!QHM)) mismatch = true;
    if ((useR != entry.useR) && (QHM)) mismatch = true;
    if (QHM != entry.QHM) mismatch = true;
    if (xtrSize1 != entry.xtrSize1) mismatch = true;
    if (xtrSize2 != entry.xtrSize2) mismatch = true;
    if (xtrSize3 != entry.xtrSize3) mismatch = true;
  
    freeDBEntry(entry);
    if (!mismatch) {
      avail = true;
      break;
    }
  }
    
  if (!avail) freeDBEntry(entry);
  fclose(file);
  return avail;
}
示例#7
0
MyDataStream::MyDataStream(std::vector<SpatialIndex::IData*> &data) : m_pNext(0) {
    m_data = data;
    m_it = m_data.begin();
    readNextEntry();
}