Changeset 1079
- Timestamp:
- 03/17/17 18:02:20 (6 years ago)
- Location:
- XIOS/dev/branch_yushan
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan/bld.cfg
r1073 r1079 33 33 #bld::target libxios.a 34 34 #bld::target generate_fortran_interface.exe 35 #bld::target xios_server.exe35 bld::target xios_server.exe 36 36 #bld::target test_remap.exe 37 37 #bld::target test_new_features.exe test_unstruct_complete.exe -
XIOS/dev/branch_yushan/extern/src_ep_dev/ep_fortran.cpp
r1072 r1079 26 26 { 27 27 fc_comm_map.insert(std::make_pair( std::make_pair( fint, omp_get_thread_num()) , comm)); 28 // printf("EP_Comm_c2f : MAP insert: %d, %d, %p\n", fint, omp_get_thread_num(), &comm);28 printf("EP_Comm_c2f : MAP insert: %d, %d, %p\n", fint, omp_get_thread_num(), comm.ep_comm_ptr); 29 29 } 30 30 … … 46 46 MPI_Comm comm_ptr; 47 47 comm_ptr = it->second; 48 // printf("EP_Comm_f2c : MAP find: %d, %d, %p\n", it->first.first, it->first.second, it->second);48 printf("EP_Comm_f2c : MAP find: %d, %d, %p\n", it->first.first, it->first.second, comm_ptr.ep_comm_ptr); 49 49 return comm_ptr; 50 50 } -
XIOS/dev/branch_yushan/src/client.cpp
r1074 r1079 38 38 // localComm doesn't given 39 39 40 printf("check : localComm == MPI_COMM_NULL = %d\n", localComm == MPI_COMM_NULL);41 42 40 if (localComm == MPI_COMM_NULL) 43 41 { … … 69 67 MPI_Comm_rank(CXios::globalComm,&rank); 70 68 71 printf("client init : codeId = %s, xiosCodeId = %s, rank = %d(%d), size = %d\n", codeId, CXios::xiosCodeId, rank, omp_get_thread_num(), size);69 printf("client init : rank = %d, size = %d\n", rank, size); 72 70 73 71 … … 107 105 if (CXios::usingServer) 108 106 { 109 int clientLeader=leaders[hashClient] ;107 //int clientLeader=leaders[hashClient] ; 110 108 serverLeader=leaders[hashServer] ; 111 109 … … 116 114 { 117 115 info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize 118 <<" intraCommRank :"<<intraCommRank<<" serverLeader "<< serverLeader<<endl ; 116 <<" intraCommRank :"<<intraCommRank<<" serverLeader "<< serverLeader 117 <<" globalComm : "<< &(CXios::globalComm) << endl ; 119 118 } 120 119 121 120 MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ; 121 122 int interCommSize, interCommRank ; 123 MPI_Comm_size(interComm,&interCommSize) ; 124 MPI_Comm_rank(interComm,&interCommRank) ; 125 126 #pragma omp critical(_output) 127 { 128 info(50)<<" interCommRank :"<<interCommRank 129 <<" interCommSize : "<< interCommSize << endl ; 130 } 131 122 132 123 133 } … … 176 186 void CClient::registerContext(const string& id,MPI_Comm contextComm) 177 187 { 188 //info(50) << "Client "<<getRank() << " start registerContext using info output" << endl; 189 printf("Client %d start registerContext\n", getRank()); 190 //printf("Client start registerContext\n"); 191 178 192 CContext::setCurrent(id) ; 179 CContext* context=CContext::create(id); 193 printf("Client %d CContext::setCurrent OK\n", getRank()); 194 CContext* context = CContext::create(id); 195 printf("Client %d context=CContext::create(%s) OK\n", getRank(), id); 196 180 197 StdString idServer(id); 181 198 idServer += "_server"; 182 199 183 if (!CXios::isServer) 200 if (!CXios::isServer) // server mode 184 201 { 185 202 int size,rank,globalRank ; … … 211 228 212 229 MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 213 //info(10)<<"Register new Context : "<<id<<endl ; 230 231 #pragma omp critical (_output) 232 info(10)<<"Register new Context : "<<id<<endl ; 214 233 215 234 … … 217 236 MPI_Intercomm_merge(contextInterComm,0,&inter) ; 218 237 MPI_Barrier(inter) ; 238 239 #pragma omp critical (_output) 240 printf("Client %d : MPI_Intercomm_merge OK \n", getRank()) ; 219 241 220 242 221 243 context->initClient(contextComm,contextInterComm) ; 244 #pragma omp critical (_output) 245 printf("Client %d : context->initClient(contextComm,contextInterComm) OK \n", getRank()) ; 222 246 223 247 … … 225 249 MPI_Comm_free(&inter); 226 250 } 227 else 251 else // attached mode 228 252 { 229 253 MPI_Comm contextInterComm ; -
XIOS/dev/branch_yushan/src/client.hpp
r1073 r1079 25 25 26 26 static int serverLeader; 27 #pragma omp threadprivate(serverLeader)27 //#pragma omp threadprivate(serverLeader) 28 28 29 29 static bool is_MPI_Initialized ; 30 #pragma omp threadprivate(is_MPI_Initialized)30 //#pragma omp threadprivate(is_MPI_Initialized) 31 31 32 32 //! Get rank of the current process … … 52 52 53 53 static StdOFStream m_infoStream; 54 #pragma omp threadprivate(m_infoStream)54 //#pragma omp threadprivate(m_infoStream) 55 55 56 56 static StdOFStream m_errorStream; 57 #pragma omp threadprivate(m_errorStream)57 //#pragma omp threadprivate(m_errorStream) 58 58 59 59 static void openStream(const StdString& fileName, const StdString& ext, std::filebuf* fb); -
XIOS/dev/branch_yushan/src/cxios.cpp
r1074 r1079 22 22 bool CXios::isServer ; 23 23 MPI_Comm CXios::globalComm ; 24 24 25 bool CXios::usingOasis ; 25 26 bool CXios::usingServer = false; … … 72 73 { 73 74 num_ep = omp_get_num_threads(); 74 printf("Client %d: num_ep = %d\n", omp_get_thread_num(), num_ep);75 //printf("Client %d: num_ep = %d\n", omp_get_thread_num(), num_ep); 75 76 } 76 77 … … 78 79 { 79 80 num_ep = omp_get_num_threads(); 80 printf("Server %d: num_ep = %d\n", omp_get_thread_num(), num_ep);81 //printf("Server %d: num_ep = %d\n", omp_get_thread_num(), num_ep); 81 82 } 82 83 … … 90 91 91 92 #pragma omp barrier 92 93 globalComm = passage[omp_get_thread_num()]; 94 95 int tmp_rank; 96 MPI_Comm_rank(globalComm, &tmp_rank); 97 if(isClient) printf("client thread %d/%d\n", omp_get_thread_num(), tmp_rank); 98 if(isServer) printf("server thread %d/%d\n", omp_get_thread_num(), tmp_rank); 93 94 95 CXios::globalComm = passage[omp_get_thread_num()]; 96 97 // int tmp_rank; 98 // MPI_Comm_rank(CXios::globalComm, &tmp_rank); 99 // if(isClient) printf("client thread %d/%d, globalComm = %p\n", omp_get_thread_num(), tmp_rank, &(CXios::globalComm)); 100 //if(isServer) printf("server thread %d/%d, globalComm = %p\n", omp_get_thread_num(), tmp_rank, &globalComm); 99 101 100 102 } … … 112 114 initialize() ; 113 115 114 115 116 116 CClient::initialize(codeId,localComm,returnComm) ; 117 118 117 119 118 if (CClient::getRank()==0) globalRegistry = new CRegistry(returnComm) ; -
XIOS/dev/branch_yushan/src/cxios.hpp
r1074 r1079 44 44 45 45 static bool isClient ; //!< Check if xios is client 46 #pragma omp threadprivate(isClient)46 //#pragma omp threadprivate(isClient) 47 47 48 48 static bool isServer ; //!< Check if xios is server 49 #pragma omp threadprivate(isServer)49 //#pragma omp threadprivate(isServer) 50 50 51 51 static MPI_Comm globalComm ; //!< Global communicator … … 53 53 54 54 static bool printLogs2Files; //!< Printing out logs into files 55 #pragma omp threadprivate(printLogs2Files)55 //#pragma omp threadprivate(printLogs2Files) 56 56 57 57 static bool usingOasis ; //!< Using Oasis 58 #pragma omp threadprivate(usingOasis)58 //#pragma omp threadprivate(usingOasis) 59 59 60 60 static bool usingServer ; //!< Using server (server mode) 61 #pragma omp threadprivate(usingServer)61 //#pragma omp threadprivate(usingServer) 62 62 63 63 static double bufferSizeFactor; //!< Factor used to tune the buffer size 64 #pragma omp threadprivate(bufferSizeFactor)64 //#pragma omp threadprivate(bufferSizeFactor) 65 65 66 66 static const double defaultBufferSizeFactor; //!< Default factor value 67 #pragma omp threadprivate(defaultBufferSizeFactor)67 //#pragma omp threadprivate(defaultBufferSizeFactor) 68 68 69 69 static StdSize minBufferSize; //!< Minimum buffer size 70 #pragma omp threadprivate(minBufferSize)70 //#pragma omp threadprivate(minBufferSize) 71 71 72 72 static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible) 73 #pragma omp threadprivate(isOptPerformance)73 //#pragma omp threadprivate(isOptPerformance) 74 74 75 75 static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers 76 #pragma omp threadprivate(globalRegistry)76 //#pragma omp threadprivate(globalRegistry) 77 77 78 78 public: -
XIOS/dev/branch_yushan/src/indent_xml.cpp
r1072 r1079 15 15 { 16 16 static unsigned int LineNB = 1; 17 #pragma omp threadprivate(LineNB)17 //#pragma omp threadprivate(LineNB) 18 18 19 19 if (CIndent::WithLine) out << LineNB++ << ". "; -
XIOS/dev/branch_yushan/src/io/netCdf_cf_constant.hpp
r1072 r1079 16 16 static const StdString XIOS_CF_coordinates; 17 17 static const StdString XIOS_CF_bounds; 18 }; 18 19 19 #pragma omp threadprivate(XIOS_CF_units, XIOS_CF_standard_name, XIOS_CF_coordinates, XIOS_CF_bounds)20 };21 20 const StdString CCFKeywords::XIOS_CF_units("units"); 22 21 const StdString CCFKeywords::XIOS_CF_standard_name("standard_name"); -
XIOS/dev/branch_yushan/src/node/context.cpp
r1074 r1079 240 240 hasClient=true; 241 241 client = new CContextClient(this,intraComm, interComm, cxtServer); 242 243 int tmp_rank; 244 MPI_Comm_rank(intraComm, &tmp_rank); 245 246 #pragma omp critical (_output) 247 printf("Client %d : client = new CContextClient(this,intraComm, interComm, cxtServer) \n", tmp_rank) ; 248 242 249 registryIn=new CRegistry(intraComm); 243 250 registryIn->setPath(getId()) ; … … 247 254 registryOut=new CRegistry(intraComm) ; 248 255 registryOut->setPath(getId()) ; 256 #pragma omp critical (_output) 257 printf("Client %d : registryOut->setPath(getId()) \n", tmp_rank) ; 249 258 250 259 ep_lib::MPI_Comm intraCommServer, interCommServer; -
XIOS/dev/branch_yushan/src/parse_expr/lex_parser.cpp
r1072 r1079 264 264 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 265 265 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ 266 #pragma omp threadprivate(yy_buffer_stack_top, yy_buffer_stack_max, yy_buffer_stack)266 //#pragma omp threadprivate(yy_buffer_stack_top, yy_buffer_stack_max, yy_buffer_stack) 267 267 268 268 /* We provide macros for accessing buffer states in case in the … … 284 284 static char yy_hold_char; 285 285 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ 286 #pragma omp threadprivate(yy_hold_char, yy_n_chars)286 //#pragma omp threadprivate(yy_hold_char, yy_n_chars) 287 287 288 288 yy_size_t yyleng; … … 292 292 static int yy_init = 0; /* whether we need to initialize */ 293 293 static int yy_start = 0; /* start state number */ 294 #pragma omp threadprivate(yy_c_buf_p, yy_init, yy_start)294 //#pragma omp threadprivate(yy_c_buf_p, yy_init, yy_start) 295 295 296 296 /* Flag which is used to allow yywrap()'s to do buffer switches … … 298 298 */ 299 299 static int yy_did_buffer_switch_on_eof; 300 #pragma omp threadprivate(yy_did_buffer_switch_on_eof)300 //#pragma omp threadprivate(yy_did_buffer_switch_on_eof) 301 301 302 302 void yyrestart (FILE *input_file ); … … 987 987 988 988 } ; 989 #pragma omp threadprivate(yy_nxt)989 //#pragma omp threadprivate(yy_nxt) 990 990 991 991 static yy_state_type yy_get_previous_state (void ); … … 1032 1032 } ; 1033 1033 1034 #pragma omp threadprivate(yy_accept, yy_last_accepting_state, yy_last_accepting_cpos, yy_NUL_trans)1034 //#pragma omp threadprivate(yy_accept, yy_last_accepting_state, yy_last_accepting_cpos, yy_NUL_trans) 1035 1035 1036 1036 extern int yy_flex_debug; -
XIOS/dev/branch_yushan/src/server.cpp
r1072 r1079 268 268 int flag = false ; 269 269 static void* buffer ; 270 #pragma omp threadprivate(buffer)270 //#pragma omp threadprivate(buffer) 271 271 272 272 static MPI_Request request ; 273 #pragma omp threadprivate(request)273 //#pragma omp threadprivate(request) 274 274 275 275 static bool recept=false ; 276 #pragma omp threadprivate(recept)276 //#pragma omp threadprivate(recept) 277 277 278 278 int rank ; … … 370 370 int flag ; 371 371 static void* buffer ; 372 #pragma omp threadprivate(buffer)372 //#pragma omp threadprivate(buffer) 373 373 374 374 static MPI_Request request ; 375 #pragma omp threadprivate(request)375 //#pragma omp threadprivate(request) 376 376 377 377 static bool recept=false ; 378 #pragma omp threadprivate(recept)378 //#pragma omp threadprivate(recept) 379 379 380 380 int rank ; … … 432 432 433 433 434 CContext* context =CContext::create(contextId);434 CContext* context = CContext::create(contextId); 435 435 contextList[contextId]=context; 436 436 context->initServer(intraComm,contextIntercomm); -
XIOS/dev/branch_yushan/src/test/test_client.f90
r1073 r1079 37 37 CALL init_wait 38 38 39 CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr)40 if(rank < 2) then39 !CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 40 !if(rank < 2) then 41 41 42 42 … … 153 153 print *, "Client : xios_finalize " 154 154 155 else155 ! else 156 156 157 CALL xios_init_server158 print *, "Server : xios_finalize "157 ! CALL xios_init_server 158 ! print *, "Server : xios_finalize " 159 159 160 endif160 ! endif 161 161 162 162 -
XIOS/dev/branch_yushan/src/test/test_omp.f90
r1074 r1079 79 79 print*, "xios init OK", rank, size 80 80 81 !CALL xios_context_initialize("test",comm)81 CALL xios_context_initialize("test",comm) 82 82 83 !print*, "xios_context init OK", rank, size83 print*, "xios_context init OK", rank, size 84 84 85 85 !CALL xios_context_finalize() … … 88 88 !print*, "xios_context finalize OK", rank, size 89 89 90 91 90 92 !$omp end parallel 91 93 94 call MPI_Abort(ierr) 92 95 93 96 -
XIOS/dev/branch_yushan/src/transformation/Functions/reduction.hpp
r1072 r1079 59 59 typedef std::map<EReductionType, CreateOperationCallBack> CallBackMap; 60 60 static CallBackMap* reductionCreationCallBacks_; 61 #pragma omp threadprivate(reductionCreationCallBacks_)61 //#pragma omp threadprivate(reductionCreationCallBacks_) 62 62 63 63 static bool registerOperation(EReductionType reduceType, CreateOperationCallBack createFn); … … 67 67 static bool initReductionOperation(std::map<StdString,EReductionType>& m); 68 68 static bool _dummyInit; 69 #pragma omp threadprivate(_dummyInit)69 //#pragma omp threadprivate(_dummyInit) 70 70 }; 71 71 -
XIOS/dev/branch_yushan/src/transformation/grid_transformation_factory_impl.hpp
r1072 r1079 57 57 typedef std::map<ETranformationType, CreateTransformationCallBack> CallBackMap; 58 58 static CallBackMap* transformationCreationCallBacks_; 59 #pragma omp threadprivate(transformationCreationCallBacks_)59 //#pragma omp threadprivate(transformationCreationCallBacks_) 60 60 61 61 static bool registerTransformation(ETranformationType transType, CreateTransformationCallBack createFn); 62 62 static bool unregisterTransformation(ETranformationType transType); 63 63 static bool initializeTransformation_; 64 #pragma omp threadprivate(initializeTransformation_)64 //#pragma omp threadprivate(initializeTransformation_) 65 65 }; 66 66
Note: See TracChangeset
for help on using the changeset viewer.