+ std::cout << _nbOfNodes << std::endl;
+ std::cout << _nbOfProcPerNode << std::endl;
+ std::cout << _CPUFreqMHz << std::endl;
+ std::cout << _memInMB << std::endl;
+ }
+
+
+ParserResourcesType::ParserResourcesType()
+: type(single_machine),
+ Protocol(ssh),
+ ClusterInternalProtocol(ssh),
+ Batch(none),
+ mpi(nompi),
+ nbOfProc(1),
+ can_launch_batch_jobs(false),
+ can_run_containers(false)
+{
+ DataForSort._Name = "";
+ DataForSort._nbOfNodes = 1;
+ DataForSort._nbOfProcPerNode = 1;
+ DataForSort._CPUFreqMHz = 0;
+ DataForSort._memInMB = 0;
+}
+
+ParserResourcesType::~ParserResourcesType()
+{
+}
+
+std::string ParserResourcesType::protocolToString(AccessProtocolType protocol)
+{
+ switch (protocol)
+ {
+ case sh:
+ return "sh";
+ case rsh:
+ return "rsh";
+ case ssh:
+ return "ssh";
+ case srun:
+ return "srun";
+ case pbsdsh:
+ return "pbsdsh";
+ case blaunch:
+ return "blaunch";
+ default:
+ throw SALOME_Exception("Unknown protocol");
+ }
+}
+
+AccessProtocolType ParserResourcesType::stringToProtocol(const std::string & protocolStr)
+{
+ if (protocolStr == "sh")
+ return sh;
+ else if (protocolStr == "rsh")
+ return rsh;
+ else if (protocolStr == "ssh")
+ return ssh;
+ else if (protocolStr == "srun")
+ return srun;
+ else if (protocolStr == "pbsdsh")
+ return pbsdsh;
+ else if (protocolStr == "blaunch")
+ return blaunch;
+ else
+ throw SALOME_Exception((string("Unknown protocol ") + protocolStr).c_str());
+}
+
+ostream & operator<<(ostream &os, const ParserResourcesType &prt)
+{
+ 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;
+
+ list<ParserResourcesType>::const_iterator it;
+ for(it = prt.ClusterMembersList.begin() ; it != prt.ClusterMembersList.end() ; it++)
+ {
+ os << "Cluster member called: " << (*it).HostName << endl;
+ }
+ return os;
+}
+
+std::string
+ParserResourcesType::getAccessProtocolTypeStr() const
+{
+ return protocolToString(Protocol);
+}
+
+std::string
+ParserResourcesType::getClusterInternalProtocolStr() const
+{
+ return protocolToString(ClusterInternalProtocol);
+}
+
+std::string
+ParserResourcesType::getResourceTypeStr() const
+{
+ switch (type)
+ {
+ case cluster:
+ return "cluster";
+ case single_machine:
+ return "single_machine";
+ default:
+ throw SALOME_Exception("Unknown resource type");
+ }
+}
+
+std::string
+ParserResourcesType::getBatchTypeStr() const
+{
+ switch (Batch)
+ {
+ case none:
+ return "none";
+ case pbs:
+ return "pbs";
+ case lsf:
+ return "lsf";
+ case sge:
+ return "sge";
+ case ccc:
+ return "ccc";
+ case slurm:
+ return "slurm";
+ case ll:
+ return "ll";
+ case vishnu:
+ return "vishnu";
+ case oar:
+ return "oar";
+ case coorm:
+ return "coorm";
+ case ssh_batch:
+ return "ssh_batch";
+ default:
+ throw SALOME_Exception("Unknown batch type");
+ }
+}
+
+std::string
+ParserResourcesType::getMpiImplTypeStr() const
+{
+ switch (mpi)
+ {
+ case nompi:
+ return "no mpi";
+ case lam:
+ return "lam";
+ case mpich1:
+ return "mpich1";
+ case mpich2:
+ return "mpich2";
+ case openmpi:
+ return "openmpi";
+ case ompi:
+ return "ompi";
+ case slurmmpi:
+ return "slurmmpi";
+ case prun:
+ return "prun";
+ default:
+ throw SALOME_Exception("Unknown MPI implementation type");