Changeset 1605 for XIOS


Ignore:
Timestamp:
11/21/18 10:21:44 (5 years ago)
Author:
yushan
Message:

branch_openmp merged and tested with trunk r1597

Location:
XIOS/dev/dev_trunk_omp
Files:
6 added
8 edited

Legend:

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

    r1510 r1605  
    4141src::netcdf $PWD/extern/netcdf4 
    4242src::remap $PWD/extern/remap/src 
     43src::src_ep_dev $PWD/extern/src_ep_dev 
    4344bld::lib xios 
    4445bld::target libxios.a  
    4546#bld::target generate_fortran_interface.exe  
    4647#bld::target test_remap.exe 
    47 bld::target xios_server.exe  
     48#bld::target xios_server.exe  
    4849#bld::target test_regular.exe 
    4950#bld::target test_xios2_cmip6.exe 
     
    5152#bld::target test_remap.exe 
    5253#bld::target test_complete.exe 
     54bld::target test_complete_omp.exe 
    5355#bld::target test_client.exe 
     56bld::target test_omp.exe 
    5457#bld::target test_unstruct_complete.exe 
    5558#bld::target test_unstructured.exe 
     
    8083bld::excl_dep        use::netcdf 
    8184bld::excl_dep        inc::mpif.h 
     85bld::excl_dep        use::omp_lib 
  • XIOS/dev/dev_trunk_omp/extern/ep_dev/ep_create.cpp

    r1604 r1605  
    124124      for(int j=0; j<recv_num_ep[i]; j++) 
    125125      { 
    126         out_comm_hdls[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(ind, j, i)); 
     126        //out_comm_hdls[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(ind, j, i)); 
     127        (*(out_comm_hdls[0]->ep_rank_map))[ind] = std::make_pair(j, i); 
    127128        ind++; 
    128129      } 
  • XIOS/dev/dev_trunk_omp/extern/ep_dev/ep_split.cpp

    r1604 r1605  
    286286          for(int i=0; i<new_ep_size; i++) 
    287287          { 
    288             (*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(my_triple_vector_recv[3*i], my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2])); 
     288            //(*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(my_triple_vector_recv[3*i], my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2])); 
     289            (*((*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map))[my_triple_vector_recv[3*i]] = std::make_pair( my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2]); 
    289290          } 
    290291           
  • XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_create.cpp

    r1603 r1605  
    124124      for(int j=0; j<recv_num_ep[i]; j++) 
    125125      { 
    126         out_comm_hdls[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(ind, j, i)); 
     126        //out_comm_hdls[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(ind, j, i)); 
     127        (*(out_comm_hdls[0]->ep_rank_map))[ind] = std::make_pair(j,i);//->insert(std::pair< int, std::pair<int,int> >(ind, j, i)); 
    127128        ind++; 
    128129      } 
  • XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_fortran.cpp

    r1603 r1605  
    88 
    99 
    10 namespace ep_lib 
    11 { 
     10//namespace ep_lib 
     11//{ 
    1212 
    13   void* EP_Comm_c2f(MPI_Comm comm) 
     13  void* EP_Comm_c2f(ep_lib::MPI_Comm comm) 
    1414  { 
    1515    Debug("MPI_Comm_c2f"); 
    16     void* fint = new ::MPI_Fint; 
     16    void* fint = new MPI_Fint; 
    1717    #ifdef _intelmpi 
    1818    *static_cast< ::MPI_Fint*>(fint) = (::MPI_Fint)(to_mpi_comm(comm->mpi_comm)); 
    1919    #elif _openmpi 
    20     *static_cast< ::MPI_Fint*>(fint) = MPI_Comm_c2f(to_mpi_comm(comm->mpi_comm)); 
     20    *static_cast< MPI_Fint*>(fint) = MPI_Comm_c2f(to_mpi_comm(comm->mpi_comm)); 
    2121    #endif 
    2222     
    23     std::map<std::pair< ::MPI_Fint, int>, MPI_Comm > ::iterator it; 
     23    std::map<std::pair< MPI_Fint, int>, ep_lib::MPI_Comm > ::iterator it; 
    2424     
    2525    #pragma omp critical (fc_comm_map) 
    2626    { 
    27       it = fc_comm_map.find(std::make_pair(*static_cast< ::MPI_Fint*>(fint), omp_get_thread_num())); 
    28       if(it == fc_comm_map.end()) 
     27      it = ep_lib::fc_comm_map.find(std::make_pair(*static_cast< MPI_Fint*>(fint), omp_get_thread_num())); 
     28      if(it == ep_lib::fc_comm_map.end()) 
    2929      { 
    30         fc_comm_map.insert(std::make_pair( std::make_pair( *static_cast< ::MPI_Fint*>(fint), omp_get_thread_num()) , comm)); 
    31         printf("EP_Comm_c2f : MAP %p insert: %d, %d, %p\n", &fc_comm_map, *static_cast< ::MPI_Fint*>(fint), omp_get_thread_num(), comm->ep_comm_ptr); 
     30        ep_lib::fc_comm_map.insert(std::make_pair( std::make_pair( *static_cast< MPI_Fint*>(fint), omp_get_thread_num()) , comm)); 
     31        printf("EP_Comm_c2f : MAP %p insert: %d, %d, %p\n", &(ep_lib::fc_comm_map), *static_cast< MPI_Fint*>(fint), omp_get_thread_num(), comm->ep_comm_ptr); 
    3232      } 
    3333    } 
     
    3838  } 
    3939 
    40   MPI_Comm EP_Comm_f2c(void* comm) 
     40  ep_lib::MPI_Comm EP_Comm_f2c(void* comm) 
    4141  { 
    4242    Debug("MPI_Comm_f2c"); 
    4343     
    4444     
    45     std::map<std::pair< ::MPI_Fint, int>, MPI_Comm > ::iterator it; 
     45    std::map<std::pair< MPI_Fint, int>, ep_lib::MPI_Comm > ::iterator it; 
    4646     
    4747    #pragma omp critical (fc_comm_map) 
    48     it = fc_comm_map.find(std::make_pair(*static_cast< ::MPI_Fint*>(comm), omp_get_thread_num())); 
     48    it = ep_lib::fc_comm_map.find(std::make_pair(*static_cast< MPI_Fint*>(comm), omp_get_thread_num())); 
    4949     
    50     if(it != fc_comm_map.end()) 
     50    if(it != ep_lib::fc_comm_map.end()) 
    5151    { 
    52       MPI_Comm comm_ptr; 
     52      ep_lib::MPI_Comm comm_ptr; 
    5353      comm_ptr = it->second; 
    54       printf("EP_Comm_f2c : MAP %p find: %d, %d, %p\n", &fc_comm_map, it->first.first, it->first.second, comm_ptr->ep_comm_ptr); 
     54      printf("EP_Comm_f2c : MAP %p find: %d, %d, %p\n", &(ep_lib::fc_comm_map), it->first.first, it->first.second, comm_ptr->ep_comm_ptr); 
    5555      return  comm_ptr; 
    5656    } 
     
    5858       
    5959     
     60    MPI_Comm *base_comm = new MPI_Comm; 
    6061    #ifdef _intelmpi 
    61     ::MPI_Comm *base_comm = new ::MPI_Comm; 
    62     *base_comm = (::MPI_Comm)(*static_cast< ::MPI_Fint*>(comm)); 
     62    *base_comm = (MPI_Comm)(*static_cast< MPI_Fint*>(comm)); 
    6363    #elif _openmpi 
    64     ::MPI_Comm *base_comm = ::MPI_Comm_f2c(*static_cast< ::MPI_Fint*>(comm)); 
     64    *base_comm = MPI_Comm_f2c(*static_cast< MPI_Fint*>(comm)); 
    6565    #endif 
    6666 
     
    7070      { 
    7171        int num_ep = omp_get_num_threads(); 
    72         MPI_Comm *new_comm; 
    73         MPI_Info info; 
    74         MPI_Comm_create_endpoints(base_comm, num_ep, info, new_comm); 
    75         passage = new_comm; 
     72        ep_lib::MPI_Comm *new_comm; 
     73        ep_lib::MPI_Info info; 
     74        ep_lib::MPI_Comm_create_endpoints(base_comm, num_ep, info, new_comm); 
     75        ep_lib::passage = new_comm; 
    7676      } 
    7777      #pragma omp barrier 
    7878 
    79       MPI_Comm return_comm = passage[omp_get_thread_num()]; 
     79      ep_lib::MPI_Comm return_comm = ep_lib::passage[omp_get_thread_num()]; 
    8080      return return_comm; 
    8181         
     
    8585  } 
    8686 
    87 } 
     87//} 
    8888 
    8989 
  • XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_lib_fortran.hpp

    r1603 r1605  
    44#include "ep_type.hpp" 
    55 
    6 namespace ep_lib 
    7 { 
     6//namespace ep_lib 
     7//{ 
    88 
    9   void* EP_Comm_c2f(MPI_Comm comm); 
    10   MPI_Comm EP_Comm_f2c(void* comm); 
    11 } 
     9  void* EP_Comm_c2f(ep_lib::MPI_Comm comm); 
     10  ep_lib::MPI_Comm EP_Comm_f2c(void* comm); 
     11//} 
    1212 
    1313 
  • XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_split.cpp

    r1603 r1605  
    286286          for(int i=0; i<new_ep_size; i++) 
    287287          { 
    288             (*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(my_triple_vector_recv[3*i], my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2])); 
     288            //(*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(my_triple_vector_recv[3*i], my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2])); 
     289            (*((*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map)) [ my_triple_vector_recv[3*i] ] = std::make_pair(my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2]); 
    289290          } 
    290291           
  • XIOS/dev/dev_trunk_omp/src/interface/c/icdata.cpp

    r1601 r1605  
    6767      #elif _usingEP 
    6868      ep_lib::fc_comm_map.clear(); 
    69       if (initialized) local_comm=ep_lib::EP_Comm_f2c((f_local_comm)); 
     69      if (initialized) local_comm=EP_Comm_f2c((f_local_comm)); 
    7070      else local_comm=MPI_COMM_NULL; 
    7171      #endif 
     
    7777      *f_return_comm=MPI_Comm_c2f(return_comm); 
    7878      #elif _usingEP 
    79       *f_return_comm=*static_cast<MPI_Fint*>(ep_lib::EP_Comm_c2f(return_comm)); 
     79      *f_return_comm=*static_cast<MPI_Fint*>(EP_Comm_c2f(return_comm)); 
    8080      #endif 
    8181      CTimer::get("XIOS init").suspend(); 
     
    9494     comm=MPI_Comm_f2c(*f_comm); 
    9595     #elif _usingEP 
    96      comm = ep_lib::EP_Comm_f2c(f_comm); 
     96     comm = EP_Comm_f2c(f_comm); 
    9797     #endif 
    9898     CClient::registerContext(str, comm); 
Note: See TracChangeset for help on using the changeset viewer.