Changeset 1680 for XIOS/dev/dev_trunk_omp/src/parse_expr
- Timestamp:
- 07/08/19 16:58:12 (5 years ago)
- Location:
- XIOS/dev/dev_trunk_omp/src/parse_expr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/parse_expr/filter_expr_node.cpp
r1677 r1680 106 106 std::shared_ptr<COutputPin> CFilterUnaryOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 107 107 { 108 std::shared_ptr<COutputPin> ch = child->reduce(gc, thisField); 109 108 110 std::shared_ptr<CUnaryArithmeticFilter> filter(new CUnaryArithmeticFilter(gc, opId)); 109 child->reduce(gc, thisField)->connectOutput(filter, 0); 110 111 (filter->parent_filters).resize(1); 112 (filter->parent_filters)[0] = child->reduce(gc, thisField); 111 ch->connectOutput(filter, 0); 112 113 (filter->parent_filters).resize(1); 114 (filter->parent_filters)[0] = ch; 115 116 filter->tag = ch->tag; 117 filter->start_graph = ch->start_graph; 118 filter->end_graph = ch->end_graph; 119 filter->field = &thisField; 120 113 121 114 122 return filter; … … 127 135 std::shared_ptr<COutputPin> CFilterScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 128 136 { 137 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 129 138 std::shared_ptr<CScalarFieldArithmeticFilter> filter(new CScalarFieldArithmeticFilter(gc, opId, child1->reduce())); 130 ch ild2->reduce(gc, thisField)->connectOutput(filter, 0);139 ch2->connectOutput(filter, 0); 131 140 132 141 (filter->parent_filters).resize(1); 133 (filter->parent_filters)[0] = child2->reduce(gc, thisField); 142 (filter->parent_filters)[0] = ch2; 143 144 filter->tag = ch2->tag; 145 filter->start_graph = ch2->start_graph; 146 filter->end_graph = ch2->end_graph; 147 filter->field = &thisField; 134 148 135 149 return filter; … … 148 162 std::shared_ptr<COutputPin> CFilterFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 149 163 { 164 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 165 150 166 std::shared_ptr<CFieldScalarArithmeticFilter> filter(new CFieldScalarArithmeticFilter(gc, opId, child2->reduce())); 151 child1->reduce(gc, thisField)->connectOutput(filter, 0); 152 153 (filter->parent_filters).resize(1); 154 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 167 ch1->connectOutput(filter, 0); 168 169 (filter->parent_filters).resize(1); 170 (filter->parent_filters)[0] = ch1; 171 172 filter->tag = ch1->tag; 173 filter->start_graph = ch1->start_graph; 174 filter->end_graph = ch1->end_graph; 175 filter->field = &thisField; 176 155 177 return filter; 156 178 } … … 168 190 std::shared_ptr<COutputPin> CFilterFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 169 191 { 192 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 193 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 194 170 195 std::shared_ptr<CFieldFieldArithmeticFilter> filter(new CFieldFieldArithmeticFilter(gc, opId)); 171 ch ild1->reduce(gc, thisField)->connectOutput(filter, 0);172 ch ild2->reduce(gc, thisField)->connectOutput(filter, 1);196 ch1->connectOutput(filter, 0); 197 ch2->connectOutput(filter, 1); 173 198 174 199 (filter->parent_filters).resize(2); 175 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 176 (filter->parent_filters)[1] = child2->reduce(gc, thisField); 200 (filter->parent_filters)[0] = ch1; 201 (filter->parent_filters)[1] = ch2; 202 203 filter->tag = (ch1->tag || ch2->tag); 204 filter->start_graph = ch1->tag? ch1->start_graph : (ch2->tag? ch2->start_graph: -1); 205 filter->end_graph = ch1->tag? ch1->end_graph : (ch2->tag? ch2->end_graph: -1); 206 filter->field = &thisField; 207 208 177 209 return filter; 178 210 } … … 194 226 std::shared_ptr<COutputPin> CFilterScalarScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 195 227 { 228 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 229 196 230 std::shared_ptr<CScalarScalarFieldArithmeticFilter> filter(new CScalarScalarFieldArithmeticFilter(gc, opId, child1->reduce(),child2->reduce())); 197 ch ild3->reduce(gc, thisField)->connectOutput(filter, 0);231 ch3->connectOutput(filter, 0); 198 232 199 233 (filter->parent_filters).resize(1); 200 (filter->parent_filters)[0] = child3->reduce(gc, thisField); 234 (filter->parent_filters)[0] = ch3; 235 236 filter->tag = ch3->tag; 237 filter->start_graph = ch3->start_graph; 238 filter->end_graph = ch3->end_graph; 239 filter->field = &thisField; 201 240 202 241 return filter; … … 217 256 std::shared_ptr<COutputPin> CFilterScalarFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 218 257 { 258 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 259 219 260 std::shared_ptr<CScalarFieldScalarArithmeticFilter> filter(new CScalarFieldScalarArithmeticFilter(gc, opId, child1->reduce(),child3->reduce())); 220 child2->reduce(gc, thisField)->connectOutput(filter, 0); 221 222 (filter->parent_filters).resize(1); 223 (filter->parent_filters)[0] = child2->reduce(gc, thisField); 261 ch2->connectOutput(filter, 0); 262 263 (filter->parent_filters).resize(1); 264 (filter->parent_filters)[0] = ch2; 265 266 filter->tag = ch2->tag; 267 filter->start_graph = ch2->start_graph; 268 filter->end_graph = ch2->end_graph; 269 filter->field = &thisField; 270 224 271 return filter; 225 272 } … … 239 286 std::shared_ptr<COutputPin> CFilterScalarFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 240 287 { 288 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 289 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 290 241 291 std::shared_ptr<CScalarFieldFieldArithmeticFilter> filter(new CScalarFieldFieldArithmeticFilter(gc, opId, child1->reduce())); 242 ch ild2->reduce(gc, thisField)->connectOutput(filter, 0);243 ch ild3->reduce(gc, thisField)->connectOutput(filter, 1);292 ch2->connectOutput(filter, 0); 293 ch3->connectOutput(filter, 1); 244 294 245 295 (filter->parent_filters).resize(2); 246 (filter->parent_filters)[0] = child2->reduce(gc, thisField); 247 (filter->parent_filters)[1] = child3->reduce(gc, thisField); 296 (filter->parent_filters)[0] = ch2; 297 (filter->parent_filters)[1] = ch3; 298 299 filter->tag = (ch3->tag || ch2->tag); 300 filter->start_graph = ch3->tag? ch3->start_graph : (ch2->tag? ch2->start_graph: -1); 301 filter->end_graph = ch3->tag? ch3->end_graph : (ch2->tag? ch2->end_graph: -1); 302 filter->field = &thisField; 248 303 249 304 return filter; … … 265 320 std::shared_ptr<COutputPin> CFilterFieldScalarScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 266 321 { 322 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 323 267 324 std::shared_ptr<CFieldScalarScalarArithmeticFilter> filter(new CFieldScalarScalarArithmeticFilter(gc, opId, child2->reduce(),child3->reduce())); 268 child1->reduce(gc, thisField)->connectOutput(filter, 0); 269 270 (filter->parent_filters).resize(1); 271 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 325 ch1->connectOutput(filter, 0); 326 327 (filter->parent_filters).resize(1); 328 (filter->parent_filters)[0] = ch1; 329 330 filter->tag = ch1->tag; 331 filter->start_graph = ch1->start_graph; 332 filter->end_graph = ch1->end_graph; 333 filter->field = &thisField; 334 272 335 return filter; 273 336 } … … 288 351 std::shared_ptr<COutputPin> CFilterFieldScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 289 352 { 353 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 354 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 355 290 356 std::shared_ptr<CFieldScalarFieldArithmeticFilter> filter(new CFieldScalarFieldArithmeticFilter(gc, opId, child2->reduce())); 291 ch ild1->reduce(gc, thisField)->connectOutput(filter, 0);292 ch ild3->reduce(gc, thisField)->connectOutput(filter, 1);357 ch1->connectOutput(filter, 0); 358 ch3->connectOutput(filter, 1); 293 359 294 360 (filter->parent_filters).resize(2); 295 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 296 (filter->parent_filters)[1] = child3->reduce(gc, thisField); 361 (filter->parent_filters)[0] = ch1; 362 (filter->parent_filters)[1] = ch3; 363 364 filter->tag = (ch3->tag || ch1->tag); 365 filter->start_graph = ch3->tag? ch3->start_graph : (ch1->tag? ch1->start_graph: -1); 366 filter->end_graph = ch3->tag? ch3->end_graph : (ch1->tag? ch1->end_graph: -1); 367 filter->field = &thisField; 297 368 298 369 return filter; … … 314 385 std::shared_ptr<COutputPin> CFilterFieldFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 315 386 { 387 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 388 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 389 316 390 std::shared_ptr<CFieldFieldScalarArithmeticFilter> filter(new CFieldFieldScalarArithmeticFilter(gc, opId, child3->reduce())); 317 ch ild1->reduce(gc, thisField)->connectOutput(filter, 0);318 ch ild2->reduce(gc, thisField)->connectOutput(filter, 1);391 ch1->connectOutput(filter, 0); 392 ch2->connectOutput(filter, 1); 319 393 320 394 (filter->parent_filters).resize(2); 321 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 322 (filter->parent_filters)[1] = child2->reduce(gc, thisField); 395 (filter->parent_filters)[0] = ch1; 396 (filter->parent_filters)[1] = ch2; 397 398 filter->tag = (ch2->tag || ch1->tag); 399 filter->start_graph = ch2->tag? ch2->start_graph : (ch1->tag? ch1->start_graph: -1); 400 filter->end_graph = ch2->tag? ch2->end_graph : (ch1->tag? ch1->end_graph: -1); 401 filter->field = &thisField; 323 402 return filter; 324 403 } … … 338 417 std::shared_ptr<COutputPin> CFilterFieldFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 339 418 { 419 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 420 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 421 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 422 340 423 std::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId)); 341 child1->reduce(gc, thisField)->connectOutput(filter, 0); 342 child2->reduce(gc, thisField)->connectOutput(filter, 1); 343 child3->reduce(gc, thisField)->connectOutput(filter, 2); 424 std::cout<<"std::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId))" <<std::endl; 425 ch1->connectOutput(filter, 0); 426 ch2->connectOutput(filter, 1); 427 ch3->connectOutput(filter, 2); 344 428 345 429 (filter->parent_filters).resize(3); 346 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 347 (filter->parent_filters)[1] = child2->reduce(gc, thisField); 348 (filter->parent_filters)[2] = child3->reduce(gc, thisField); 430 (filter->parent_filters)[0] = ch1; 431 (filter->parent_filters)[1] = ch2; 432 (filter->parent_filters)[2] = ch3; 433 434 435 filter->tag = (ch1->tag || ch1->tag || ch3->tag); 436 filter->start_graph = ch1->tag? ch1->start_graph : (ch2->tag? ch2->start_graph: (ch3->tag? ch3->start_graph: -1)); 437 filter->end_graph = ch1->tag? ch1->end_graph : (ch2->tag? ch2->end_graph: (ch3->tag? ch3->end_graph: -1)); 438 filter->field = &thisField; 439 349 440 350 441 return filter; -
XIOS/dev/dev_trunk_omp/src/parse_expr/yacc_parser.cpp
r1601 r1680 70 70 #include "exception.hpp" 71 71 72 #include "yacc_var.hpp" 73 72 74 using namespace std; 73 75 using namespace xios; … … 86 88 #pragma omp threadprivate(parsed, globalInputText_ptr, globalReadOffset) 87 89 90 91 std::string *xios::yacc_globalInputText_ptr = 0; 92 // #pragma omp threadprivate(xios::yacc_globalInputText_ptr) 93 88 94 int readInputForLexer(char* buffer, size_t* numBytesRead, size_t maxBytesToRead) 89 95 { 96 yacc_globalInputText_ptr = globalInputText_ptr; 97 98 std::cout<<"========= yacc_globalInputText_ptr = "<<*yacc_globalInputText_ptr<<std::endl; 90 99 if(globalInputText_ptr == 0) globalInputText_ptr = new std::string; 91 100 size_t numBytesToRead = maxBytesToRead; -
XIOS/dev/dev_trunk_omp/src/parse_expr/yacc_parser.hpp
r1158 r1680 92 92 int yyparse (void); 93 93 94 94 95 #endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED */
Note: See TracChangeset
for help on using the changeset viewer.