Changeset 1128 for XIOS/dev/branch_yushan/src/cxios.cpp
- Timestamp:
- 05/11/17 16:12:23 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan/src/cxios.cpp
r1126 r1128 14 14 namespace xios 15 15 { 16 17 extern int test_omp_rank; 18 #pragma omp threadprivate(test_omp_rank) 19 16 20 const string CXios::rootFile="./iodef.xml" ; 17 21 const string CXios::xiosCodeId="xios.x" ; 18 22 const string CXios::clientFile="./xios_client"; 19 23 const string CXios::serverFile="./xios_server"; 20 //#pragma omp threadprivate(CXios::rootFile, CXios::xiosCodeId, CXios::clientFile, CXios::serverFile) 24 21 25 22 26 bool CXios::isClient ; 23 27 bool CXios::isServer ; 24 //#pragma omp threadprivate(CXios::isServer, CXios::isClient) 28 25 29 26 30 MPI_Comm CXios::globalComm ; 27 //#pragma omp threadprivate(CXios::globalComm) 31 28 32 29 33 bool CXios::usingOasis ; 30 34 bool CXios::usingServer = false; 31 // #pragma omp threadprivate(CXios::usingOasis, CXios::usingServer) 35 32 36 33 37 double CXios::bufferSizeFactor = 1.0; 34 38 const double CXios::defaultBufferSizeFactor = 1.0; 35 39 StdSize CXios::minBufferSize = 1024 * sizeof(double); 36 //#pragma omp threadprivate(CXios::bufferSizeFactor, CXios::defaultBufferSizeFactor, CXios::minBufferSize) 40 37 41 38 42 bool CXios::printLogs2Files; 39 43 bool CXios::isOptPerformance = true; 40 44 CRegistry* CXios::globalRegistry = 0; 41 //#pragma omp threadprivate(CXios::printLogs2Files, CXios::isOptPerformance) 45 42 46 43 47 … … 46 50 { 47 51 set_new_handler(noMemory); 52 48 53 49 54 #pragma omp critical … … 80 85 bufferSizeFactor = getin<double>("buffer_size_factor", defaultBufferSizeFactor); 81 86 minBufferSize = getin<int>("min_buffer_size", 1024 * sizeof(double)); 87 82 88 83 89 int num_ep; … … 85 91 { 86 92 num_ep = omp_get_num_threads(); 87 //printf("Client %d: num_ep = %d\n", omp_get_thread_num(), num_ep);88 93 } 89 94 … … 91 96 { 92 97 num_ep = omp_get_num_threads(); 93 //printf("Server %d: num_ep = %d\n", omp_get_thread_num(), num_ep);94 98 } 95 99 … … 109 113 int tmp_rank; 110 114 MPI_Comm_rank(CXios::globalComm, &tmp_rank); 111 if(isClient) printf("client thread %d/%d, globalComm = %p, passage = %p\n", 112 omp_get_thread_num(), tmp_rank, 113 &(CXios::globalComm), passage); 114 //if(isServer) printf("server thread %d/%d, globalComm = %p\n", omp_get_thread_num(), tmp_rank, &globalComm); 115 116 117 test_omp_rank = tmp_rank; 115 118 116 119 } … … 136 139 isServer = !usingServer; 137 140 138 //printf("CXios::initClientSide OK, printLogs2Files = %d\n", printLogs2Files);139 140 141 if (printLogs2Files) 141 142 { 143 #pragma omp critical 142 144 CClient::openInfoStream(clientFile); 143 //CClient::openErrorStream(clientFile);145 CClient::openErrorStream(clientFile); 144 146 } 145 147 else … … 157 159 if (CClient::getRank()==0) 158 160 { 159 //info(80)<<"Write data base Registry"<<endl<<globalRegistry->toString()<<endl ; 161 #pragma omp critical (_output) 162 info(80)<<"Write data base Registry"<<endl<<globalRegistry->toString()<<endl ; 160 163 globalRegistry->toFile("xios_registry.bin") ; 161 164 delete globalRegistry ; 162 165 } 163 166 CClient::closeInfoStream(); 167 164 168 165 169 … … 189 193 190 194 xml::CXMLParser::ParseFile(rootFile, parseList); 191 195 192 196 parseXiosConfig(); 193 197 }
Note: See TracChangeset
for help on using the changeset viewer.