[219] | 1 | #ifndef __XMLIO_CXMLIOManager__ |
---|
| 2 | #define __XMLIO_CXMLIOManager__ |
---|
| 3 | |
---|
| 4 | /// xmlioserver headers /// |
---|
| 5 | #include "xmlioserver_spl.hpp" |
---|
| 6 | #include "exception.hpp" |
---|
| 7 | #include "mpi_manager.hpp" |
---|
| 8 | |
---|
| 9 | namespace xmlioserver |
---|
| 10 | { |
---|
| 11 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 12 | class CXIOSManager |
---|
| 13 | { |
---|
| 14 | public : |
---|
| 15 | |
---|
| 16 | /// Définition de type /// |
---|
| 17 | typedef enum _xios_type |
---|
| 18 | { CLIENT_SERVER = 0 , CLIENT, SERVER } XIOSType; |
---|
| 19 | |
---|
| 20 | typedef enum _xios_status |
---|
| 21 | { LOC_UNUSED = 0, LOC_CLIENT, LOC_SERVER, LOC_CLIENT_SERVER } XIOSStatus; |
---|
| 22 | |
---|
| 23 | typedef struct |
---|
| 24 | { |
---|
| 25 | StdSize nbClient; |
---|
| 26 | StdSize nbClientPServer; |
---|
| 27 | void (*entry)(comm::MPIComm, comm::MPIComm, comm::MPIComm) ; |
---|
| 28 | } XIOSClient; |
---|
| 29 | |
---|
| 30 | public: |
---|
| 31 | |
---|
| 32 | /// Initialisation et finalisation de la bibliothÚque /// |
---|
| 33 | static void Initialise(XIOSType type = CLIENT, |
---|
| 34 | int * argc = NULL , |
---|
| 35 | char *** argv = NULL ); |
---|
| 36 | static void Finalize(void); |
---|
| 37 | |
---|
| 38 | /// Ajout de client en mode CLIENT_SERVER et CLIENT/// |
---|
| 39 | static void AddClient(StdString clientName, StdSize nbClient, StdSize nbClientPServer, |
---|
| 40 | void (*entry_point)(comm::MPIComm, comm::MPIComm, comm::MPIComm)); |
---|
| 41 | |
---|
| 42 | /// Lancement des serveurs et/ou des clients /// |
---|
| 43 | static void RunServer(StdString clientName, |
---|
| 44 | comm::MPIComm comm_client_server, comm::MPIComm comm_server); |
---|
[274] | 45 | static void RunClient(bool launch = false, comm::MPIComm comm_client = |
---|
| 46 | comm::CMPIManager::GetCommWorld()); |
---|
[219] | 47 | static void RunClientServer(comm::MPIComm comm_client_server = |
---|
| 48 | comm::CMPIManager::GetCommWorld()); |
---|
| 49 | |
---|
| 50 | public : |
---|
| 51 | |
---|
| 52 | /// Accesseurs statiques /// |
---|
| 53 | static XIOSType GetType(void); |
---|
| 54 | static XIOSStatus GetStatus(void); |
---|
| 55 | static StdString GetClientName(void); |
---|
| 56 | |
---|
| 57 | protected : |
---|
| 58 | |
---|
| 59 | static StdSize GetNbClient(void); |
---|
| 60 | static StdSize GetNbLocClient(const StdString & clientName = CXIOSManager::ClientName); |
---|
| 61 | |
---|
| 62 | static StdSize GetNbServer(void); |
---|
| 63 | static StdSize GetNbLocServer(const StdString & clientName = CXIOSManager::ClientName); |
---|
| 64 | |
---|
| 65 | private : |
---|
| 66 | |
---|
| 67 | /// Information /// |
---|
| 68 | static void ShowInformation_CS(comm::MPIComm comm_client_server); |
---|
| 69 | |
---|
| 70 | /// Variables statiques privées /// |
---|
| 71 | static StdString ExeName; |
---|
| 72 | static std::vector<StdString> ExeOptions; |
---|
| 73 | |
---|
| 74 | static XIOSType Type; |
---|
| 75 | static XIOSStatus Status; |
---|
| 76 | static StdString ClientName; |
---|
| 77 | static comm::MPIComm Comm_Client_Server, Comm_Server; |
---|
| 78 | static xios_map<StdString, XIOSClient> Clients; |
---|
| 79 | |
---|
| 80 | }; // class CXIOSManager |
---|
| 81 | } // namespace xmlioserver |
---|
| 82 | |
---|
| 83 | #endif //__XMLIO_CXMLIOManager__ |
---|