Changeset 423 for trunk


Ignore:
Timestamp:
09/02/10 19:26:07 (14 years ago)
Author:
lnalod
Message:

Update of the backward procedure for generating the atomi directives. The precedent backward generation was wrong.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/nardi/shallow/shalw.d

    r33 r423  
    88 
    99//option o_gradtest 
    10 //option o_parallel 
     10option o_parallel 
    1111option o_m1qn3 
    1212 
  • trunk/yao/src/Translator.cpp

    r391 r423  
    30523052        anImplementation << "\t Ytbeta[" << con->getIn()-1 << "]=YG" << con->getOut() << "_" << con->getOutModule() << "("; 
    30533053      else{                   // ibad=='A': case gradients Alpha: backward. 
    3054         if(firstAxis==1 && con->getReli() && con->getI() || 
     3054 
     3055        /* Old first wrong version for adding atomic pragma on the backward 
     3056           if(firstAxis==1 && con->getReli() && con->getI() || 
    30553057           firstAxis==2 && con->getRelj() && con->getJ() || 
    30563058           firstAxis==3 && con->getRelk() && con->getK() ){ 
    3057           if(parallel){ 
    3058             anImplementation << "\t #pragma omp atomic\n"; 
    3059             totalAtomicOperations++; 
    3060           } 
    3061         } 
     3059           if(parallel){ 
     3060           anImplementation << "\t #pragma omp atomic\n"; 
     3061           totalAtomicOperations++; 
     3062           } 
     3063           } 
     3064           */ 
     3065 
     3066        if(parallel){ 
     3067          bool flagCon=true; 
     3068          for(Table<Connection>::iterator conDest=theConnectionTable.begin(); conDest != theConnectionTable.end() && flagCon; conDest++){ 
     3069            if(conDest->getOutModule() == con->getOutModule() && 
     3070                conDest->getRelt() == con->getRelt() && 
     3071                conDest->ist() == con->ist() && 
     3072                conDest->isT() == con->isT() && 
     3073                conDest->getT() == con->getT() && 
     3074                conDest->getOut() == con->getOut() 
     3075              ){ 
     3076 
     3077              if(firstAxis==1 && con->getReli() && con->getI()!=conDest->getI() || 
     3078                  firstAxis==2 && con->getRelj() && con->getJ()!=conDest->getJ() || 
     3079                  firstAxis==3 && con->getRelk() && con->getK()!=conDest->getK() ){ 
     3080                anImplementation << "\t #pragma omp atomic\n"; 
     3081                totalAtomicOperations++; 
     3082                flagCon=false; 
     3083 
     3084                // To see/debug 
     3085                /*cout << "ctin: " << con->getOutModule() << " ====> " << con->getInModule() << "    " 
     3086                  << "trovata ctin: " << conDest->getOutModule() << " ====> " << conDest->getInModule() 
     3087                  << " " << con->getOut() << " " << conDest->getOut() << "-- " << con->getI() << " " << conDest->getI() 
     3088                  << "-- " << con->getReli() << " " << conDest->getReli() << "-- " << con->ist() << " " << conDest->ist() 
     3089                  << "-- " << con->getT() << " " << conDest->getT() << "-- " << con->getRelt() << " " << conDest->getRelt() << endl; 
     3090                  */ 
     3091              } 
     3092            } 
     3093          } 
     3094 
     3095        } 
     3096       
    30623097        anImplementation << "\t YG" << con->getOut() << "_" << con->getOutModule() << "("; 
    30633098      } 
Note: See TracChangeset for help on using the changeset viewer.