[342] | 1 | #ifndef __SERVER_HPP__ |
---|
| 2 | #define __SERVER_HPP__ |
---|
[300] | 3 | |
---|
| 4 | #include "xmlioserver_spl.hpp" |
---|
| 5 | #include "context.hpp" |
---|
[382] | 6 | #include "mpi.hpp" |
---|
[492] | 7 | #include "event_scheduler.hpp" |
---|
[300] | 8 | |
---|
[335] | 9 | namespace xios |
---|
[300] | 10 | { |
---|
| 11 | class CServer |
---|
| 12 | { |
---|
| 13 | public: |
---|
[490] | 14 | |
---|
[300] | 15 | static void initialize(void) ; |
---|
| 16 | static void finalize(void) ; |
---|
| 17 | static void eventLoop(void) ; |
---|
| 18 | static void contextEventLoop(void) ; |
---|
| 19 | static void listenContext(void) ; |
---|
| 20 | static void listenFinalize(void) ; |
---|
| 21 | static void recvContextMessage(void* buff,int count) ; |
---|
| 22 | static void listenRootContext(void) ; |
---|
| 23 | static void listenRootFinalize(void) ; |
---|
| 24 | static void registerContext(void* buff,int count, int leaderRank=0) ; |
---|
[490] | 25 | |
---|
[300] | 26 | static MPI_Comm intraComm ; |
---|
| 27 | static list<MPI_Comm> interComm ; |
---|
[492] | 28 | static CEventScheduler* eventScheduler ; |
---|
[300] | 29 | |
---|
| 30 | struct contextMessage |
---|
| 31 | { |
---|
| 32 | int nbRecv ; |
---|
| 33 | int leaderRank ; |
---|
| 34 | } ; |
---|
[490] | 35 | |
---|
| 36 | static bool isRoot ; |
---|
| 37 | |
---|
| 38 | static map<string,CContext*> contextList ; |
---|
| 39 | static bool finished ; |
---|
| 40 | static bool is_MPI_Initialized ; |
---|
| 41 | |
---|
| 42 | public: |
---|
| 43 | //! Get rank of the current process |
---|
| 44 | static int getRank(); |
---|
| 45 | |
---|
| 46 | //! Print Information into a file |
---|
| 47 | static void openInfoStream(const StdString& fileName); |
---|
| 48 | |
---|
| 49 | //! Print information to standard output |
---|
| 50 | static void openInfoStream(); |
---|
| 51 | |
---|
| 52 | //! Close Info stream (closing file) |
---|
| 53 | static void closeInfoStream(); |
---|
| 54 | |
---|
| 55 | private: |
---|
| 56 | static StdOFStream m_infoStream; |
---|
| 57 | static int rank ; |
---|
[300] | 58 | } ; |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | #endif |
---|