1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SALOME ResourcesCatalog : implementation of catalog resources parsing (SALOME_ModuleCatalog.idl)
24 // File : SALOME_ResourcesCatalog_Parser.hxx
25 // Author : Estelle Deville
29 #ifndef SALOME_RESOURCES_CATALOG_PARSER
30 #define SALOME_RESOURCES_CATALOG_PARSER
32 #include "ResourcesManager_Defs.hxx"
41 #pragma warning(disable:4251) // Warning DLL Interface ...
44 enum AccessProtocolType {rsh, ssh, srun, pbsdsh, blaunch};
46 enum AccessModeType {interactive, batch};
48 enum BatchType {none, pbs, lsf, sge, ssh_batch, ccc, ll, slurm, vishnu};
50 enum MpiImplType {nompi, lam, mpich1, mpich2, openmpi, slurmmpi, prun};
52 class RESOURCESMANAGER_EXPORT ResourceDataToSort
57 unsigned int _nbOfNodes;
58 unsigned int _nbOfProcPerNode;
59 unsigned int _CPUFreqMHz;
60 unsigned int _memInMB;
61 static unsigned int _nbOfProcWanted;
62 static unsigned int _nbOfNodesWanted;
63 static unsigned int _nbOfProcPerNodeWanted;
64 static unsigned int _CPUFreqMHzWanted;
65 static unsigned int _memInMBWanted;
69 ResourceDataToSort(const std::string& name,
70 unsigned int nbOfNodes,
71 unsigned int nbOfProcPerNode,
72 unsigned int CPUFreqMHz,
73 unsigned int memInMB);
74 bool operator< (const ResourceDataToSort& other) const;
78 unsigned int GetNumberOfPoints() const;
81 struct RESOURCESMANAGER_EXPORT ParserResourcesClusterMembersType
84 AccessProtocolType Protocol;
85 AccessProtocolType ClusterInternalProtocol;
87 std::string AppliPath;
88 ResourceDataToSort DataForSort;
91 struct RESOURCESMANAGER_EXPORT ParserResourcesType
93 ResourceDataToSort DataForSort;
96 AccessProtocolType Protocol;
97 AccessProtocolType ClusterInternalProtocol;
101 std::string UserName;
102 std::string AppliPath;
103 std::vector<std::string> ComponentsList;
104 std::vector<std::string> ModulesList;
106 std::string batchQueue;
107 std::string userCommands;
109 std::list<ParserResourcesClusterMembersType> ClusterMembersList;
110 unsigned int nbOfProc;
111 bool is_cluster_head;
112 std::string working_directory;
117 static std::string protocolToString(AccessProtocolType protocol);
118 static AccessProtocolType stringToProtocol(const std::string & protocolStr);
120 std::string PrintAccessProtocolType() const;
121 std::string PrintAccessModeType() const;
122 std::string PrintBatchType() const;
123 std::string PrintMpiImplType() const;
124 std::string PrintClusterInternalProtocol() const;
127 typedef std::map<std::string, ParserResourcesType> MapOfParserResourcesType;
128 typedef std::map<std::string, ParserResourcesType>::iterator MapOfParserResourcesType_it;
130 #endif //SALOME_RESOURCES_CATALOG_PARSER