nprocs = _nprocs;
rank = _rank;
masterdefault = 0;
+ jobListInitialized = false;
}
void paraq::addRange(const string& paraid, double min, double max, double step)
return false;
}
-int paraq::nextParas()
+void paraq::initJobList()
{
- if( thisjob == -1 ) {
+ if( ! jobListInitialized ) {
map<string,double> jobZero;
jobList.push_back( jobZero );
-
+
for( map< string, vector< double > >::iterator paraIt = paraMap.begin(); paraIt != paraMap.end(); ++paraIt )
while( jobList.begin()->find(paraIt->first) == jobList.begin()->end() ) {
for( vector<double>::iterator valIt = paraIt->second.begin(); valIt != paraIt->second.end(); ++valIt ) {
}
jobList.erase( jobList.begin() );
}
+ jobListInitialized = true;
+ }
+}
+int paraq::nextParas()
+{
+ if( thisjob == -1 ) {
+ initJobList();
thisjob = rank;
}
else
thisjob += nprocs;
+ if( jobList.begin()->size() == 0 ) return 0;
+
if( thisjob < jobList.size() ) return 1;
else
return 0;
return masterdefault;
}
+
+int paraq::getTotalJobs() {
+ initJobList();
+ return jobList.size();
+}