int main(int argc, char *argv[]) /* Process command line. */ { optionInit(&argc, argv, options); if (argc != 3) usage(); chainIndex(argv[1], argv[2]); return 0; }
void ChainArray::flushToDisk(uint id) { uint diskLength = lengthOnDisk_[id]; uint cacheLength = cache_[id].size(); // for t=1 chains only (cold) chains only if (chainIndex(id) == 0) { uint newLength = diskLength + cacheLength; VLOG(3) << "Flushing cache of chain " << id << ". new length on disk: " << newLength; std::vector<State> statesToBeSaved(std::begin(cache_[id]), std::end(cache_[id])); writer_.append(id / numChains(), statesToBeSaved); lengthOnDisk_[id] = newLength; } // Re-initialise the cache if (!cache_[id].empty()) { lastState_[id] = cache_[id].back(); cache_[id].clear(); } }
bool ChainArray::isColdestInStack(uint id) const { return chainIndex(id) == 0; }
bool ChainArray::isHottestInStack(uint id) const { return chainIndex(id) == numChains() - 1; }