1 // Copyright (C) 2012-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
21 #include "YACSEvalResource.hxx"
23 #include "DeploymentTree.hxx"
24 #include "Container.hxx"
25 #include "Exception.hxx"
27 #include "SalomeContainer.hxx"
28 #include "SalomeHPContainer.hxx"
29 #include "ComponentInstance.hxx"
31 #include "ResourcesManager.hxx"
39 const char YACSEvalVirtualYACSContainer::CONTAINER_NAME_KEY[]="container_name";
41 const char YACSEvalVirtualYACSContainer::CPU_CLOCK_KEY[]="cpu_clock";
43 const char YACSEvalVirtualYACSContainer::HOSTNAME_KEY[]="hostname";
45 const char YACSEvalVirtualYACSContainer::MEM_KEY[]="mem_mb";
47 const char YACSEvalVirtualYACSContainer::NB_NODE_KEY[]="nb_node";
49 const char YACSEvalVirtualYACSContainer::NB_PROC_PER_NODE_KEY[]="nb_proc_per_node";
51 const char YACSEvalVirtualYACSContainer::NB_RESOURCE_PROCS_KEY[]="nb_resource_procs";
53 const char YACSEvalVirtualYACSContainer::POLICY_KEY[]="policy";
55 const char YACSEvalVirtualYACSContainer::OS_KEY[]="OS";
58 * This class is here only to avoid "friend class YACSEvalListOfResources".
60 class YACSEvalResourceEff : public YACSEvalResource
63 YACSEvalResourceEff(YACSEvalListOfResources *gf, const std::vector< YACS::ENGINE::Container * >& conts);
66 YACSEvalResourceEff::YACSEvalResourceEff(YACSEvalListOfResources *gf, const std::vector< YACS::ENGINE::Container * >& conts):YACSEvalResource(gf,conts)
70 void YACSEvalNonConstLocker::checkNonLocked() const
73 throw YACS::Exception("YACSEvalNonConstLocker::checkNonLocked : this is locked and trying to invoke non-const method !");
76 YACSEvalVirtualYACSContainer::YACSEvalVirtualYACSContainer():_gf(0),_cont(0)
80 void YACSEvalVirtualYACSContainer::set(YACSEvalResource *gf, YACS::ENGINE::Container *cont)
91 _propertyMap=listOfPropertiesInYACSContainer();
94 YACSEvalVirtualYACSContainer::YACSEvalVirtualYACSContainer(YACSEvalResource *gf, YACS::ENGINE::Container *cont):_gf(gf),_cont(cont)
98 _propertyMap=listOfPropertiesInYACSContainer();
101 YACSEvalVirtualYACSContainer::~YACSEvalVirtualYACSContainer()
108 * \param [in,out] entry - Resource type instance to be updated with \a this.
110 void YACSEvalVirtualYACSContainer::aggregate(ParserResourcesType& entry) const
112 if(entry.HostName.empty())
113 entry.HostName=getHostName();
114 entry.DataForSort._memInMB=std::max(entry.DataForSort._memInMB,getMem());
115 entry.DataForSort._nbOfProcPerNode=std::max(entry.DataForSort._nbOfProcPerNode,getNbProcPerNode());
116 entry.DataForSort._nbOfNodes=std::max(entry.DataForSort._nbOfNodes,getNbNodes());
117 entry.DataForSort._CPUFreqMHz=std::max(entry.DataForSort._CPUFreqMHz,getCPUFreq());
118 std::vector<YACS::ENGINE::ComponentInstance *> comps(_gf->getGodFather()->getDeploymentTree()->getComponentsLinkedToContainer(_cont));
119 std::set<std::string> compNames;
120 for(std::vector<YACS::ENGINE::ComponentInstance *>::const_iterator it=comps.begin();it!=comps.end();it++)
122 YACS::ENGINE::ComponentInstance *elt(*it);
124 compNames.insert(elt->getCompoName());
126 compNames.insert(entry.ComponentsList.begin(),entry.ComponentsList.end());
127 compNames.erase(std::string());
128 std::vector<std::string> compNames2(compNames.begin(),compNames.end());
129 entry.ComponentsList=compNames2;
132 std::string YACSEvalVirtualYACSContainer::findDefault(bool isInteractive) const
134 std::vector<std::string> possibleHosts(_gf->getAllFittingMachines());
135 for(std::vector<std::string>::const_iterator it=possibleHosts.begin();it!=possibleHosts.end();it++)
137 if(_gf->getGodFather()->hasRightInteractiveStatus(*it,isInteractive))
140 throw YACS::Exception("YACSEvalVirtualYACSContainer::findDefault : impossible to find a right machine with requested interactive status !");
143 void YACSEvalVirtualYACSContainer::setWantedMachine(const std::string& machine)
146 std::vector<std::string> possibleHosts(_gf->getAllFittingMachines());
147 if(std::find(possibleHosts.begin(),possibleHosts.end(),machine)==possibleHosts.end())
148 throw YACS::Exception("YACSEvalVirtualYACSContainer::setWantedMachine : the specified machine is not in the list of available !");
149 std::string oldMachine(getChosenMachine());
150 setMachineNoCheck(machine);
153 _gf->notifyWantedMachine(this,oldMachine,machine);
155 catch(YACS::Exception& e)
157 setMachineNoCheck(oldMachine);
162 std::vector<std::string> YACSEvalVirtualYACSContainer::listOfPropertyKeys() const
164 std::set<std::string> s;
165 std::map<std::string,std::string>::const_iterator it;
166 for(it=_overloadedPropertyMap.begin();it!=_overloadedPropertyMap.end();it++)
167 s.insert((*it).first);
168 for(it=_propertyMap.begin();it!=_propertyMap.end();it++)
169 s.insert((*it).first);
170 std::vector<std::string> ret(s.begin(),s.end());
174 std::string YACSEvalVirtualYACSContainer::getValueOfKey(const char *key) const
176 std::map<std::string,std::string>::const_iterator it;
177 it=_overloadedPropertyMap.find(key);
178 if(it!=_overloadedPropertyMap.end())
180 it=_propertyMap.find(key);
181 if(it!=_propertyMap.end())
183 return std::string();
186 void YACSEvalVirtualYACSContainer::setProperty(const std::string& key, const std::string &value)
189 _overloadedPropertyMap[key]=value;
192 void YACSEvalVirtualYACSContainer::apply()
194 YACS::ENGINE::SalomeContainer *cont0(dynamic_cast<YACS::ENGINE::SalomeContainer *>(_cont));
195 YACS::ENGINE::SalomeHPContainer *cont1(dynamic_cast<YACS::ENGINE::SalomeHPContainer *>(_cont));
198 cont0->setProperty(HOSTNAME_KEY,getValueOfKey(HOSTNAME_KEY));
203 cont1->setProperty(HOSTNAME_KEY,getValueOfKey(HOSTNAME_KEY));
207 throw YACS::Exception("YACSEvalVirtualYACSContainer::apply : unrecognized container !");
210 std::string YACSEvalVirtualYACSContainer::getName() const
212 checkNotNullYACSContainer();
213 return _cont->getName();
216 unsigned int YACSEvalVirtualYACSContainer::getValueOfKeyUInt(const char *key) const
218 std::string v(getValueOfKey(key));
222 std::istringstream iss(v);
227 std::map<std::string,std::string> YACSEvalVirtualYACSContainer::listOfPropertiesInYACSContainer() const
229 YACS::ENGINE::SalomeContainer *cont0(dynamic_cast<YACS::ENGINE::SalomeContainer *>(_cont));
230 YACS::ENGINE::SalomeHPContainer *cont1(dynamic_cast<YACS::ENGINE::SalomeHPContainer *>(_cont));
231 std::map<std::string,std::string> props;
233 props=cont0->getProperties();
235 props=cont1->getProperties();
239 void YACSEvalVirtualYACSContainer::checkNotNullYACSContainer() const
242 throw YACS::Exception("YACSEvalVirtualYACSContainer::checkNotNullYACSContainer : internal YACS container is NULL !");
245 YACSEvalResource::~YACSEvalResource()
249 std::vector<std::string> YACSEvalResource::getAllChosenMachines() const
251 std::set<std::string> s;
252 for(std::vector< YACSEvalVirtualYACSContainer >::const_iterator it=_containers.begin();it!=_containers.end();it++)
253 s.insert((*it).getChosenMachine());
254 std::vector<std::string> ret(s.begin(),s.end());
258 std::vector<std::string> YACSEvalResource::getAllFittingMachines() const
260 ParserResourcesType ref;
262 return _gf->getFittingResources(&ref);
265 void YACSEvalResource::setWantedMachine(const std::string& machine)
268 std::vector<std::string> possibleHosts(getAllFittingMachines());
269 if(std::find(possibleHosts.begin(),possibleHosts.end(),machine)==possibleHosts.end())
270 throw YACS::Exception("YACSEvalResource::setWantedMachine : the specified machine is not in the list of available !");
271 for(std::vector< YACSEvalVirtualYACSContainer >::iterator it=_containers.begin();it!=_containers.end();it++)
272 (*it).setMachineNoCheck(machine);
275 YACSEvalVirtualYACSContainer *YACSEvalResource::at(std::size_t i) const
277 if(i>=_containers.size())
278 throw YACS::Exception("YACSEvalResource::at : invalid input ! must be < size !");
279 return const_cast<YACSEvalVirtualYACSContainer *>(&_containers[i]);
282 void YACSEvalResource::apply()
284 for(std::vector< YACSEvalVirtualYACSContainer >::iterator it=_containers.begin();it!=_containers.end();it++)
288 void YACSEvalResource::fitWithCurrentCatalogAbs()
290 std::vector<std::string> ress(getAllFittingMachines());
292 throw YACS::Exception("YACSEvalResource::fitWithCurrentCatalogAbs : no suitable host in your catalog of resource !");
293 setMachineNoCheck(ress.front());
296 void YACSEvalResource::aggregate(ParserResourcesType& entry) const
298 for(std::vector< YACSEvalVirtualYACSContainer >::const_iterator it=_containers.begin();it!=_containers.end();it++)
299 (*it).aggregate(entry);
302 void YACSEvalResource::notifyWantedMachine(YACSEvalVirtualYACSContainer *sender, const std::string& oldMachine, const std::string& newMachine)
304 _gf->notifyWantedMachine(sender,oldMachine,newMachine);
307 void YACSEvalResource::setMachineNoCheck(const std::string& machine)
309 for(std::vector< YACSEvalVirtualYACSContainer >::iterator it=_containers.begin();it!=_containers.end();it++)
310 (*it).setMachineNoCheck(machine);
313 YACSEvalResource::YACSEvalResource(YACSEvalListOfResources *gf, const std::vector< YACS::ENGINE::Container * >& conts):_gf(gf)
315 std::size_t sz(conts.size());
316 _containers.resize(sz);
317 for(std::size_t i=0;i<sz;i++)
318 _containers[i].set(this,conts[i]);
321 YACSEvalListOfResources::YACSEvalListOfResources(int maxLevOfPara, ResourcesManager_cpp *rm, const YACS::ENGINE::DeploymentTree& dt):_maxLevOfPara(maxLevOfPara),_rm(rm),_dt(new YACS::ENGINE::DeploymentTree(dt))
323 std::vector<YACS::ENGINE::Container *> conts(_dt->getAllContainers());
324 std::map<std::string, std::vector<YACS::ENGINE::Container *> > listOfHosts;
325 for(std::vector<YACS::ENGINE::Container *>::const_iterator it=conts.begin();it!=conts.end();it++)
327 std::vector<YACS::ENGINE::ComponentInstance *> cis(dt.getComponentsLinkedToContainer(*it));
328 YACS::ENGINE::SalomeContainer *c1(dynamic_cast<YACS::ENGINE::SalomeContainer *>(*it));
329 YACS::ENGINE::SalomeHPContainer *c2(dynamic_cast<YACS::ENGINE::SalomeHPContainer *>(*it));
332 zeHost=c1->getProperty(YACSEvalVirtualYACSContainer::HOSTNAME_KEY);
334 zeHost=c2->getProperty(YACSEvalVirtualYACSContainer::HOSTNAME_KEY);
335 listOfHosts[zeHost].push_back(*it);
337 for(std::map<std::string, std::vector<YACS::ENGINE::Container *> >::const_iterator it=listOfHosts.begin();it!=listOfHosts.end();it++)
338 _resources.push_back(new YACSEvalResourceEff(this,(*it).second));
339 fitWithCurrentCatalog();
342 std::vector<std::string> YACSEvalListOfResources::getAllChosenMachines() const
344 std::set<std::string> s;
345 for(std::vector<YACSEvalResource *>::const_iterator it=_resources.begin();it!=_resources.end();it++)
347 std::vector<std::string> tmp((*it)->getAllChosenMachines());
348 s.insert(tmp.begin(),tmp.end());
350 std::vector<std::string> ret(s.begin(),s.end());
354 std::vector<std::string> YACSEvalListOfResources::getAllFittingMachines() const
356 ParserResourcesType ref;
357 for(std::vector<YACSEvalResource *>::const_iterator it=_resources.begin();it!=_resources.end();it++)
358 (*it)->aggregate(ref);
359 return getFittingResources(&ref);
362 void YACSEvalListOfResources::setWantedMachine(const std::string& machine)
365 std::vector<std::string> possibleHosts(getAllFittingMachines());
366 if(std::find(possibleHosts.begin(),possibleHosts.end(),machine)==possibleHosts.end())
367 throw YACS::Exception("YACSEvalResource::setWantedMachine : the specified machine is not in the list of available !");
368 for(std::vector<YACSEvalResource *>::iterator it=_resources.begin();it!=_resources.end();it++)
369 (*it)->setMachineNoCheck(machine);
372 YACSEvalResource *YACSEvalListOfResources::at(std::size_t i) const
375 throw YACS::Exception("YACSEvalListOfResources::at : invalid id !");
376 return _resources[i];
379 bool YACSEvalListOfResources::isInteractive() const
381 const MapOfParserResourcesType& zeList(_rm->GetList());
382 std::vector<std::string> allMachines(getAllChosenMachines());
383 if(allMachines.empty())
385 std::size_t ii(0),sz(allMachines.size());
386 std::vector<bool> status(sz);
387 for(std::vector<std::string>::const_iterator it=allMachines.begin();it!=allMachines.end();it++,ii++)
389 std::map<std::string, ParserResourcesType>::const_iterator it2(zeList.find(*it));
390 if(it2==zeList.end())
392 std::ostringstream oss; oss << "YACSEvalListOfResources::isInteractive : presence of non existing \"" << *it << "\" !";
393 throw YACS::Exception(oss.str());
395 const ParserResourcesType& elt((*it2).second);
396 status[ii]=(elt.Batch==none);
398 std::size_t trueRet(std::count(status.begin(),status.end(),true)),falseRet(std::count(status.begin(),status.end(),false));
399 if(trueRet==sz && falseRet==0)
401 else if(trueRet==0 && falseRet==sz)
403 throw YACS::Exception("YACSEvalListOfResources::isInteractive : mix of interactive and non interactive ! internal error !");
406 unsigned int YACSEvalListOfResources::getNumberOfProcsDeclared() const
408 std::vector<std::string> chosen(getAllChosenMachines());
410 for(std::vector<std::string>::const_iterator it=chosen.begin();it!=chosen.end();it++)
411 ret+=getNumberOfProcOfResource(*it);
415 void YACSEvalListOfResources::apply()
417 for(std::vector<YACSEvalResource *>::iterator it=_resources.begin();it!=_resources.end();it++)
421 YACSEvalListOfResources::~YACSEvalListOfResources()
424 for(std::vector<YACSEvalResource *>::iterator it=_resources.begin();it!=_resources.end();it++)
428 class EffectiveComparator
431 virtual ~EffectiveComparator() { }
432 virtual EffectiveComparator *copy() const = 0;
433 virtual bool compare(const ResourceDataToSort& elt1, const ResourceDataToSort& elt2) const = 0;
436 // comparator for a null request in scheme
437 class BasicComparator : public EffectiveComparator
440 EffectiveComparator *copy() const { return new BasicComparator; }
441 bool compare(const ResourceDataToSort& elt1, const ResourceDataToSort& elt2) const;
444 class MemAwareComparator : public EffectiveComparator
447 EffectiveComparator *copy() const { return new MemAwareComparator; }
448 bool compare(const ResourceDataToSort& elt1, const ResourceDataToSort& elt2) const;
451 class CompromiseComparator : public EffectiveComparator
454 CompromiseComparator(int memMB, int nbProcs):_memMB(memMB),_nbProcs(nbProcs) { }
455 EffectiveComparator *copy() const { return new CompromiseComparator(_memMB,_nbProcs); }
456 bool compare(const ResourceDataToSort& elt1, const ResourceDataToSort& elt2) const;
465 CompareRes(const ParserResourcesType *request, const MapOfParserResourcesType& zeCatalog);
466 CompareRes(const CompareRes& other);
467 bool operator()(const std::string& res1, const std::string& res2);
468 ~CompareRes() { delete _comp; }
470 EffectiveComparator *_comp;
471 const ParserResourcesType *_request;
472 const MapOfParserResourcesType& _zeCatalog;
475 bool BasicComparator::compare(const ResourceDataToSort& elt1, const ResourceDataToSort& elt2) const
477 int nbOfProcs1(elt1._nbOfNodes*elt1._nbOfProcPerNode),nbOfProcs2(elt2._nbOfNodes*elt2._nbOfProcPerNode);
478 return nbOfProcs1<nbOfProcs2;
481 bool MemAwareComparator::compare(const ResourceDataToSort& elt1, const ResourceDataToSort& elt2) const
483 return elt1._memInMB<elt2._memInMB;
486 bool CompromiseComparator::compare(const ResourceDataToSort& elt1, const ResourceDataToSort& elt2) const
488 double v1a(elt1._memInMB/_memMB),v1b(elt1._nbOfNodes*elt1._nbOfProcPerNode/_nbProcs);
489 double v2a(elt2._memInMB/_memMB),v2b(elt2._nbOfNodes*elt2._nbOfProcPerNode/_nbProcs);
490 return std::min(v1a,v1b)<std::min(v2a,v2b);
493 CompareRes::CompareRes(const ParserResourcesType *request, const MapOfParserResourcesType& zeCatalog):_comp(0),_request(request),_zeCatalog(zeCatalog)
495 const ResourceDataToSort& tmp(_request->DataForSort);
496 // all request items are set to default -> Basic comparison on procs
497 if(request->DataForSort._nbOfNodes==1 && request->DataForSort._nbOfProcPerNode==1 && request->DataForSort._memInMB==0)
498 _comp=new BasicComparator;
499 // all items are set to default except memory -> Memory aware only
500 else if(request->DataForSort._memInMB!=0 && request->DataForSort._nbOfNodes==1 && request->DataForSort._nbOfProcPerNode==1)
501 _comp=new MemAwareComparator;
502 // memory and procs are set by the user -> do the best possible.
503 else if(request->DataForSort._memInMB!=0 && ( request->DataForSort._nbOfNodes!=1 || request->DataForSort._nbOfProcPerNode!=1 ) )
504 _comp=new CompromiseComparator(request->DataForSort._memInMB,request->DataForSort._nbOfNodes*request->DataForSort._nbOfProcPerNode);
506 _comp=new BasicComparator;
509 CompareRes::CompareRes(const CompareRes& other):_comp(other._comp->copy()),_request(other._request),_zeCatalog(other._zeCatalog)
513 bool CompareRes::operator()(const std::string& res1, const std::string& res2)
515 std::map<std::string, ParserResourcesType>::const_iterator it1(_zeCatalog.find(res1)),it2(_zeCatalog.find(res2));
516 if(it1==_zeCatalog.end() || it2==_zeCatalog.end())
517 throw YACS::Exception("Internal error during comparison !");
518 const ParserResourcesType& elt1((*it1).second);
519 const ParserResourcesType& elt2((*it2).second);
520 return _comp->compare(elt1.DataForSort,elt2.DataForSort);
524 * Implements an another alg than those proposed by default in ResourcesManager_cpp in "ResourcesManager.hxx".
526 std::vector<std::string> YACSEvalListOfResources::getFittingResources(ParserResourcesType *request) const
528 int mlop(getMaxLevelOfParallelism());
529 request->DataForSort._memInMB*=mlop;
530 request->DataForSort._nbOfNodes*=mlop;
532 const MapOfParserResourcesType& zeListInCatalog(_rm->GetList());
533 std::vector<std::string> list0;
534 // first keep those having relevant components
535 const std::vector<std::string>& listExpected(request->ComponentsList);
536 std::set<std::string> listExpected2(listExpected.begin(),listExpected.end());
537 for(std::map<std::string, ParserResourcesType>::const_iterator it=zeListInCatalog.begin();it!=zeListInCatalog.end();it++)
539 const std::vector<std::string>& compoList((*it).second.ComponentsList);
540 std::set<std::string> s1(compoList.begin(),compoList.end());
541 std::vector<std::string> diff;
542 std::set_difference(listExpected2.begin(),listExpected2.end(),s1.begin(),s1.end(),std::inserter(diff,diff.begin()));
544 list0.push_back((*it).first);
546 // sort list0 regarding request
547 std::sort(list0.begin(),list0.end(),CompareRes(request,zeListInCatalog));
548 // if HostName in request is defined and in list0 put it first.
549 std::string tmp(request->HostName);
552 std::vector<std::string>::iterator it1(std::find(list0.begin(),list0.end(),tmp));
554 {// HostName in list0 so put it in first place.
556 list0.insert(list0.begin(),tmp);
562 void YACSEvalListOfResources::notifyWantedMachine(YACSEvalVirtualYACSContainer *sender, const std::string& oldMachine, const std::string& newMachine)
564 const MapOfParserResourcesType& zeList(_rm->GetList());
565 std::map<std::string, ParserResourcesType>::const_iterator itOld(zeList.find(oldMachine)),itNew(zeList.find(newMachine));
566 if(itOld==zeList.end() || itNew==zeList.end())
567 throw YACS::Exception("YACSEvalListOfResources::notifyWantedMachine : internal error !");
568 const ParserResourcesType& oldPRT((*itOld).second);
569 const ParserResourcesType& newPRT((*itNew).second);
570 if(oldPRT.ClusterInternalProtocol==newPRT.ClusterInternalProtocol)
572 // the batch/interactive mode has changed -> try to change for all.
573 std::queue<std::string> sts;
576 for(std::vector<YACSEvalResource *>::const_iterator it=_resources.begin();it!=_resources.end();it++)
578 std::size_t sz((*it)->size());
579 for(std::size_t i=0;i<sz;i++)
581 YACSEvalVirtualYACSContainer *cont((*it)->at(i));
584 sts.push(cont->findDefault(newPRT.ClusterInternalProtocol==sh));
588 catch(YACS::Exception& e)
590 std::ostringstream oss; oss << "YACSEvalListOfResources::notifyWantedMachine : switching from interactive/batch must be global ! " << e.what();
591 throw YACS::Exception(oss.str());
593 for(std::vector<YACSEvalResource *>::const_iterator it=_resources.begin();it!=_resources.end();it++)
595 std::size_t sz((*it)->size());
596 for(std::size_t i=0;i<sz;i++)
598 YACSEvalVirtualYACSContainer *cont((*it)->at(i));
601 cont->setMachineNoCheck(sts.front());
607 bool YACSEvalListOfResources::hasRightInteractiveStatus(const std::string& machineToTest, bool isInteractive) const
609 const MapOfParserResourcesType& zeList(_rm->GetList());
610 std::map<std::string, ParserResourcesType>::const_iterator it(zeList.find(machineToTest));
612 throw YACS::Exception("YACSEvalListOfResources::hasRightInteractiveStatus : internal error !");
613 const ParserResourcesType& elt((*it).second);
614 bool myStatus(elt.ClusterInternalProtocol==sh);
615 return myStatus==isInteractive;
618 void YACSEvalListOfResources::fitWithCurrentCatalog()
620 std::vector<std::string> ress(getAllFittingMachines());
622 throw YACS::Exception("YACSEvalListOfResources::fitWithCurrentCatalog : no available resource in your catalog !");
623 for(std::vector<YACSEvalResource *>::iterator it=_resources.begin();it!=_resources.end();it++)
624 (*it)->setMachineNoCheck(ress.front());
627 unsigned int YACSEvalListOfResources::getNumberOfProcOfResource(const std::string& machine) const
629 const MapOfParserResourcesType& zeList(_rm->GetList());
630 std::map<std::string, ParserResourcesType>::const_iterator it(zeList.find(machine));
632 throw YACS::Exception("YACSEvalListOfResources::getNumberOfProcOfResource : internal error !");
633 const ParserResourcesType& PRT((*it).second);
634 const ResourceDataToSort& RDT(PRT.DataForSort);
635 unsigned int ret(RDT._nbOfNodes*RDT._nbOfProcPerNode);