Ignore:
Timestamp:
11/19/18 15:52:54 (5 years ago)
Author:
yushan
Message:

branch_openmp merged with trunk r1597

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/src/client.hpp

    r1587 r1601  
    77namespace xios 
    88{ 
    9     class CClient 
    10     { 
    11       public: 
    12         static void initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm); 
    13         static void finalize(void); 
    14         static void registerContext(const string& id, MPI_Comm contextComm); 
    15         static void callOasisEnddef(void) ; 
     9  class CClient 
     10  { 
     11    public: 
     12      static void initialize(const string& codeId, ep_lib::MPI_Comm& localComm, ep_lib::MPI_Comm& returnComm); 
     13      static void finalize(void); 
     14      static void registerContext(const string& id, ep_lib::MPI_Comm contextComm); 
     15      static void callOasisEnddef(void) ; 
    1616 
    17         static MPI_Comm intraComm; 
    18         static MPI_Comm interComm; 
    19         static std::list<MPI_Comm> contextInterComms; 
    20         static int serverLeader; 
    21         static bool is_MPI_Initialized ; 
     17      static ep_lib::MPI_Comm intraComm; 
     18      #pragma omp threadprivate(intraComm) 
    2219 
    23         static MPI_Comm& getInterComm(); 
     20      static ep_lib::MPI_Comm interComm; 
     21      #pragma omp threadprivate(interComm) 
    2422 
    25         //! Get global rank without oasis and current rank in model intraComm in case of oasis 
    26         static int getRank(); 
     23      //static std::list<MPI_Comm> contextInterComms; 
     24      static std::list<ep_lib::MPI_Comm> *contextInterComms_ptr; 
     25      #pragma omp threadprivate(contextInterComms_ptr) 
    2726 
    28         //! Open a file stream to write the info logs 
    29         static void openInfoStream(const StdString& fileName); 
    30         //! Write the info logs to standard output 
    31         static void openInfoStream(); 
    32         //! Close the info logs file if it opens 
    33         static void closeInfoStream(); 
     27      static int serverLeader; 
     28      #pragma omp threadprivate(serverLeader) 
    3429 
    35         //! Open a file stream to write the error log 
    36         static void openErrorStream(const StdString& fileName); 
    37         //! Write the error log to standard error output 
    38         static void openErrorStream(); 
    39         //! Close the error log file if it opens 
    40         static void closeErrorStream(); 
     30      static bool is_MPI_Initialized ; 
     31      #pragma omp threadprivate(is_MPI_Initialized) 
    4132 
    42       protected: 
    43         static int rank_;                 //!< Rank in model intraComm 
    44         static StdOFStream m_infoStream; 
    45         static StdOFStream m_errorStream; 
     33      static ep_lib::MPI_Comm& getInterComm(); 
    4634 
    47         static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); 
    48     }; 
     35      //! Get global rank without oasis and current rank in model intraComm in case of oasis 
     36      static int getRank(); 
     37 
     38      //! Open a file stream to write the info logs 
     39      static void openInfoStream(const StdString& fileName); 
     40      //! Write the info logs to standard output 
     41      static void openInfoStream(); 
     42      //! Close the info logs file if it opens 
     43      static void closeInfoStream(); 
     44 
     45      //! Open a file stream to write the error log 
     46      static void openErrorStream(const StdString& fileName); 
     47      //! Write the error log to standard error output 
     48      static void openErrorStream(); 
     49      //! Close the error log file if it opens 
     50      static void closeErrorStream(); 
     51 
     52    protected: 
     53      static int rank_;                 //!< Rank in model intraComm 
     54      #pragma omp threadprivate(rank_) 
     55 
     56      static StdOFStream m_infoStream; 
     57      #pragma omp threadprivate(m_infoStream) 
     58      static StdOFStream m_errorStream; 
     59      #pragma omp threadprivate(m_errorStream) 
     60 
     61      static StdOFStream array_infoStream[16]; 
     62      static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); 
     63  }; 
    4964} 
    5065 
Note: See TracChangeset for help on using the changeset viewer.