Changeset 868

Show
Ignore:
Timestamp:
01/29/08 12:48:55
Author:
robert
Message:

Added default ability, in vpbmaster, to use all local cores when no machine pool is otherwise defined.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/vpb/MachinePool

    r829 r868  
    184184        Machine* getMachine(const std::string& hostname); 
    185185         
     186        unsigned int getNumMachines() const { return _machines.size(); } 
     187         
    186188        void startThreads(); 
    187189 
     
    207209 
    208210        bool write(const std::string& filename) const; 
     211         
     212        bool setUpOnLocalHost(); 
    209213 
    210214        /** Send a signal to the all running tasks. */ 
  • trunk/include/vpb/System

    r816 r868  
    3434extern VPB_EXPORT std::string& getTaskDirectory(); 
    3535extern VPB_EXPORT std::string& getMachineFileName(); 
     36extern VPB_EXPORT std::string& getCacheFileName(); 
    3637 
    3738inline bool getAttributeValue(const std::string& field, const std::string& name, std::string& value) 
  • trunk/src/vpb/MachinePool.cpp

    r864 r868  
    678678} 
    679679 
     680bool MachinePool::setUpOnLocalHost() 
     681{ 
     682    log(osg::NOTICE,"Setting up MachinePool to use all %i cores on this machine.",OpenThreads::GetNumberOfProcessors()); 
     683    addMachine(vpb::getLocalHostName(),vpb::getCacheFileName(),std::string(),std::string(),OpenThreads::GetNumberOfProcessors()); 
     684} 
     685 
    680686void MachinePool::removeAllOperations() 
    681687{ 
  • trunk/src/vpb/System.cpp

    r831 r868  
    4848std::string& vpb::getTaskDirectory() { return System::instance()->getTaskDirectory(); } 
    4949std::string& vpb::getMachineFileName() { return System::instance()->getMachineFileName(); } 
     50std::string& vpb::getCacheFileName() { return System::instance()->getCacheFileName(); } 
    5051 
    5152/////////////////////////////////////////////////////////////////////////////////////////////////// 
     
    170171MachinePool* System::getMachinePool() 
    171172{ 
    172     if (!_machinePool && !_machineFileName.empty()
     173    if (!_machinePool
    173174    { 
    174175        _machinePool = new MachinePool; 
    175         _machinePool->read(_machineFileName); 
     176         
     177        if (!_machineFileName.empty()) 
     178        { 
     179            _machinePool->read(_machineFileName); 
     180        } 
     181         
     182        if (_machinePool->getNumMachines()==0) 
     183        { 
     184            _machinePool->setUpOnLocalHost(); 
     185        } 
    176186    } 
    177187     
  • trunk/src/vpb/TaskManager.cpp

    r854 r868  
    126126    } 
    127127     
    128  
    129128    while (arguments.read("--modified")) 
    130129    {