Salome HOME
- Major update for launcher:
[modules/kernel.git] / src / ResourcesManager / SALOME_ResourcesCatalog_Parser.cxx
index aedbcbe72ff1b6760e7780a251b96ba9bf958509..f84d26b2ca482186b988d78d088033dc8ac24b05 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SALOME_ResourcesCatalog_Parser.hxx"
 #include <iostream>
 #include <sstream>
 
 #define NULL_VALUE 0
 
-using namespace std;
-
 unsigned int ResourceDataToSort::_nbOfProcWanted = NULL_VALUE;
 unsigned int ResourceDataToSort::_nbOfNodesWanted = NULL_VALUE;
 unsigned int ResourceDataToSort::_nbOfProcPerNodeWanted = NULL_VALUE;
@@ -36,7 +35,7 @@ unsigned int ResourceDataToSort::_memInMBWanted = NULL_VALUE;
 ResourceDataToSort::ResourceDataToSort()
 {}
 
-ResourceDataToSort::ResourceDataToSort(const string& name,
+ResourceDataToSort::ResourceDataToSort(const std::string& name,
                                        unsigned int nbOfNodes,
                                        unsigned int nbOfProcPerNode,
                                        unsigned int CPUFreqMHz,
@@ -62,7 +61,7 @@ unsigned int ResourceDataToSort::GetNumberOfPoints() const
 
     if (_nbOfProcWanted != NULL_VALUE)
       {
-       unsigned int nb_proc = _nbOfNodes * _nbOfProcPerNode;
+        unsigned int nb_proc = _nbOfNodes * _nbOfProcPerNode;
         if (nb_proc == _nbOfProcWanted)
           ret += 30000;
         else if (nb_proc > _nbOfProcWanted)
@@ -123,39 +122,39 @@ unsigned int ResourceDataToSort::GetNumberOfPoints() const
 //! Method used for debug
 void ResourceDataToSort::Print() const
   {
-    cout << _nbOfNodes << endl;
-    cout << _nbOfProcPerNode << endl;
-    cout << _CPUFreqMHz << endl;
-    cout << _memInMB << endl;
+    std::cout << _nbOfNodes << std::endl;
+    std::cout << _nbOfProcPerNode << std::endl;
+    std::cout << _CPUFreqMHz << std::endl;
+    std::cout << _memInMB << std::endl;
   }
 
 void ParserResourcesType::Print()
 {
-  ostringstream oss;
-  oss << endl <<
-    "Name : " << Name << endl <<
-    "HostName : " << HostName << endl << 
-    "NbOfNodes : " << DataForSort._nbOfNodes << endl <<
-    "NbOfProcPerNode : " << DataForSort._nbOfProcPerNode << endl <<
-    "CPUFreqMHz : " << DataForSort._CPUFreqMHz << endl <<
-    "MemInMB : " << DataForSort._memInMB << endl <<
-    "Protocol : " << Protocol << endl <<
-    "ClusterInternalProtocol : " << ClusterInternalProtocol << endl <<
-    "Mode : " << Mode << endl <<
-    "Batch : " << Batch << endl <<
-    "mpi : " << mpi << endl <<
-    "UserName : " << UserName << endl <<
-    "AppliPath : " << AppliPath << endl <<
-    "OS : " << OS << endl <<
-    "batchQueue : " << batchQueue << endl <<
-    "userCommands : " << userCommands << endl <<
-    "use : " << use << endl <<
-    "NbOfProc : " << nbOfProc << endl <<
-    "Modules : " << endl <<
-    "Components : " << endl;
+  std::ostringstream oss;
+  oss << std::endl <<
+    "Name : " << Name << std::endl <<
+    "HostName : " << HostName << std::endl << 
+    "NbOfNodes : " << DataForSort._nbOfNodes << std::endl <<
+    "NbOfProcPerNode : " << DataForSort._nbOfProcPerNode << std::endl <<
+    "CPUFreqMHz : " << DataForSort._CPUFreqMHz << std::endl <<
+    "MemInMB : " << DataForSort._memInMB << std::endl <<
+    "Protocol : " << Protocol << std::endl <<
+    "ClusterInternalProtocol : " << ClusterInternalProtocol << std::endl <<
+    "Mode : " << Mode << std::endl <<
+    "Batch : " << Batch << std::endl <<
+    "mpi : " << mpi << std::endl <<
+    "UserName : " << UserName << std::endl <<
+    "AppliPath : " << AppliPath << std::endl <<
+    "OS : " << OS << std::endl <<
+    "batchQueue : " << batchQueue << std::endl <<
+    "userCommands : " << userCommands << std::endl <<
+    "use : " << use << std::endl <<
+    "NbOfProc : " << nbOfProc << std::endl <<
+    "Modules : " << std::endl <<
+    "Components : " << std::endl;
 
-  for(int i=0;i<ComponentsList.size();i++)
-    oss << "Component " << i+1 << " called : " << ComponentsList[i] << endl;
+  for(unsigned int i=0;i<ComponentsList.size();i++)
+    oss << "Component " << i+1 << " called : " << ComponentsList[i] << std::endl;
 
   
   std::list<ParserResourcesClusterMembersType>::iterator it;
@@ -163,9 +162,9 @@ void ParserResourcesType::Print()
       it != ClusterMembersList.end();
       it++)
   {
-    oss << "Cluster member  called : " << (*it).HostName << endl;
+    oss << "Cluster member  called : " << (*it).HostName << std::endl;
   }
-  cout << oss.str() << endl;
+  std::cout << oss.str() << std::endl;
 }
 
 std::string
@@ -206,6 +205,8 @@ ParserResourcesType::PrintBatchType() const
     return "lsf";
   else if (Batch == sge)
     return "sge";
+  else if (Batch == ccc)
+    return "ccc";
   else 
     return "ssh";
 }