X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fevalyfx%2FYACSEvalResource.cxx;h=92b8b20d132c61bd3c98ad8d2e7d22283fdd98b2;hb=255150e4eec79294bbd06c7c464f309b4a264960;hp=b15c6a55812f6ccd94debea9fa82855831bb2081;hpb=1eb8ef53bd1123b18002f3ad1ac50038003ac9f3;p=modules%2Fyacs.git diff --git a/src/evalyfx/YACSEvalResource.cxx b/src/evalyfx/YACSEvalResource.cxx index b15c6a558..92b8b20d1 100644 --- a/src/evalyfx/YACSEvalResource.cxx +++ b/src/evalyfx/YACSEvalResource.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2012-2016 CEA/DEN, EDF R&D +// Copyright (C) 2012-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -337,6 +337,8 @@ void YACSEvalParamsForCluster::checkConsistency() const { if(_remoteWorkingDir.empty()) throw YACS::Exception("YACSEvalParamsForCluster::checkConsistency : remote work dir is not set !"); + if(_localWorkingDir.empty()) + throw YACS::Exception("YACSEvalParamsForCluster::checkConsistency : local work dir is not set !"); if(_wcKey.empty()) throw YACS::Exception("YACSEvalParamsForCluster::checkConsistency : WC key is not set !"); if(_nbOfProcs==0) @@ -403,7 +405,6 @@ YACSEvalResource *YACSEvalListOfResources::at(std::size_t i) const bool YACSEvalListOfResources::isInteractive() const { - const MapOfParserResourcesType& zeList(_rm->GetList()); std::vector allMachines(getAllChosenMachines()); if(allMachines.empty()) return true; @@ -411,14 +412,7 @@ bool YACSEvalListOfResources::isInteractive() const std::vector status(sz); for(std::vector::const_iterator it=allMachines.begin();it!=allMachines.end();it++,ii++) { - std::map::const_iterator it2(zeList.find(*it)); - if(it2==zeList.end()) - { - std::ostringstream oss; oss << "YACSEvalListOfResources::isInteractive : presence of non existing \"" << *it << "\" !"; - throw YACS::Exception(oss.str()); - } - const ParserResourcesType& elt((*it2).second); - status[ii]=(elt.Batch==none); + status[ii]=isMachineInteractive(*it); } std::size_t trueRet(std::count(status.begin(),status.end(),true)),falseRet(std::count(status.begin(),status.end(),false)); if(trueRet==sz && falseRet==0) @@ -462,6 +456,19 @@ YACSEvalListOfResources::~YACSEvalListOfResources() delete *it; } +bool YACSEvalListOfResources::isMachineInteractive(const std::string& machine) const +{ + const MapOfParserResourcesType& zeList(_rm->GetList()); + std::map::const_iterator it2(zeList.find(machine)); + if(it2==zeList.end()) + { + std::ostringstream oss; oss << "YACSEvalListOfResources::isMachineInteractive : no such machine with name \"" << machine << "\" !"; + throw YACS::Exception(oss.str()); + } + const ParserResourcesType& elt((*it2).second); + return (elt.Batch==none); +} + class EffectiveComparator { public: