Ignore:
Timestamp:
08/25/15 16:52:45 (9 years ago)
Author:
rlacroix
Message:

Add support for indexed output.

If the new field attribute "indexed_output" is set to true and a mask is defined (either at grid, domain or axis level), the indexed data will be outputed instead of the full data with missing values.

See http://cfconventions.org/Data/cf-conventions/cf-conventions-1.5/build/cf-conventions.html#compression-by-gathering for more information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/grid.hpp

    r664 r676  
    4848         typedef CGridAttributes SuperClassAttribute; 
    4949 
    50       public : 
     50      public: 
    5151 
    5252         typedef CGridAttributes RelAttributes; 
     
    7272//         void solveReference(void); 
    7373 
     74         void checkEligibilityForCompressedOutput(); 
     75 
    7476         void solveDomainAxisRef(bool areAttributesChecked); 
    7577 
     
    7981//         virtual void fromBinary(StdIStream& is); 
    8082 
     83         void addRelFileCompressed(const StdString& filename); 
     84 
    8185         /// Tests /// 
    82          bool hasAxis(void) const; 
    83  
    84       public : 
     86         bool isCompressible(void) const; 
     87         bool isWrittenCompressed(const StdString& filename) const; 
     88 
     89      public: 
    8590 
    8691         /// Accesseurs /// 
     
    98103         void inputField(int rank, const double* const field, CArray<double,1>& stored); 
    99104 
     105         void outputCompressedField(int rank, const CArray<double,1>& stored, double* field); 
     106 
    100107         virtual void parse(xml::CXMLNode& node); 
    101108 
     
    103110         virtual ~CGrid(void); 
    104111 
    105       public : 
     112      public: 
    106113 
    107114         /// Accesseurs statiques /// 
     
    116123         static CGrid* createGrid(std::vector<CDomain*> domains, std::vector<CAxis*> axis, CArray<bool,1> axisDomainOrder = CArray<bool,1>()); 
    117124 
    118       public : 
     125      public: 
    119126 
    120127         /// Entrées-sorties de champs (interne) /// 
     
    126133         void computeIndex(void); 
    127134         void computeIndexScalarGrid(); 
     135         void computeCompressedIndex(); 
    128136 
    129137         void solveDomainRef(bool checkAtt); 
     
    163171         bool doGridHaveDataDistributed(); 
    164172         size_t getWrittenDataSize() const; 
     173         int getNumberWrittenIndexes() const; 
     174         int getTotalNumberWrittenIndexes() const; 
     175         int getOffsetWrittenIndexes() const; 
    165176 
    166177         const CDistributionServer* getDistributionServer() const; 
     
    184195         map<int,int> nbSenders; 
    185196 
    186          map<int, CArray<size_t, 1> > outIndexFromClient; 
     197         map<int, CArray<size_t, 1> > outIndexFromClient, compressedOutIndexFromClient; 
    187198         void checkMask(void); 
    188199         void modifyMask(const CArray<int,1>& indexToModify); 
     
    221232 
    222233        std::vector<int> globalDim_; 
     234 
    223235      private: 
    224236        CDomainGroup* vDomainGroup_; 
     
    231243        CClientServerMapping* clientServerMap_; 
    232244        size_t writtenDataSize_; 
     245        int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_; 
    233246        std::map<int,size_t> connectedDataSize_; 
    234247        std::vector<int> connectedServerRank_; 
    235248        bool isDataDistributed_; 
    236249        int positionDimensionDistributed_; 
     250         //! True if and only if the data defined on the grid can be outputted in a compressed way 
     251        bool isCompressible_; 
     252        std::set<std::string> relFilesCompressed; 
    237253 
    238254        bool isTransformed_; 
Note: See TracChangeset for help on using the changeset viewer.