Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

void Impala::Util::Mpi::JobManager::GetJob ( PropertySet job  )  [inline]

if job contains the properties of the last job, the manager will try to assign it a job from the same group

Definition at line 89 of file JobManager.h.

References Impala::Util::PropertySet::Add(), Impala::Util::Mpi::JobGroup::GetJob(), Impala::Util::PropertySet::GetString(), mGroups, and Impala::Util::Mpi::JobGroup::OpenJobs().

Referenced by Impala::Core::Training::ParameterSearcher::SearchServer().

00090     {
00091         std::string lastgroup = job->GetString("JobManager::group-id");
00092         if(lastgroup != "")
00093         {
00094             mGroups[lastgroup]->JobDone(job);
00095             if(mGroups[lastgroup]->GetJob(job))
00096                 return;
00097         }
00098         //if the previous group is done, or this is the first job, find the group with the least workers
00099         std::map<std::string, JobGroup*>::iterator it = mGroups.begin();
00100         JobGroup* current = it->second;
00101         JobGroup* best = current;
00102         int todo = current->OpenJobs();
00103         while(it!=mGroups.end())
00104         {
00105             current = it->second;
00106             if(current->OpenJobs() > todo)
00107             {
00108                 todo = current->OpenJobs();
00109                 best = current;
00110             }
00111             ++it;
00112         }
00113         if(best->GetJob(job))
00114             return;
00115 
00116         // all groups done, no more jobs to give
00117         job->Add("JobManager::group-id", "");
00118         job->Add("JobManager::job-id", "-1");
00119     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:41:39 2010 for ImpalaSrc by  doxygen 1.5.1