Changeset 1080 for XIOS


Ignore:
Timestamp:
03/29/17 19:12:27 (7 years ago)
Author:
yushan
Message:

Under development : save modification

Location:
XIOS/dev/branch_yushan
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan/bld.cfg

    r1079 r1080  
    3636#bld::target test_remap.exe 
    3737#bld::target test_new_features.exe test_unstruct_complete.exe  
    38 bld::target test_omp.exe test_client.exe #test_complete.exe  
     38bld::target test_omp.exe #test_client.exe #test_complete.exe  
    3939bld::exe_dep 
    4040 
  • XIOS/dev/branch_yushan/src/client.cpp

    r1079 r1080  
    193193      printf("Client %d CContext::setCurrent OK\n", getRank()); 
    194194      CContext* context = CContext::create(id); 
    195       printf("Client %d context=CContext::create(%s) OK\n", getRank(), id); 
     195      printf("Client %d context=CContext::create(%s) OK, *context = %p\n", getRank(), id, &(*context)); 
    196196       
    197197      StdString idServer(id); 
     
    254254        MPI_Comm_dup(contextComm,&contextInterComm) ; 
    255255        CContext* contextServer = CContext::create(idServer); 
    256  
     256         
    257257        // Firstly, initialize context on client side 
    258258        context->initClient(contextComm,contextInterComm, contextServer); 
  • XIOS/dev/branch_yushan/src/client.hpp

    r1079 r1080  
    2323        static std::list<MPI_Comm> contextInterComms; 
    2424        // #pragma omp threadprivate(contextInterComms) 
     25        //std::list<MPI_Comm> contextInterComms; 
    2526 
    2627        static int serverLeader; 
  • XIOS/dev/branch_yushan/src/group_factory.hpp

    r591 r1080  
    7070         /// Propriétés statiques /// 
    7171         static StdString CurrContext; 
     72         //#pragma omp threadprivate(CurrContext) 
    7273 
    7374   }; // class CGroupFactory 
  • XIOS/dev/branch_yushan/src/node/context.cpp

    r1079 r1080  
    243243     int tmp_rank; 
    244244     MPI_Comm_rank(intraComm, &tmp_rank); 
     245     MPI_Barrier(intraComm); 
    245246      
    246      #pragma omp critical (_output) 
    247      printf("Client %d : client = new CContextClient(this,intraComm, interComm, cxtServer) \n", tmp_rank) ; 
     247      
    248248      
    249249     registryIn=new CRegistry(intraComm); 
     250 
     251     #pragma omp critical (_output) 
     252     printf("Client %d : registryIn=new CRegistry(intraComm), &registryIn = %p, registryIn = %p \n", tmp_rank, &registryIn, registryIn) ; 
     253 
     254     // registryIn=new CRegistry; 
     255     // registryIn->communicator = intraComm; 
    250256     registryIn->setPath(getId()) ; 
    251257     if (client->clientRank==0) registryIn->fromFile("xios_registry.bin") ; 
     
    11851191  \return pointer to the new context or already-existed one with identity id 
    11861192  */ 
     1193   //bkp 
     1194//   CContext* CContext::create(const StdString& id) 
     1195//   { 
     1196//     CContext::setCurrent(id); 
     1197 
     1198//     bool hasctxt = CContext::has(id); 
     1199//     CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 
     1200//     getRoot(); 
     1201//     if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 
     1202 
     1203// #define DECLARE_NODE(Name_, name_) \ 
     1204//     C##Name_##Definition::create(C##Name_##Definition::GetDefName()); 
     1205// #define DECLARE_NODE_PAR(Name_, name_) 
     1206// #include "node_type.conf" 
     1207 
     1208//     return (context); 
     1209//   } 
     1210 
     1211 
    11871212  CContext* CContext::create(const StdString& id) 
    11881213  { 
    11891214    CContext::setCurrent(id); 
    11901215 
     1216 
    11911217    bool hasctxt = CContext::has(id); 
    1192     CContext* context = CObjectFactory::CreateObject<CContext>(id).get(); 
    1193     getRoot(); 
    1194     if (!hasctxt) CGroupFactory::AddChild(root, context->getShared()); 
     1218    CContext* context[omp_get_num_threads()]; 
     1219    for(int i=0; i<omp_get_num_threads(); i++) 
     1220    { 
     1221 
     1222     context[i] = CObjectFactory::CreateObject<CContext>(id).get(); 
     1223     getRoot(); 
     1224     if (!hasctxt) CGroupFactory::AddChild(root, context[i]->getShared()); 
    11951225 
    11961226#define DECLARE_NODE(Name_, name_) \ 
    1197     C##Name_##Definition::create(C##Name_##Definition::GetDefName()); 
     1227     C##Name_##Definition::create(C##Name_##Definition::GetDefName()); 
    11981228#define DECLARE_NODE_PAR(Name_, name_) 
    11991229#include "node_type.conf" 
    1200  
    1201     return (context); 
     1230    } 
     1231    int tmp_rank; 
     1232    MPI_Comm_rank(MPI_COMM_WORLD, &tmp_rank); 
     1233    printf("CContext::create : num_threads = %d, my_id = %d, return add = %p\n", omp_get_num_threads(), tmp_rank, &(context[omp_get_thread_num()])); 
     1234     
     1235    return (context[omp_get_thread_num()]); 
    12021236  } 
    1203  
    1204  
    12051237 
    12061238     //! Server side: Receive a message to do some post processing 
  • XIOS/dev/branch_yushan/src/node/context.hpp

    r1072 r1080  
    2121 
    2222 
    23    /// ////////////////////// Déclarations ////////////////////// /// 
     23   /// ////////////////////// Dclarations ////////////////////// /// 
    2424   class CContextGroup; 
    2525   class CContextAttributes; 
     
    224224         CRegistry* registryIn ;  //!< input registry which is read from file 
    225225         CRegistry* registryOut ; //!< output registry which will be wrote on file at the finalize 
     226         //#pragma omp threadprivate(registryIn, registryOut) 
    226227 
    227228      private: 
  • XIOS/dev/branch_yushan/src/object_factory.hpp

    r769 r1080  
    6060         /// Propriétés statiques /// 
    6161         static StdString CurrContext; 
     62         //#pragma omp threadprivate(CurrContext) 
    6263 
    6364   }; // class CObjectFactory 
  • XIOS/dev/branch_yushan/src/registry.hpp

    r1053 r1080  
    2828/** Constructor, the communicator is used for bcast or gather operation between MPI processes */ 
    2929      
    30       CRegistry(const ep_lib::MPI_Comm& comm=MPI_COMM_WORLD) : communicator(comm) {} 
     30      //CRegistry(const ep_lib::MPI_Comm& comm=MPI_COMM_WORLD) : communicator(comm) {} 
     31      CRegistry(const ep_lib::MPI_Comm& comm=MPI_COMM_WORLD) 
     32      { 
     33        communicator = comm; 
     34      } 
    3135       
    3236      
  • XIOS/dev/branch_yushan/src/test/test_omp.f90

    r1079 r1080  
    3636 
    3737  CALL MPI_INIT_THREAD(3, provided, ierr) 
     38  print*, "provided = ", provided 
     39   
    3840  CALL init_wait 
    3941 
     
    7981  print*, "xios init OK", rank, size 
    8082 
     83 
    8184   CALL xios_context_initialize("test",comm) 
    82  
    8385   print*, "xios_context init OK", rank, size  
    84  
    85   !CALL xios_context_finalize() 
    86  
    87    
     86    
     87    CALL xios_get_handle("test",ctx_hdl) 
     88    print*, "xios_get_handle OK", rank, size  
     89    
     90    CALL xios_set_current_context(ctx_hdl) 
     91    print*, "xios_set_current_context OK", rank, size  
     92  
     93    CALL xios_get_calendar_type(calendar_type) 
     94    print*, "xios_get_calendar_type OK", rank, size  
     95 
     96  !CALL xios_context_finalize()   
    8897  !print*, "xios_context finalize OK", rank, size  
    8998 
     
    175184  print *, "Client : xios_finalize " 
    176185 
    177    else 
    178  
    179    CALL xios_init_server 
    180    print *, "Server : xios_finalize " 
    181    
    182    endif 
     186    else 
     187 
     188    CALL xios_init_server 
     189    print *, "Server : xios_finalize " 
     190   
     191    endif 
    183192     
    184193 
  • XIOS/dev/branch_yushan/src/xml_parser.cpp

    r1073 r1080  
    1111   namespace xml 
    1212   { 
    13       /// ////////////////////// Définitions ////////////////////// /// 
     13      /// ////////////////////// Dfinitions ////////////////////// /// 
    1414 
    1515      void CXMLParser::ParseFile(const StdString & filename, const std::set<StdString>& parseContextList) 
Note: See TracChangeset for help on using the changeset viewer.