本文整理汇总了C++中JobQueue::IsFinished方法的典型用法代码示例。如果您正苦于以下问题:C++ JobQueue::IsFinished方法的具体用法?C++ JobQueue::IsFinished怎么用?C++ JobQueue::IsFinished使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JobQueue
的用法示例。
在下文中一共展示了JobQueue::IsFinished方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
// arguments
cout << "SimWare v1.0" << endl;
for(int i = 0; i < argc; i++)
cout << argv[i] << " ";
cout << endl;
if(ParsingArguments(argc, argv)==false)
return 1;
#ifdef SINGLE_PRECISION
cout << "+ Single Precision: only for debugging" << endl;
#else
cout << "+ Double Precision" << endl;
#endif
#ifdef NO_DEP_CHECK
cout << "+ Not checking job dependency" << endl;
#endif
// current working directory
char cCurrentPath[FILENAME_MAX];
if (!GetCurrentDir(cCurrentPath, sizeof(cCurrentPath))) ; // yes. intended.
cout << "+ Working Directory: " << cCurrentPath << endl;
// Reading File
bool isReadingFinished = false;
ifstream ifs(argv[1]);
if(!ifs.is_open()) {
cout << "Cannot open a file :" << argv[1] << endl;
return 1;
}
vector<SWFLine*> vSWF;
isReadingFinished = ReadMoreLines(&ifs, &vSWF);
if (isReadingFinished)
ifs.clear();
// Create & run
cout << endl << "Simulating";
JobQueue myJobQueue;
Users myUsers(&myJobQueue, &vSWF);
DataCenter myDataCenter(&myJobQueue);
int myClock = 0;
int wallClock = 0;
while (!(myJobQueue.IsFinished() && myDataCenter.IsFinished() && myUsers.IsFinished())) {
myUsers.EveryASecond();
myDataCenter.EveryASecond();
myClock++;
wallClock++;
if (myClock>(PERIODIC_LOG_INTERVAL<<2)) {
myClock = 0;
cout << "."; // showing progress
fflush(stdout);
}
if (isReadingFinished == false && vSWF.size() < SWF_BUFFER_MIN_LINES)
isReadingFinished = ReadMoreLines(&ifs, &vSWF);
}
cout << "finished" << endl << endl;
myDataCenter.PrintResults(); // Temperature, Power draw
myJobQueue.PrintResults(wallClock); // Latency
return 0;
}