1 // SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOME_ResourcesCatalog_Parser.hxx
25 // Author : Estelle Deville
29 #ifndef SALOME_RESOURCES_CATALOG_PARSER
30 #define SALOME_RESOURCES_CATALOG_PARSER
37 typedef std::map<std::string, std::string> MapOfModulesPath;
39 enum AccessProtocolType {rsh, ssh};
41 enum AccessModeType {interactive, batch};
43 class ResourceDataToSort {
45 std::string _hostName;
46 unsigned int _nbOfNodes;
47 unsigned int _nbOfProcPerNode;
48 unsigned int _CPUFreqMHz;
49 unsigned int _memInMB;
50 static unsigned int _nbOfNodesWanted;
51 static unsigned int _nbOfProcPerNodeWanted;
52 static unsigned int _CPUFreqMHzWanted;
53 static unsigned int _memInMBWanted;
56 ResourceDataToSort(const std::string& hostname,unsigned int nbOfNodes,unsigned int nbOfProcPerNode,unsigned int CPUFreqMHz,unsigned int memInMB);
57 bool operator< (const ResourceDataToSort& other) const;
60 unsigned int GetNumberOfPoints() const;
61 // friend class SALOME_ResourcesCatalog_Handler;
62 // friend class SALOME_ResourcesManager;
63 // friend struct ParserResourcesType;
66 struct ParserResourcesType {
67 ResourceDataToSort DataForSort;
69 AccessProtocolType Protocol;
72 MapOfModulesPath ModulesPath;
73 std::string PreReqFilePath;
77 std::cout << "##############*****" << std::endl;
78 std::cout << "HostName : " << DataForSort._hostName << std::endl;
79 std::cout << "Alias : " << Alias << std::endl;
80 std::cout << "Protocol : " << Protocol << std::endl;
81 std::cout << "Mode : " << Mode << std::endl;
82 std::cout << "UserName : " << UserName << std::endl;
83 std::cout << "Modules : " << std::endl;
85 for(std::map<std::string, std::string>::iterator iter=ModulesPath.begin();iter!=ModulesPath.end();iter++)
87 std::cout << " Module " << i++ << " called : " << (*iter).first << " with path : " << (*iter).second << std::endl;
89 std::cout << "PreReqFilePath : " << PreReqFilePath << std::endl;
90 std::cout << "OS : " << OS << std::endl;
95 typedef std::map<std::string, ParserResourcesType> MapOfParserResourcesType;
97 #endif //SALOME_RESOURCES_CATALOG_PARSER