Changeset 1601 for XIOS/dev/dev_trunk_omp/src/cxios.cpp
- Timestamp:
- 11/19/18 15:52:54 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/cxios.cpp
r1519 r1601 11 11 #include "memtrack.hpp" 12 12 #include "registry.hpp" 13 using namespace ep_lib; 13 14 14 15 namespace xios 15 16 { 16 string CXios::rootFile="./iodef.xml" ;17 string CXios::xiosCodeId="xios.x" ;18 string CXios::clientFile="./xios_client";19 string CXios::serverFile="./xios_server";20 string CXios::serverPrmFile="./xios_server1";21 string CXios::serverSndFile="./xios_server2";17 const string CXios::rootFile="./iodef.xml" ; 18 const string CXios::xiosCodeId="xios.x" ; 19 const string CXios::clientFile="./xios_client"; 20 const string CXios::serverFile="./xios_server"; 21 const string CXios::serverPrmFile="./xios_server1"; 22 const string CXios::serverSndFile="./xios_server2"; 22 23 23 24 bool CXios::isClient ; … … 43 44 { 44 45 set_new_handler(noMemory); 45 parseFile(rootFile); 46 int tmp_rank; 47 MPI_Comm_rank(MPI_COMM_WORLD, &tmp_rank); 48 #pragma omp critical 49 { 50 std::cout<<"thread "<<tmp_rank<<"("<<omp_get_thread_num()<<")"<<" parsing rootfile"<<std::endl; 51 parseFile(rootFile); 52 std::cout<<"thread "<<tmp_rank<<"("<<omp_get_thread_num()<<")"<<" parsed rootfile"<<std::endl; 53 } 54 #pragma omp barrier 46 55 parseXiosConfig(); 47 56 } … … 81 90 checkEventSync = getin<bool>("check_event_sync", checkEventSync); 82 91 83 globalComm=MPI_COMM_WORLD ; 92 //globalComm=MPI_COMM_WORLD ; 93 int num_ep; 94 if(isClient) 95 { 96 num_ep = omp_get_num_threads(); 97 } 98 99 if(isServer) 100 { 101 num_ep = 1; 102 } 103 104 MPI_Info info; 105 #pragma omp master 106 { 107 MPI_Comm *ep_comm; 108 MPI_Comm_create_endpoints(MPI_COMM_WORLD->mpi_comm, num_ep, info, ep_comm); // servers should reach here too. 109 passage = ep_comm; 110 } 111 112 #pragma omp barrier 113 114 115 CXios::globalComm = passage[omp_get_thread_num()]; 84 116 } 85 117 … … 92 124 void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) 93 125 { 126 isClient = true; 127 isServer = false; 128 94 129 initialize() ; 95 96 isClient = true;97 130 98 131 CClient::initialize(codeId,localComm,returnComm) ; … … 105 138 if (printLogs2Files) 106 139 { 140 #pragma omp critical 107 141 CClient::openInfoStream(clientFile); 108 142 CClient::openErrorStream(clientFile); … … 120 154 if (CClient::getRank()==0) 121 155 { 156 #pragma omp critical (_output) 122 157 info(80)<<"Write data base Registry"<<endl<<globalRegistry->toString()<<endl ; 123 158 globalRegistry->toFile("xios_registry.bin") ; … … 155 190 void CXios::initServerSide(void) 156 191 { 157 initServer(); 192 158 193 isClient = false; 159 194 isServer = true; 195 196 initServer(); 160 197 161 198 // Initialize all aspects MPI
Note: See TracChangeset
for help on using the changeset viewer.