Changeset 1241


Ignore:
Timestamp:
08/10/17 18:13:06 (7 years ago)
Author:
ymipsl
Message:

Fix problem on incoming data from client to server when you have so masking.
The source filter on server side try to compress data but the data are already compressed by client. So just make a flat copy and enter into workflow.

Now data compression is not called on server side.

YM

Location:
XIOS/dev/XIOS_DEV_CMIP6/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/filter/source_filter.cpp

    r1210 r1241  
    77namespace xios 
    88{ 
    9   CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, 
     9  CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, bool compression,  
    1010                               const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/, 
    1111                               bool hasMissingValue /*= false*/, 
     
    1313    : COutputPin(gc, manualTrigger) 
    1414    , grid(grid) 
     15    , compression(compression) 
    1516    , offset(offset) 
    1617    , hasMissingValue(hasMissingValue), defaultValue(defaultValue) 
     
    3233 
    3334    packet->data.resize(grid->storeIndex_client.numElements()); 
    34     grid->inputField(data, packet->data); 
    35  
     35    if (compression) grid->inputField(data, packet->data) ; 
     36    else 
     37    { 
     38      // just make a flat copy 
     39      CArray<double,1> dataTmp(data.copy().dataFirst(),shape(data.numElements())) ; 
     40      packet->data.reference(dataTmp) ; 
     41    } 
    3642    // Convert missing values to NaN 
    3743    if (hasMissingValue) 
  • XIOS/dev/XIOS_DEV_CMIP6/src/filter/source_filter.hpp

    r1201 r1241  
    2727       */ 
    2828      CSourceFilter(CGarbageCollector& gc, CGrid* grid, 
     29                    bool compression=true, 
    2930                    const CDuration offset = NoneDu, bool manualTrigger = false, 
    3031                    bool hasMissingValue = false, 
     
    6465      const bool hasMissingValue; 
    6566      const double defaultValue; 
     67      const bool compression ; //!< indicate if the data need to be compressed : on client size : true, on server side : false 
    6668  }; // class CSourceFilter 
    6769} // namespace xios 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/field.cpp

    r1240 r1241  
    950950     { 
    951951        if (!instantDataFilter) 
    952           instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid)); 
     952          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,false)); 
    953953 
    954954             // If the field data is to be read by the client or/and written to a file 
     
    965965     { 
    966966       if (!instantDataFilter) 
    967          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid)); 
     967         instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false)); 
    968968 
    969969             // If the field data is to be read by the client or/and written to a file 
     
    10091009         // Check if the data is to be read from a file 
    10101010         else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 
    1011            instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 
     1011           instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, 
    10121012                                                                                                       freq_offset.isEmpty() ? NoneDu : freq_offset, 
    10131013                                                                                                       true, 
     
    10161016         { 
    10171017            if (check_if_active.isEmpty()) check_if_active = false;  
    1018             instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 
     1018            instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, NoneDu, false, 
    10191019                                                                                                        detectMissingValues, defaultValue)); 
    10201020         } 
     
    10921092       { 
    10931093         if (!serverSourceFilter) 
    1094            serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 
     1094           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, 
    10951095                                                                                   freq_offset.isEmpty() ? NoneDu : freq_offset, 
    10961096                                                                                   true, 
     
    11101110         { 
    11111111           if (check_if_active.isEmpty()) check_if_active = false; 
    1112            clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 
     1112           clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, NoneDu, false, 
    11131113                                                                                   detectMissingValues, defaultValue)); 
    11141114         } 
Note: See TracChangeset for help on using the changeset viewer.