Changeset 182


Ignore:
Timestamp:
04/20/11 18:34:34 (13 years ago)
Author:
hozdoba
Message:
 
Location:
XMLIO_V2/dev/dev_rv
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/Makefile.wk

    r179 r182  
    1515VTK       = no 
    1616GUI       = no 
    17 NPROC     = 12 
     17NPROC     = 3 
    1818CSUITE    = intel 
    1919PFORME    = fedora-wk 
     
    2222 
    2323ifeq ($(HOSTNAME), lsce4063.extra.cea.fr) 
    24         PFORME     = fedora-wk 
     24        PFORME = fedora-wk 
    2525endif 
    2626 
    2727ifeq ($(HOST), mercure01) 
    28         CSUITE     = sx 
    29         PFORME     = sx8-mercure-wk 
     28        CSUITE = sx 
     29        PFORME = sx8-mercure-wk 
    3030endif 
    3131 
  • XMLIO_V2/dev/dev_rv/src/xmlio/array.hpp

    r168 r182  
    3636 
    3737      public: 
    38  
     38       
    3939         /// Flux /// 
    4040         template <typename U, StdSize V, typename W> 
     
    4747 
    4848      public: 
    49  
     49       
    5050         void toBinary  (StdOStream & os) const; 
    5151         void fromBinary(StdIStream & is); 
  • XMLIO_V2/dev/dev_rv/src/xmlio/array_mac.hpp

    r152 r182  
    88 
    99#define ARRAY_ASSIGN(value, valuetype, numdims, extent)\ 
    10    value = ARRAY(valuetype, numdims)(new CArray<valuetype, numdims>(boost::extents extent)) 
     10   value.reset(new CArray<valuetype, numdims>(boost::extents extent))  
    1111 
    1212#define ARRAY_CREATE(value, valuetype, numdims, extent)\ 
    13    ARRAY_ASSIGN(ARRAY(valuetype, numdims) value, valuetype, numdims, extent) 
     13   ARRAY(valuetype, numdims) value =                   \ 
     14   ARRAY(valuetype, numdims)(new CArray<valuetype, numdims>(boost::extents extent)) 
    1415 
    1516// Type C 
  • XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template_impl.hpp

    r173 r182  
    5050      template <class T> 
    5151         CAttributeTemplate<T>::~CAttributeTemplate(void) 
    52       { /* Ne rien faire de plus */ } 
     52      {  
     53         this->clear(); 
     54      } 
    5355 
    5456      ///-------------------------------------------------------------- 
  • XMLIO_V2/dev/dev_rv/src/xmlio/fortran/impi_interface.f90

    r152 r182  
    8383      INTEGER (kind = C_INT)                 :: datatype, count, err 
    8484      INTEGER (kind = C_INT) , DIMENSION(mpi_status_size) :: status 
    85       CALL MPI_GET_COUNT(status, datatype, count, err) 
     85       
     86      ! ATTTENTION GROS BUG ICI  SOUS GNU MAIS PAS INTEL ???????? voir datatype 
     87      ! PRINT *, datatype, MPI_CHARACTER 
     88      CALL MPI_GET_COUNT(status, MPI_CHARACTER, count, err) 
    8689   END SUBROUTINE xios_mpi_get_count 
    8790 
  • XMLIO_V2/dev/dev_rv/src/xmlio/manager/mpi_manager.cpp

    r179 r182  
    129129 
    130130      void CMPIManager::FreeMem(void * data) 
    131       { MPI_Free_mem(data); } 
     131      {  
     132         MPI_Free_mem(data); 
     133      } 
    132134 
    133135      //-------------------------------------------------------------- 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.cpp

    r180 r182  
    1616      , isChecked(false), local_mask(new CMask()), relFiles() 
    1717      , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub() 
     18      , lonvalue_sub(), latvalue_sub() 
    1819   { /* Ne rien faire de plus */ } 
    1920 
     
    2223      , isChecked(false), local_mask(new CMask()), relFiles() 
    2324      , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub() 
     25      , lonvalue_sub(), latvalue_sub() 
    2426   { /* Ne rien faire de plus */ } 
    2527 
    2628   CDomain::~CDomain(void) 
    27    { /* Ne rien faire de plus */ } 
     29   {  
     30      this->local_mask.reset(); 
     31      for (StdSize i = 0; i < this->lonvalue_sub.size(); i++) 
     32      { 
     33         this->lonvalue_sub[i].reset(); 
     34         this->latvalue_sub[i].reset(); 
     35      }      
     36   } 
    2837 
    2938   ///--------------------------------------------------------------- 
     
    5766      this->jbegin_sub.push_back(this->jbegin.getValue()); 
    5867      this->iend_sub.push_back(this->iend.getValue()); 
    59       this->jend_sub.push_back(this->jend.getValue());       
     68      this->jend_sub.push_back(this->jend.getValue());  
     69       
     70      this->latvalue_sub.push_back(this->latvalue.getValue()); 
     71      this->lonvalue_sub.push_back(this->lonvalue.getValue());    
    6072       
    6173#define CLEAR_ATT(name_)\ 
     
    7587         CLEAR_ATT(nj); 
    7688          
    77          CLEAR_ATT(latvalue); 
    78          CLEAR_ATT(lonvalue); 
    7989#undef CLEAR_ATT 
    8090 
     
    8393      this->iend.setValue(*std::max_element(this->iend_sub.begin(),this->iend_sub.end())); 
    8494      this->jend.setValue(*std::max_element(this->jend_sub.begin(),this->jend_sub.end())); 
    85        
    86       this->checkGlobalDomain(); 
    87       this->checkLocalIDomain(); 
    88       this->checkLocalJDomain(); 
    89       this->completeMask(); 
    90        
    91       this->isChecked = true; 
    9295   } 
    9396 
     
    201204               (*__arr)[i][j] = true; 
    202205         mask.setValue(__arr); 
     206         __arr.reset(); 
    203207      } 
    204208   } 
     
    309313             
    310314            for(int count = 0, i = 0; i  < data_ni.getValue(); i++) 
     315            { 
    311316               for(int j = 0; j < data_nj.getValue(); j++, count++) 
    312317               {  
     
    314319                  (*__arrj)[count] = j+1 ; 
    315320               } 
     321            } 
     322            data_i_index.setValue(__arri) ; 
     323            data_j_index.setValue(__arrj) ;             
     324            __arri.reset(); 
     325            __arrj.reset(); 
     326         } 
     327      } 
     328   } 
     329 
     330   //---------------------------------------------------------------- 
     331    
     332   void CDomain::completeLonLat(void) 
     333   { 
     334      ARRAY(double, 1) lonvalue_ = this->lonvalue.getValue(), 
     335                       latvalue_ = this->latvalue.getValue(); 
     336                        
     337      if (this->data_dim.getValue() == 2) 
     338      { 
     339         StdSize dn = this->ni.getValue()*this->nj.getValue(); 
     340         lonvalue_->resize(boost::extents[dn]); 
     341         latvalue_->resize(boost::extents[dn]); 
     342 
     343         for (StdSize k = 0; k < lonvalue_sub.size(); k++) 
     344         { 
     345            int l = 0; 
     346            ARRAY(double, 1) lonvalue_loc = this->lonvalue_sub[k], 
     347                             latvalue_loc = this->latvalue_sub[k]; 
     348            const int ibegin_loc = ibegin_sub[k], iend_loc = iend_sub[k], 
     349                      jbegin_loc = jbegin_sub[k], jend_loc = jend_sub[k]; 
     350                                                                  
     351            for (int i = ibegin_loc-1; i <= (iend_loc-1); i++) 
     352            { 
     353               for (int j = jbegin_loc-1; j <= (jend_loc-1); j++) 
     354               { 
     355                  (*lonvalue_)[i+j*this->ni.getValue()] = (*lonvalue_loc)[l];               
     356                  (*latvalue_)[i+j*this->ni.getValue()] = (*latvalue_loc)[l++]; 
     357               } 
     358            } 
     359         }    
     360          
     361      } 
     362      else 
     363      { 
     364         StdSize dn = this->ni.getValue(); 
     365         lonvalue_->resize(boost::extents[dn]); 
     366         latvalue_->resize(boost::extents[dn]); 
     367          
     368         for (StdSize k = 0; k < lonvalue_sub.size(); k++) 
     369         { 
     370            int l = 0; 
     371            ARRAY(double, 1) lonvalue_loc = this->lonvalue_sub[k], 
     372                             latvalue_loc = this->latvalue_sub[k]; 
     373            const int ibegin_loc = ibegin_sub[k], iend_loc = iend_sub[k], 
     374                      jbegin_loc = jbegin_sub[k], jend_loc = jend_sub[k]; 
     375                       
     376            for (int i = ibegin_loc-1; i <= (iend_loc-1); i++) 
     377               (*lonvalue_)[i] = (*lonvalue_loc)[l++]; 
    316378                
    317             data_i_index.setValue(__arri) ; 
    318             data_j_index.setValue(__arrj) ; 
    319          } 
     379            for (int j = jbegin_loc-1, l = 0; j <= (jend_loc-1); j++) 
     380               (*latvalue_)[j] = (*latvalue_loc)[l++]; 
     381         }          
    320382      } 
    321383   } 
     
    331393      this->checkLocalJDomain(); 
    332394 
    333       this->checkMask(); 
    334       this->checkDomainData(); 
    335       this->checkCompression(); 
     395      if (this->latvalue_sub.size() == 0) 
     396      { 
     397         this->checkMask(); 
     398         this->checkDomainData(); 
     399         this->checkCompression(); 
     400      } 
     401      else 
     402      { 
     403         this->completeLonLat(); 
     404      } 
    336405      this->completeMask(); 
    337406 
    338407      this->isChecked = true; 
    339408   } 
    340  
     409    
     410   //---------------------------------------------------------------- 
     411    
    341412   void CDomain::completeMask(void) 
    342413   { 
     
    348419   } 
    349420 
     421   //---------------------------------------------------------------- 
     422 
    350423   boost::shared_ptr<CMask> CDomain::getLocalMask(void) const 
    351424   { 
    352425      return (this->local_mask); 
    353426   } 
     427    
     428   //---------------------------------------------------------------- 
     429    
     430   const std::vector<int> & CDomain::getIBeginSub(void) const 
     431   { 
     432      return (this->ibegin_sub); 
     433   } 
     434    
     435   //---------------------------------------------------------------- 
     436    
     437   const std::vector<int> & CDomain::getIEndSub(void) const 
     438   { 
     439      return (this->iend_sub); 
     440   } 
     441    
     442   //---------------------------------------------------------------- 
     443    
     444   const std::vector<int> & CDomain::getJBeginSub(void) const 
     445   { 
     446      return (this->jbegin_sub); 
     447   } 
     448    
     449   //---------------------------------------------------------------- 
     450    
     451   const std::vector<int> & CDomain::getJEndSub(void) const 
     452   { 
     453      return (this->iend_sub); 
     454   } 
     455    
     456   //---------------------------------------------------------------- 
     457    
     458   const std::vector<ARRAY(double, 1)> & CDomain::getLonValueSub(void) const 
     459   { 
     460      return (this->lonvalue_sub); 
     461   } 
     462    
     463   //---------------------------------------------------------------- 
     464    
     465   const std::vector<ARRAY(double, 1)> & CDomain::getLatValueSub(void) const 
     466   { 
     467      return (this->latvalue_sub); 
     468   }    
     469    
    354470   ///--------------------------------------------------------------- 
    355471 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.hpp

    r180 r182  
    6969         /// Accesseurs /// 
    7070         boost::shared_ptr<CMask> getLocalMask(void) const; 
     71          
    7172         const std::set<StdString> & getRelFiles(void) const; 
     73 
     74         const std::vector<int> & getIBeginSub(void) const; 
     75         const std::vector<int> & getIEndSub(void) const; 
     76         const std::vector<int> & getJBeginSub(void) const; 
     77         const std::vector<int> & getJEndSub(void) const; 
     78          
     79         const std::vector<ARRAY(double, 1)> & getLonValueSub(void) const; 
     80         const std::vector<ARRAY(double, 1)> & getLatValueSub(void) const; 
    7281 
    7382         /// Test /// 
    7483         bool IsWritten(const StdString & filename) const; 
    75  
     84          
     85      public : 
     86       
    7687         /// Mutateur /// 
    7788         void addRelFile(const StdString & filename); 
    78  
     89         void completeLonLat(void); 
     90          
    7991         /// Destructeur /// 
    8092         virtual ~CDomain(void); 
     
    94106 
    95107         std::vector<int> ibegin_sub, iend_sub, jbegin_sub, jend_sub; 
     108         std::vector<ARRAY(double, 1)> lonvalue_sub, latvalue_sub; 
    96109 
    97110   }; // class CDomain 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/field.cpp

    r181 r182  
    2424   CField::~CField(void) 
    2525   { 
     26      this->grid.reset() ; 
     27      this->file.reset() ; 
    2628      if (this->foperation == NULL) 
    2729         delete this->foperation; 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.cpp

    r181 r182  
    2323 
    2424   CGrid::~CGrid(void) 
    25    { /* Ne rien faire de plus */ } 
     25   {  
     26      this->axis.reset() ; 
     27      this->domain.reset() ; 
     28       
     29      for (StdSize i = 0; i < this->storeIndex.size(); i++) 
     30      { 
     31         this->storeIndex[i].reset(); 
     32         this->out_i_index[i].reset(); 
     33         this->out_j_index[i].reset(); 
     34         this->out_l_index[i].reset(); 
     35      } 
     36   } 
    2637 
    2738   ///--------------------------------------------------------------- 
     
    8899      this->solveAxisRef() ; 
    89100      if (this->storeIndex.size() == 1) 
     101      { 
    90102         this->computeIndex() ; 
     103      } 
     104      else 
     105      { 
     106         this->computeIndexServer(); 
     107      } 
    91108      this->isChecked = true; 
    92109   } 
     
    303320      this->out_l_index.push_back(out_l_index_); 
    304321   } 
     322    
     323   //--------------------------------------------------------------- 
     324    
     325   void CGrid::computeIndexServer(void) 
     326   { 
     327      ARRAY(int, 1) storeIndex_srv   =  this->storeIndex[0]; 
     328      ARRAY(int, 1) out_i_index_srv  =  this->out_i_index[0]; 
     329      ARRAY(int, 1) out_j_index_srv  =  this->out_j_index[0]; 
     330      ARRAY(int, 1) out_l_index_srv  =  this->out_l_index[0];       
     331       
     332      const std::vector<int> & ibegin = this->domain->getIBeginSub(); 
     333      const std::vector<int> & jbegin = this->domain->getJBeginSub(); 
     334       
     335      StdSize dn = 0;       
     336      for (StdSize j = 1; j < this->out_i_index.size(); j++) 
     337         dn += this->out_i_index[j]->size(); 
     338          
     339      ARRAY_ASSIGN(storeIndex_srv, int, 1, [dn]); 
     340      ARRAY_ASSIGN(out_i_index_srv, int, 1, [dn]); 
     341      ARRAY_ASSIGN(out_j_index_srv, int, 1, [dn]); 
     342      ARRAY_ASSIGN(out_l_index_srv, int, 1, [dn]); 
     343       
     344      for (StdSize i = 0, dn = 0; i < ibegin.size(); i++) 
     345      { 
     346         ARRAY(int, 1) storeIndex_cl   =  this->storeIndex[i+1]; 
     347         ARRAY(int, 1) out_i_index_cl  =  this->out_i_index[i+1]; 
     348         ARRAY(int, 1) out_j_index_cl  =  this->out_j_index[i+1]; 
     349         ARRAY(int, 1) out_l_index_cl  =  this->out_l_index[i+1]; 
     350          
     351         const int ibegin_cl = ibegin[i]; 
     352         const int jbegin_cl = jbegin[i]; 
     353          
     354         for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++) 
     355         { 
     356            (*storeIndex_srv)[n]  = (*storeIndex_cl)[m]  + dn; 
     357            (*out_i_index_srv)[n] = (*out_i_index_cl)[m] + ibegin_cl - 1; 
     358            (*out_j_index_srv)[n] = (*out_j_index_cl)[m] + jbegin_cl - 1; 
     359            (*out_l_index_srv)[n] = (*out_l_index_cl)[m]; 
     360         } 
     361                   
     362         dn += storeIndex_cl->size(); 
     363                  
     364      } 
     365       
     366      //~ StdOFStream ofs(this->getId().c_str()); 
     367      //~ for (StdSize h = 0; h < storeIndex_srv->size(); h++) 
     368      //~ { 
     369      //~   ofs << "(" << (*storeIndex_srv)[h]  << ";" 
     370      //~       << (*out_i_index_srv)[h] << "," 
     371      //~       << (*out_j_index_srv)[h] << "," 
     372      //~       << (*out_l_index_srv)[h] << ")" << std::endl; 
     373      //~ } 
     374      //~ ofs.close(); 
     375       
     376   } 
    305377 
    306378   ///--------------------------------------------------------------- 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.hpp

    r181 r182  
    7070         template <StdSize n> 
    7171            void inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored) const; 
     72             
     73         void inputFieldServer(const std::deque<ARRAY(double, 1)> storedClient, 
     74                                                ARRAY(double, 1)  storedServer) const; 
    7275 
    7376         template <StdSize n> 
     
    97100 
    98101         /// Traitements protégés /// 
     102         void computeIndexServer(void); 
    99103         void computeIndex(void); 
    100104         void solveDomainRef(void); 
Note: See TracChangeset for help on using the changeset viewer.