{
ContainerPerfLog declareContainer(in string contInNS, in string logfile);
ListOfContainerPerfLog listOfContainerLogs();
+ SALOME::vectorOfByte getAllStruct();
};
};
cont = f.read()
return cont[self._eff.tracePosStart:self._eff.tracePosStop].decode()
-class ScriptInfo:
+class ScriptInfoAbstract:
def __init__(self, scriptPtr):
self._node_name = scriptPtr.getName()
self._code = scriptPtr.getCode()
def __repr__(self):
return """ScriptInfo \"{self.nodeName}\"""".format(**locals())
+
+class ScriptInfoClt(ScriptInfoAbstract):
+ def __init__(self, scriptPtr):
+ self._node_name = scriptPtr.getName()
+ self._code = scriptPtr.getCode()
+ self._exec = [pickle.loads(elt.getObj()) for elt in scriptPtr.listOfExecs()]
+
+class ScriptInfo(ScriptInfoAbstract):
+ def __init__(self, nodeName, code, execs):
+ self._node_name = nodeName
+ self._code = code
+ self._exec = execs
class ScriptInfoDeco:
def __init__(self, eff, father):
def __repr__(self):
return self._eff.__repr__()
-class ContainerLogInfo:
- def __init__(self,contLogPtr):
- self._log_file = contLogPtr.getLogFile()
- self._ns_entry = contLogPtr.getContainerEntryInNS()
- self._scripts = [ScriptInfo(elt) for elt in contLogPtr.listOfScripts()]
+class ContainerLogInfoAbstract:
def log(self):
with open(self.logfile,"rb") as f:
def __str__(self):
return """NS entry = {self.ns_entry} LogFile = {self.logfile}""".format(**locals())
+
+class ContainerLogInfoClt(ContainerLogInfoAbstract):
+ def __init__(self,contLogPtr):
+ self._log_file = contLogPtr.getLogFile()
+ self._ns_entry = contLogPtr.getContainerEntryInNS()
+ self._scripts = [ScriptInfoClt(elt) for elt in contLogPtr.listOfScripts()]
+
+class ContainerLogInfo(ContainerLogInfoAbstract):
+ def __init__(self, logFile, nsEntry, scripts):
+ self._log_file = logFile
+ self._ns_entry = nsEntry
+ self._scripts = scripts
from abc import ABC, abstractmethod
def LogManagerFetch(self):
import SALOME_ContainerHelper
- return [SALOME_ContainerHelper.ContainerLogInfo(elt) for elt in self.listOfContainerLogs()]
+ return [SALOME_ContainerHelper.ContainerLogInfoClt(elt) for elt in self.listOfContainerLogs()]
#to expose all objects to pydoc
__all__=dir()
return ret;
}
+static SALOME::vectorOfByte *FromVectCharToCorba(const std::vector<char>& data)
+{
+ SALOME::vectorOfByte_var ret = new SALOME::vectorOfByte;
+ auto length = data.size();
+ ret->length(length);
+ for(auto i = 0 ; i < length ; ++i)
+ ret[i] = data[i];
+ return ret._retn();
+}
+
PortableServer::POA_var SALOME_ContainerScriptExecPerfLog::getPOA()
{
return father()->getPOA();
SALOME::vectorOfByte *SALOME_ContainerScriptExecPerfLog::getObj()
{
- SALOME::vectorOfByte_var ret = new SALOME::vectorOfByte;
- auto length = this->_data.size();
- ret->length(length);
- for(auto i = 0 ; i < length ; ++i)
- ret[i] = _data[i];
- return ret._retn();
+ return FromVectCharToCorba(this->_data);
+}
+
+void SALOME_ContainerScriptExecPerfLog::accept(SALOME_VisitorContainerLog &visitor)
+{
+ visitor.visitContainerScriptExecPerfLog( *this );
}
void SALOME_ContainerScriptExecPerfLog::start()
return CORBA::string_dup( _name.c_str() );
}
+void SALOME_ContainerScriptPerfLog::accept(SALOME_VisitorContainerLog &visitor)
+{
+ visitor.enterContainerScriptPerfLog( *this );
+ for(auto session : _sessions)
+ {
+ PortableServer::ServantBase *serv = getPOA()->reference_to_servant( session );
+ serv->_remove_ref();
+ SALOME_ContainerScriptExecPerfLog *servC = dynamic_cast<SALOME_ContainerScriptExecPerfLog *>(serv);
+ visitor.visitContainerScriptExecPerfLog( *servC );
+ }
+ visitor.enterContainerScriptPerfLog( *this );
+}
+
Engines::ContainerScriptExecPerfLog_ptr SALOME_ContainerScriptPerfLog::addExecutionSession()
{
SALOME_ContainerScriptExecPerfLog *execution = new SALOME_ContainerScriptExecPerfLog(this);
return ret._retn();
}
+void SALOME_ContainerPerfLog::accept(SALOME_VisitorContainerLog &visitor)
+{
+ visitor.enterContainerPerfLog( *this );
+ for(auto script : _scripts)
+ {
+ PortableServer::ServantBase *serv = getPOA()->reference_to_servant( script );
+ serv->_remove_ref();
+ SALOME_ContainerScriptPerfLog *servC = dynamic_cast<SALOME_ContainerScriptPerfLog *>(serv);
+ servC->accept(visitor);
+ }
+ visitor.leaveContainerPerfLog( *this );
+}
+
char *SALOME_ContainerPerfLog::getLogFile()
{
return CORBA::string_dup( this->_log_file.c_str() );
}
return ret._retn();
}
+
+void SALOME_LogManager::accept(SALOME_VisitorContainerLog &visitor)
+{
+ visitor.enterLogManager( *this );
+ for(auto container : _containers)
+ {
+ PortableServer::ServantBase *serv = getPOA()->reference_to_servant( container );
+ serv->_remove_ref();
+ SALOME_ContainerPerfLog *servC = dynamic_cast<SALOME_ContainerPerfLog *>(serv);
+ servC->accept(visitor);
+ }
+ visitor.leaveLogManager( *this );
+}
+
+SALOME::vectorOfByte *SALOME_LogManager::getAllStruct()
+{
+ std::vector<char> data = this->dumpCppInternalFrmt();
+ return FromVectCharToCorba(data);
+}
+
+///////////////////////
+
+ #include <cstdint>
+
+static void PushIntInVC(std::uint32_t val, std::vector<char>& data)
+{
+ char *valPtr = reinterpret_cast<char *>(&val);
+ data.insert(data.end(),valPtr,valPtr+sizeof(std::uint32_t));
+}
+
+template<class T>
+static void PushStringInVC(const T& str, std::vector<char>& data)
+{
+ std::uint32_t sz = static_cast<std::uint32_t>( str.size() );
+ PushIntInVC(sz,data);
+ data.insert(data.end(),str.data(),str.data()+sz);
+}
+
+class InternalFormatVisitorDump : public SALOME_VisitorContainerLog
+{
+public:
+ InternalFormatVisitorDump(std::vector<char> *data):_data(data) { }
+ void enterLogManager(SALOME_LogManager& inst) override;
+ void leaveLogManager(SALOME_LogManager& inst) override { }
+ void enterContainerPerfLog(SALOME_ContainerPerfLog& inst) override;
+ void leaveContainerPerfLog(SALOME_ContainerPerfLog& inst) override { }
+ void enterContainerScriptPerfLog(SALOME_ContainerScriptPerfLog& inst) override;
+ void leaveContainerScriptPerfLog(SALOME_ContainerScriptPerfLog& inst) override { }
+ void visitContainerScriptExecPerfLog(SALOME_ContainerScriptExecPerfLog& inst) override;
+private:
+ std::vector<char> *_data = nullptr;
+};
+
+void InternalFormatVisitorDump::visitContainerScriptExecPerfLog(SALOME_ContainerScriptExecPerfLog& inst)
+{
+ PushStringInVC<std::vector<char>>(inst.data(),*_data);
+}
+
+void InternalFormatVisitorDump::enterContainerScriptPerfLog(SALOME_ContainerScriptPerfLog& inst)
+{
+ PushStringInVC<std::string>(inst.name(),*_data);
+ PushStringInVC<std::string>(inst.code(),*_data);
+ PushIntInVC((std::uint32_t)inst.getNumberOfSessions(),*_data);
+}
+
+void InternalFormatVisitorDump::enterContainerPerfLog(SALOME_ContainerPerfLog& inst)
+{
+ PushStringInVC<std::string>(inst.nameInNS(),*_data);
+ PushStringInVC<std::string>(inst.logFile(),*_data);
+ PushIntInVC((std::uint32_t)inst.getNumberOfScripts(),*_data);
+}
+
+void InternalFormatVisitorDump::enterLogManager(SALOME_LogManager& inst)
+{
+ PushIntInVC((std::uint32_t)inst.getNumberOfContainers(),*_data);
+}
+
+///////////////////////
+
+std::vector<char> FetchVCFromVC(std::vector<char>& data, std::size_t& offset)
+{
+ std::uint32_t *sz = reinterpret_cast<std::uint32_t *>( data.data()+offset);
+ std::vector<char> ret(data.data()+offset+sizeof(std::uint32_t),data.data()+offset+sizeof(std::uint32_t)+*sz);
+ offset += sizeof(std::uint32_t)+*sz;
+ return ret;
+}
+
+std::string FetchStringFromVC(std::vector<char>& data, std::size_t& offset)
+{
+ std::uint32_t *sz = reinterpret_cast<std::uint32_t *>( data.data() );
+ std::string ret(data.data()+sizeof(std::uint32_t),*sz);
+ offset += sizeof(std::uint32_t)+*sz;
+ return ret;
+}
+
+class InternalFormatVisitorLoad : public SALOME_VisitorContainerLog
+{
+public:
+ InternalFormatVisitorLoad(std::vector<char> *data):_data(data) { }
+ void enterContainerPerfLog(SALOME_ContainerPerfLog& inst) override;
+ void leaveContainerPerfLog(SALOME_ContainerPerfLog& inst) override { }
+ void enterContainerScriptPerfLog(SALOME_ContainerScriptPerfLog& inst) override;
+ void leaveContainerScriptPerfLog(SALOME_ContainerScriptPerfLog& inst) override { }
+ void visitContainerScriptExecPerfLog(SALOME_ContainerScriptExecPerfLog& inst) override;
+private:
+ std::vector<char> *_data = nullptr;
+ std::size_t _offset = 0;
+};
+
+void InternalFormatVisitorLoad::visitContainerScriptExecPerfLog(SALOME_ContainerScriptExecPerfLog& inst)
+{
+ inst.setData( FetchVCFromVC( *_data, _offset ) );
+}
+
+void InternalFormatVisitorLoad::enterContainerScriptPerfLog(SALOME_ContainerScriptPerfLog& inst)
+{
+ inst.setName( FetchStringFromVC(*_data, _offset) );
+ inst.setCode( FetchStringFromVC(*_data, _offset) );
+}
+
+void InternalFormatVisitorLoad::enterContainerPerfLog(SALOME_ContainerPerfLog& inst)
+{
+ inst.setNameInNS( FetchStringFromVC(*_data, _offset) );
+ inst.setLogFile( FetchStringFromVC(*_data, _offset) );
+}
+
+///////////////////////
+
+std::vector<char> SALOME_LogManager::dumpCppInternalFrmt()
+{
+ std::vector<char> ret;
+ InternalFormatVisitorDump visitor(&ret);
+ this->accept( visitor );
+ return ret;
+}
class SALOME_LogManager;
class SALOME_ContainerPerfLog;
class SALOME_ContainerScriptPerfLog;
+class SALOME_ContainerScriptExecPerfLog;
+
+class SALOMELAUNCHER_EXPORT SALOME_VisitorContainerLog
+{
+public:
+ virtual void enterLogManager(SALOME_LogManager& inst) = 0;
+ virtual void leaveLogManager(SALOME_LogManager& inst) = 0;
+ virtual void enterContainerPerfLog(SALOME_ContainerPerfLog& inst) = 0;
+ virtual void leaveContainerPerfLog(SALOME_ContainerPerfLog& inst) = 0;
+ virtual void enterContainerScriptPerfLog(SALOME_ContainerScriptPerfLog& inst) = 0;
+ virtual void leaveContainerScriptPerfLog(SALOME_ContainerScriptPerfLog& inst) = 0;
+ virtual void visitContainerScriptExecPerfLog(SALOME_ContainerScriptExecPerfLog& inst) = 0;
+};
class SALOMELAUNCHER_EXPORT SALOME_ContainerScriptExecPerfLog : public POA_Engines::ContainerScriptExecPerfLog
{
PortableServer::POA_var getPOA();
void assign(const SALOME::vectorOfByte& value) override;
SALOME::vectorOfByte *getObj() override;
+ const std::vector<char>& data() const { return _data; }
+ void setData(std::vector<char>&& data) { _data = std::move(data); }
+public:
+ void accept(SALOME_VisitorContainerLog &visitor);
public:
void start();
AutoPyRef end();
Engines::ListOfContainerScriptExecPerfLog *listOfExecs() override;
char *getCode() override;
char *getName() override;
+ const std::string& name() const { return _name; }
+ const std::string& code() const { return _code; }
+ void setName(const std::string& name) { _name = name; }
+ void setCode(const std::string& code) { _code = code; }
+ std::size_t getNumberOfSessions() const { return _sessions.size(); }
+public:
+ void accept(SALOME_VisitorContainerLog &visitor);
private:
AutoPyRef _pyScriptLog;
SALOME_ContainerPerfLog *_father = nullptr;
char *getContainerEntryInNS() override;
Engines::ContainerScriptPerfLog_ptr addScript(const char *name, const char *code) override;
Engines::ListOfContainerScriptPerfLog *listOfScripts() override;
+ const std::string& nameInNS() const { return _name_in_ns; }
+ const std::string& logFile() const { return _log_file; }
+ void setNameInNS(const std::string& name) { _name_in_ns = name; }
+ void setLogFile(const std::string& logFile) { _log_file = logFile; }
+ std::size_t getNumberOfScripts() const { return _scripts.size(); }
+public:
+ void accept(SALOME_VisitorContainerLog &visitor);
private:
AutoPyRef _pyContLog;
SALOME_LogManager *_father = nullptr;
virtual ~SALOME_LogManager() = default;
Engines::ContainerPerfLog_ptr declareContainer(const char *contInNS, const char *logfile) override;
Engines::ListOfContainerPerfLog *listOfContainerLogs() override;
+ SALOME::vectorOfByte *getAllStruct() override;
+ std::size_t getNumberOfContainers() const { return _containers.size(); }
+ public:
+ void accept(SALOME_VisitorContainerLog &visitor);
+ private:
+ std::vector<char> dumpCppInternalFrmt();
private:
PyObject *_pyLogManager = nullptr;
std::unique_ptr<SALOME_NamingService_Abstract> _NS;
#include "SALOME_ResourcesCatalog_Handler.hxx"
#include <Basics_Utils.hxx>
#include <Basics_DirUtils.hxx>
+#include "utilities.h"
#include <fstream>
#include <iostream>
std::ifstream ifile(user_file.c_str(), std::ifstream::in );
if (ifile) {
// The file exists, and is open for input
+ DEBUG_MESSAGE("USER_CATALOG_RESOURCES_FILE positioned -> add it into resourcefiles list");
_path_resources.push_back(user_file);
}
else {
default_catalog_resource = false;
- RES_INFOS("Warning: USER_CATALOG_RESOURCES_FILE is set and file cannot be found.")
- RES_INFOS("Warning: That's why we try to create a new one.")
+ WARNING_MESSAGE("Warning: USER_CATALOG_RESOURCES_FILE is set and file cannot be found.")
+ WARNING_MESSAGE("Warning: That's why we try to create a new one.")
std::ofstream user_catalog_file;
user_catalog_file.open(user_file.c_str());
if (user_catalog_file.fail())
{
- RES_INFOS("Error: cannot write in the user catalog resources files");
- RES_INFOS("Error: using default CatalogResources.xml file");
+ WARNING_MESSAGE("Error: cannot write in the user catalog resources files");
+ WARNING_MESSAGE("Error: using default CatalogResources.xml file");
default_catalog_resource = true;
}
else
std::ifstream ifile(default_file.c_str(), std::ifstream::in );
if (ifile) {
// The file exists, and is open for input
+ DEBUG_MESSAGE("${APPLI}/CatalogResources.xml exists -> add it into resourcefiles list");
_path_resources.push_back(default_file);
default_catalog_resource=false;
}
throw ResourcesException("you must define KERNEL_ROOT_DIR environment variable!! -> cannot load a CatalogResources.xml");
default_file = getenv("KERNEL_ROOT_DIR");
default_file += "/share/salome/resources/kernel/CatalogResources.xml";
+ DEBUG_MESSAGE("${KERNEL_ROOT_DIR}/share/salome/resources/kernel/CatalogResources.xml -> add it into resourcefiles list");
_path_resources.push_back(default_file);
}
int result = stat((*_path_resources_it).c_str(), &statinfo);
if (result < 0)
{
- RES_MESSAGE("Resource file " << *_path_resources_it << " does not exist");
+ WARNING_MESSAGE("Resource file " << *_path_resources_it << " does not exist -> no parsing");
return _resourcesList;
}
if(_lasttime == 0 || statinfo.st_mtime > _lasttime)
{
+ DEBUG_MESSAGE("Resource file " << *_path_resources_it << " has been detected to be present and newer than Resources in memory");
to_parse = true;
_lasttime = statinfo.st_mtime;
}
if (to_parse)
{
+ DEBUG_MESSAGE("After analyze of resoure files time meta data, a load of resources from scratch from files is necessary.");
_resourcesList.clear();
AddDefaultResourceInCatalog();
// On parse tous les fichiers
{
MapOfParserResourcesType _resourcesList_tmp;
MapOfParserResourcesType _resourcesBatchList_tmp;
- SALOME_ResourcesCatalog_Handler *handler( new SALOME_ResourcesCatalog_Handler(_resourcesList_tmp) );
+ std::unique_ptr<SALOME_ResourcesCatalog_Handler> handler( new SALOME_ResourcesCatalog_Handler(_resourcesList_tmp) );
const char *aFilePath( (*_path_resources_it).c_str() );
FILE* aFile = fopen(aFilePath, "r");
-
if (aFile != NULL)
{
xmlDocPtr aDoc = xmlReadFile(aFilePath, NULL, 0);
if (aDoc != NULL)
{
+ DEBUG_MESSAGE("XML parsing of Resource file \"" << aFilePath << "\"");
handler->ProcessXmlDocument(aDoc);
// adding new resources to the file
MapOfParserResourcesType_it j = _resourcesList.find(i->first);
if (i->second.HostName == DEFAULT_RESOURCE_NAME || i->second.HostName == Kernel_Utils::GetHostname())
{
+ DEBUG_MESSAGE("Resource \"" << i->first << "\" in file \"" << aFilePath << "\" is detected as localhost");
MapOfParserResourcesType_it it0(_resourcesList.find(DEFAULT_RESOURCE_NAME));
if(it0!=_resourcesList.end())
{
+ DEBUG_MESSAGE("Resource \"" << i->first << "\" in file \"" << aFilePath << "\" detected as localhost is already in memory -> update resource with content in file ( for attributes : nbOfNodes, nbOfProcPerNode, CPUFreqMHz and memInMB)");
ParserResourcesType& localhostElt((*it0).second);
localhostElt.DataForSort._nbOfNodes=(*i).second.DataForSort._nbOfNodes;
localhostElt.DataForSort._nbOfProcPerNode=(*i).second.DataForSort._nbOfProcPerNode;
localhostElt.DataForSort._CPUFreqMHz=(*i).second.DataForSort._CPUFreqMHz;
localhostElt.DataForSort._memInMB=(*i).second.DataForSort._memInMB;
}
- RES_MESSAGE("Resource " << i->first << " is not added because it is the same "
- "machine as default local resource \"" << DEFAULT_RESOURCE_NAME << "\"");
+ DEBUG_MESSAGE("Resource \"" << i->first << "\" is not added because it is the same machine as default local resource \"" << DEFAULT_RESOURCE_NAME << "\"");
}
else if (j != _resourcesList.end())
{
- cerr << "ParseXmlFiles Warning, two resources with the same name were found, "
- "taking the first declaration : " << i->first << endl;
+ WARNING_MESSAGE("ParseXmlFiles Warning, two resources with the same name were found, taking the first declaration : " << i->first );
}
else
{
+ DEBUG_MESSAGE("Resource \"" << i->first << "\" added");
_resourcesList[i->first] = i->second;
}
}
}
else
- std::cerr << "ResourcesManager_cpp: could not parse file " << aFilePath << std::endl;
+ ERROR_MESSAGE( "ResourcesManager_cpp: could not parse file " << aFilePath );
// Free the document
xmlFreeDoc(aDoc);
fclose(aFile);
}
else
- std::cerr << "ResourcesManager_cpp: file " << aFilePath << " is not readable." << std::endl;
-
- delete handler;
+ ERROR_MESSAGE( "ResourcesManager_cpp: file " << aFilePath << " is not readable." );
}
}
return _resourcesList;
resource.can_launch_batch_jobs = true;
resource.can_run_containers = true;
_resourcesList[resource.Name] = resource;
+ DEBUG_MESSAGE("Put Ressource \"" << resource.Name << "\" in dictionary of resources. This resource will be present even if resource files define it later.");
}
}
aCurNode = aCurNode->next;
}
-
- DEBUG_MESSAGE( "************************************************" );
+ DEBUG_MESSAGE( "************ Resources in memory ************");
for (std::map<std::string, ParserResourcesType>::const_iterator iter = _resources_list.begin(); iter != _resources_list.end(); iter++)
{
- DEBUG_MESSAGE( "Resource " << (*iter).first << " found: " << std::endl << (*iter).second);
+ DEBUG_MESSAGE( "Resource \"" << (*iter).first << "\" -> " << (*iter).second.dump(' '));
}
- DEBUG_MESSAGE( "************************************************" );
+ DEBUG_MESSAGE( "************ Resources in memory ************");
}
bool
throw ResourcesException((string("Unknown protocol ") + protocolStr).c_str());
}
-ostream & operator<<(ostream &os, const ParserResourcesType &prt)
+std::string ParserResourcesType::dump(char sep) const
{
- os << "Name: " << prt.Name << endl <<
- "HostName: " << prt.HostName << endl <<
- "Type: " << prt.getResourceTypeStr() << endl <<
- "NbOfNodes: " << prt.DataForSort._nbOfNodes << endl <<
- "NbOfProcPerNode: " << prt.DataForSort._nbOfProcPerNode << endl <<
- "CPUFreqMHz: " << prt.DataForSort._CPUFreqMHz << endl <<
- "MemInMB: " << prt.DataForSort._memInMB << endl <<
- "Protocol: " << prt.getAccessProtocolTypeStr() << endl <<
- "ClusterInternalProtocol: " << prt.getClusterInternalProtocolStr() << endl <<
- "Batch: " << prt.getBatchTypeStr() << endl <<
- "mpi: " << prt.getMpiImplTypeStr() << endl <<
- "UserName: " << prt.UserName << endl <<
- "AppliPath: " << prt.AppliPath << endl <<
- "OS: " << prt.OS << endl <<
- "batchQueue: " << prt.batchQueue << endl <<
- "userCommands: " << prt.userCommands << endl <<
- "use: " << prt.use << endl <<
- "NbOfProc: " << prt.nbOfProc << endl <<
- "Can Launch Batch Jobs: " << prt.can_launch_batch_jobs << endl <<
- "Can Run Containers: " << prt.can_run_containers << endl <<
- "Working Directory: " << prt.working_directory << endl;
-
- for(unsigned int i=0 ; i<prt.ComponentsList.size() ; i++)
- os << "Component " << i+1 << " called: " << prt.ComponentsList[i] << endl;
+ std::ostringstream oss;
+ oss << "Name: " << this->Name << sep <<
+ "HostName: " << this->HostName << sep <<
+ "Type: " << this->getResourceTypeStr() << sep <<
+ "NbOfNodes: " << this->DataForSort._nbOfNodes << sep <<
+ "NbOfProcPerNode: " << this->DataForSort._nbOfProcPerNode << sep <<
+ "CPUFreqMHz: " << this->DataForSort._CPUFreqMHz << sep <<
+ "MemInMB: " << this->DataForSort._memInMB << sep <<
+ "Protocol: " << this->getAccessProtocolTypeStr() << sep <<
+ "ClusterInternalProtocol: " << this->getClusterInternalProtocolStr() << sep <<
+ "Batch: " << this->getBatchTypeStr() << sep <<
+ "mpi: " << this->getMpiImplTypeStr() << sep <<
+ "UserName: " << this->UserName << sep <<
+ "AppliPath: " << this->AppliPath << sep <<
+ "OS: " << this->OS << sep <<
+ "batchQueue: " << this->batchQueue << sep <<
+ "userCommands: " << this->userCommands << sep <<
+ "use: " << this->use << sep <<
+ "NbOfProc: " << this->nbOfProc << sep <<
+ "Can Launch Batch Jobs: " << this->can_launch_batch_jobs << sep <<
+ "Can Run Containers: " << this->can_run_containers << sep <<
+ "Working Directory: " << this->working_directory << sep;
+
+ for(unsigned int i=0 ; i<this->ComponentsList.size() ; i++)
+ oss << "Component " << i+1 << " called: " << this->ComponentsList[i] << sep;
list<ParserResourcesType>::const_iterator it;
- for(it = prt.ClusterMembersList.begin() ; it != prt.ClusterMembersList.end() ; it++)
+ for(it = this->ClusterMembersList.cbegin() ; it != this->ClusterMembersList.cend() ; it++)
{
- os << "Cluster member called: " << (*it).HostName << endl;
+ oss << "Cluster member called: " << (*it).HostName << sep;
}
+ return oss.str();
+}
+
+ostream & operator<<(ostream &os, const ParserResourcesType &prt)
+{
+ os << prt.dump('\n');
return os;
}
void setClusterInternalProtocolStr(const std::string & internalProtocolTypeStr);
void setCanLaunchBatchJobsStr(const std::string & canLaunchBatchJobsStr);
void setCanRunContainersStr(const std::string & canRunContainersStr);
+ std::string dump(char sep) const;
ResourceDataToSort DataForSort;
std::string Name;