Changeset 680


Ignore:
Timestamp:
09/01/15 17:15:42 (9 years ago)
Author:
rlacroix
Message:

Rephrase some error messages so that they are clearer.

Location:
XIOS/trunk/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/array_new.hpp

    r677 r680  
    554554  { 
    555555    if (!array.toBuffer(buffer)) ERROR("template <typename T_numtype,int N_rank> inline CBufferOut& operator<<(CBufferOut& buffer, const CArray& array)", 
    556                                        << "Buffer remain size is to low for size type"); 
     556                                       << "Not enough free space in buffer to queue the array."); 
    557557    return buffer; 
    558558  } 
     
    561561  { 
    562562    if (!array.fromBuffer(buffer)) ERROR("template <typename T_numtype,int N_rank> inline CBufferIn& operator>>(CBufferIn& buffer, CArray& array)", 
    563                                          << "Buffer remain size is to low for size type"); 
     563                                         << "Not enough data in buffer to unqueue the array."); 
    564564    return buffer; 
    565565  } 
  • XIOS/trunk/src/attribute.cpp

    r501 r680  
    8686      } 
    8787 
    88      CMessage& operator<<(CMessage& msg, const CAttribute&  type) 
     88     CMessage& operator<<(CMessage& msg, const CAttribute& type) 
    8989     { 
    9090//       msg.push(*type.clone()) ; 
     
    9292     } 
    9393  
    94       CBufferOut& operator<<(CBufferOut& buffer, CAttribute&  type) 
     94      CBufferOut& operator<<(CBufferOut& buffer, CAttribute& type) 
    9595     { 
    9696     
    97        if (!type.toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, CAttribute&  type)", 
    98                                            <<"Buffer remain size is to low for size type") ; 
     97       if (!type.toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, CAttribute& type)", 
     98                                         << "Not enough free space in buffer to queue the attribute."); 
    9999      return buffer ; 
    100100     } 
    101101      
    102      CBufferIn& operator>>(CBufferIn& buffer, CAttribute&  type) 
     102     CBufferIn& operator>>(CBufferIn& buffer, CAttribute& type) 
    103103     { 
    104104     
    105        if (!type.fromBuffer(buffer)) ERROR("CBufferInt& operator>>(CBufferIn& buffer, CAttribute&  type)", 
    106                                            <<"Buffer remain size is to low for size type") ; 
     105       if (!type.fromBuffer(buffer)) ERROR("CBufferInt& operator>>(CBufferIn& buffer, CAttribute& type)", 
     106                                           << "Not enough data in buffer to unqueue the attribute."); 
    107107       return buffer ; 
    108108     } 
  • XIOS/trunk/src/node/grid.hpp

    r676 r680  
    264264      if (this->getDataSize() != field.numElements()) 
    265265         ERROR("void CGrid::inputField(const  CArray<double,n>& field, CArray<double,1>& stored) const", 
    266                 << "[ Awaiting size of the data = " << this->getDataSize()      << ", " 
     266                << "[ Awaiting data of size = " << this->getDataSize() << ", " 
    267267                << "Received data size = "      << field.numElements() << " ] " 
    268                 << "The array of data has not the good size !") 
     268                << "The data array does not have the right size!") 
    269269      this->storeField_arr(field.dataFirst(), stored); 
    270270   } 
     
    277277                << "[ Size of the data = " << this->getDataSize() << ", " 
    278278                << "Output data size = "   << field.numElements() << " ] " 
    279                 << "The ouput array does not have not the right size!") 
     279                << "The ouput array does not have the right size!") 
    280280      this->restoreField_arr(stored, field.dataFirst()); 
    281281   } 
     
    314314      { 
    315315        if (gridMask.extent(i) != eachDimSize[i]) 
    316            ERROR("CGrid::checkMask(void)", 
    317                 <<"The mask has one dimension whose size is different from the one of the local grid"<<endl 
    318                 <<"Local size is "<< i << " " << eachDimSize[i]<<endl 
    319                 <<"Mask dimension size is "<<gridMask.extent(i)); 
     316          ERROR("CGrid::checkMask(void)", 
     317                << "The mask has one dimension whose size is different from the one of the local grid." << std::endl 
     318                << "Local size of dimension " << i << " is " << eachDimSize[i] << "." << std::endl 
     319                << "Mask size for dimension " << i << " is " << gridMask.extent(i) << "."); 
    320320      } 
    321321    } 
  • XIOS/trunk/src/node/zoom_axis.cpp

    r666 r680  
    4040    if (this->zoom_end.isEmpty()) zoom_end=zoom_begin+zoom_size-1; 
    4141 
    42     if ((zoom_begin < 0) || (zoom_begin > axisGlobalSize-1) || (zoom_end<0) || (zoom_end>axisGlobalSize-1) || (zoom_size<1) || (zoom_size>axisGlobalSize) || (zoom_begin>zoom_end)) 
    43       ERROR("CZoomAxis::checkAttributes(void)", 
    44             << "One or more attributes among <zoom_begin>, <zoom_end>, <zoom_size> of axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified"); 
     42    if (zoom_begin < 0 || zoom_begin > axisGlobalSize - 1 || zoom_end < 0 || zoom_end > axisGlobalSize - 1 
     43        || zoom_size < 1 || zoom_size > axisGlobalSize || zoom_begin > zoom_end) 
     44      ERROR("CZoomAxis::checkValid(CAxis* axisDest)", 
     45            << "One or more attributes among 'zoom_begin' (" << zoom_begin.getValue() << "), 'zoom_end' (" << zoom_end.getValue() << "), 'zoom_size' (" << zoom_size.getValue() << ") " 
     46            << "of axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified"); 
    4547 
    4648    this->zoom_begin.setValue(zoom_begin) ; 
  • XIOS/trunk/src/node/zoom_domain.cpp

    r631 r680  
    3535           this->zoom_ibegin.isEmpty() || this->zoom_jbegin.isEmpty()) 
    3636       { 
    37           ERROR("CZoomDomain::checkValid(void)", 
    38                 <<"if one of zoom attributes is defined then all zoom attributes must be defined") ; 
     37         ERROR("CZoomDomain::checkValid(CDomain* domainSrc)", 
     38               << "If one of zoom attributes is defined then all zoom attributes must be defined.") ; 
    3939       } 
    4040       else 
     
    4343          int zoom_jend = zoom_jbegin + zoom_nj - 1; 
    4444 
    45           if (zoom_ibegin < 0  || zoom_jbegin < 0 || zoom_iend > (ni_glo-1) || zoom_jend > (nj_glo-1)) 
    46              ERROR("CZoomDomain::checkValid(void)", 
    47                    << "Zoom is wrongly defined," 
    48                    << " Check the values : zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin") ; 
     45          if (zoom_ibegin < 0  || zoom_jbegin < 0 || zoom_iend > ni_glo - 1 || zoom_jend > nj_glo - 1) 
     46            ERROR("CZoomDomain::checkValid(CDomain* domainSrc)", 
     47                  << "Zoom is wrongly defined, " 
     48                  << "please check the values : 'zoom_ni' (" << zoom_ni.getValue() << "), 'zoom_nj' (" << zoom_nj.getValue() << "), " 
     49                  << "'zoom_ibegin' (" << zoom_ibegin.getValue() << "), 'zoom_jbegin' (" << zoom_jbegin.getValue() << ")"); 
    4950       } 
    5051    } 
  • XIOS/trunk/src/object_factory_impl.hpp

    r591 r680  
    6262       
    6363      ERROR("CObjectFactory::GetObject(const U * const object)", 
    64                << "[type = " << U::GetName() << ", " 
    65                << "adress = " << object << "]" 
    66                << " object was not found !"); 
     64               << "[type = " << U::GetName() << ", adress = " << object << "] " 
     65               << "object was not found."); 
    6766      return (boost::shared_ptr<U>()); // jamais atteint 
    6867   } 
     
    7776         ERROR("CObjectFactory::GetObject(const StdString & id)", 
    7877               << "[ id = " << id << ", U = " << U::GetName() << " ] " 
    79                << " object is not referenced !"); 
     78               << "object was not found."); 
    8079      return (U::AllMapObj[CObjectFactory::CurrContext][id]); 
    8180   } 
     
    8786         ERROR("CObjectFactory::GetObject(const StdString & id)", 
    8887               << "[ id = " << id << ", U = " << U::GetName() <<", context = "<<context<< " ] " 
    89                << " object is not referenced !"); 
     88               << "object was not found."); 
    9089      return (U::AllMapObj[context][id]); 
    9190   } 
  • XIOS/trunk/src/server.cpp

    r655 r680  
    370370     } 
    371371 
    372  
    373  
    374372     void CServer::registerContext(void* buff, int count, int leaderRank) 
    375373     { 
     
    378376       buffer >> contextId; 
    379377 
    380        info(20)<<"CServer : Register new Context : "<<contextId<<endl; 
    381  
    382        if (contextList.find(contextId)!=contextList.end()) 
    383         ERROR("void CServer::registerContext(void* buff,int count, int leaderRank)", 
    384               << "Context has already been registred"); 
     378       info(20) << "CServer : Register new Context : " << contextId << endl; 
     379 
     380       if (contextList.find(contextId) != contextList.end()) 
     381         ERROR("void CServer::registerContext(void* buff, int count, int leaderRank)", 
     382               << "Context '" << contextId << "' has already been registred"); 
    385383 
    386384       MPI_Comm contextIntercomm; 
     
    398396       MPI_Comm_free(&inter); 
    399397     } 
    400  
    401398 
    402399     void CServer::contextEventLoop(void) 
  • XIOS/trunk/src/type/enum_impl.hpp

    r591 r680  
    159159     
    160160    ERROR("template <typename T> void CEnum<T>::_fromString(const string& str)", 
    161     << tmpStr << " cannot be converted in a valid enumeration, possibilities are : "<<strList.str() ) ; 
     161          << tmpStr << " cannot be converted in a valid enumeration, possibilities are: " << strList.str()); 
    162162 
    163163  } 
     
    189189    else if (sizeof(*ptrValue)==sizeof(int)) return buffer.put((int) *ptrValue) ; 
    190190    else if (sizeof(*ptrValue)==sizeof(long int)) return buffer.put((long int) *ptrValue) ; 
    191     else ERROR("template <typename T>  bool CEnum<T>::_toBuffer(CBufferOut& buffer) const", 
    192                <<"incompatibility between enumeration and standard integer type") ; 
     191    else ERROR("template <typename T> bool CEnum<T>::_toBuffer(CBufferOut& buffer) const", 
     192               << "incompatibility between enumeration and standard integer type."); 
    193193    return false ; 
    194194  } 
     
    217217      if (ret) *ptrValue = (T_enum) val ; 
    218218    } 
    219     else ERROR("template <typename T>  bool CEnum<T>::_fromBuffer(CBufferIn& buffer)", 
    220                <<"incompatibility between enumeration and standard integer type") ; 
     219    else ERROR("template <typename T> bool CEnum<T>::_fromBuffer(CBufferIn& buffer)", 
     220               << "incompatibility between enumeration and standard integer type."); 
    221221    return ret ; 
    222222  } 
     
    246246  void CEnum<T>::checkEmpty(void) const 
    247247  { 
    248     if (empty) ERROR("template <typename T> void CEnum<T>::checkEmpty(void) const", <<"Type is not initialized") ; 
     248    if (empty) ERROR("template <typename T> void CEnum<T>::checkEmpty(void) const", 
     249                     << "Enum is not initialized."); 
    249250  }   
    250251 
     
    254255  { 
    255256    if (!type.toBuffer(buffer)) ERROR("template <typename T> CBufferOut& operator<<(CBufferOut& buffer, const CEnum<T>& type)", 
    256                                            <<"Buffer remain size is to low for size type") ; 
     257                                      << "Not enough free space in buffer to queue the enum."); 
    257258    return buffer ; 
    258259  } 
     
    262263  { 
    263264    if (!CEnum<T>(type).toBuffer(buffer)) ERROR("template <typename T> CBufferOut& operator<<(CBufferOut& buffer, const typename T::t_enum & type)", 
    264                                            <<"Buffer remain size is to low for size type") ;       
     265                                                << "Not enough free space in buffer to queue the enum."); 
    265266    return buffer ; 
    266267  } 
     
    269270  CBufferIn& operator>>(CBufferIn& buffer, CEnum<T>& type) 
    270271  { 
    271     if (! type.fromBuffer(buffer)) ERROR("template <typename T> CBufferIn& operator>>(CBufferIn& buffer, CEnum<T>& type)", 
    272                                            <<"Buffer remain size is to low for size type") ; 
     272    if (!type.fromBuffer(buffer)) ERROR("template <typename T> CBufferIn& operator>>(CBufferIn& buffer, CEnum<T>& type)", 
     273                                        << "Not enough data in buffer to unqueue the enum."); 
    273274    return buffer ; 
    274275  } 
  • XIOS/trunk/src/type/enum_ref_impl.hpp

    r591 r680  
    160160     
    161161    ERROR("template <typename T> void CEnum_ref<T>::_fromString(const string& str)", 
    162     << tmpStr << " cannot be converted in a valid enumeration, possibilities are : "<<strList.str() ) ; 
     162          << tmpStr << " cannot be converted in a valid enumeration, possibilities are: " << strList.str()); 
    163163  } 
    164164   
     
    178178    else if (sizeof(*ptrValue)==sizeof(int)) return buffer.put((int) *ptrValue) ; 
    179179    else if (sizeof(*ptrValue)==sizeof(long int)) return buffer.put((long int) *ptrValue) ; 
    180     else ERROR("template <typename T>  bool CEnum_ref<T>::_toBuffer(CBufferOut& buffer) const", 
    181                <<"incompatibility between enumeration and standard integer type") ; 
     180    else ERROR("template <typename T> bool CEnum_ref<T>::_toBuffer(CBufferOut& buffer) const", 
     181               << "incompatibility between enumeration and standard integer type."); 
    182182    return false ; 
    183183  } 
     
    206206      if (ret) *ptrValue = (T_enum) val ; 
    207207    } 
    208     else ERROR("template <typename T>  bool CEnum_ref<T>::_fromBuffer(CBufferIn& buffer)", 
    209                <<"incompatibility between enumeration and standard integer type") ; 
     208    else ERROR("template <typename T> bool CEnum_ref<T>::_fromBuffer(CBufferIn& buffer)", 
     209               << "incompatibility between enumeration and standard integer type."); 
    210210    return ret ; 
    211211  } 
     
    234234      if (ret) *ptrValue = (T_enum) val ; 
    235235    } 
    236     else ERROR("template <typename T>  bool CEnum_ref<T>::_fromBuffer(CBufferIn& buffer)", 
    237                <<"incompatibility between enumeration and standard integer type") ; 
     236    else ERROR("template <typename T> bool CEnum_ref<T>::_fromBuffer(CBufferIn& buffer)", 
     237               << "incompatibility between enumeration and standard integer type"); 
    238238  } 
    239239  
     
    260260  { 
    261261    if (empty) ERROR("template <typename T> void CEnum_ref<T>::checkEmpty(void)", 
    262                      <<"Type_ref reference is not assigned") ; 
     262                     << "Enum reference is not initialized.") ; 
    263263  } 
    264264                      
     
    269269  { 
    270270    if (!type.toBuffer(buffer)) ERROR("template <typename T> CBufferOut& operator<<(CBufferOut& buffer, const CEnum_ref<T>& type)", 
    271                                            <<"Buffer remain size is to low for size type") ; 
     271                                      << "Not enough free space in buffer to queue the enum."); 
    272272    return buffer ; 
    273273  } 
     
    277277  { 
    278278    if (!CEnum_ref<T>(type).toBuffer(buffer)) ERROR("template <typename T> CBufferOut& operator<<(CBufferOut& buffer, const typename T::t_enum& type)", 
    279                                              <<"Buffer remain size is to low for size type") ;       
     279                                                    << "Not enough free space in buffer to queue the enum."); 
    280280    return buffer ; 
    281281  } 
     
    284284  CBufferIn& operator>>(CBufferIn& buffer, typename T::t_enum& type) 
    285285  { 
    286     if (! CEnum_ref<T>(type).fromBuffer(buffer)) ERROR("template <typename T>  CBufferIn& operator>>(CBufferIn& buffer, typename T::t_enum& type)", 
    287                                                        <<"Buffer remain size is to low for size type") ; 
     286    if (!CEnum_ref<T>(type).fromBuffer(buffer)) ERROR("template <typename T>  CBufferIn& operator>>(CBufferIn& buffer, typename T::t_enum& type)", 
     287                                                      << "Not enough data in buffer to unqueue the enum."); 
    288288    return buffer ; 
    289289  } 
     
    292292  CBufferIn& operator>>(CBufferIn& buffer, const CEnum_ref<T>& type) 
    293293  { 
    294     if (! type.fromBuffer(buffer) ) ERROR("  template <typename T> CBufferIn& operator>>(CBufferIn& buffer, const CEnum_ref<T>& type) ", 
    295                                            <<"Buffer remain size is to low for size type") ; 
     294    if (!type.fromBuffer(buffer)) ERROR("template <typename T> CBufferIn& operator>>(CBufferIn& buffer, const CEnum_ref<T>& type) ", 
     295                                        << "Not enough data in buffer to unqueue the enum."); 
     296    return buffer ; 
    296297    return buffer ; 
    297298  } 
  • XIOS/trunk/src/type/message.cpp

    r591 r680  
    7979    { 
    8080      if (!msg.toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, CMessage& msg)", 
    81                                              <<"Buffer remain size is to low for size type") ; 
     81                                       << "Not enough free space in buffer to queue the message."); 
     82    return buffer ; 
    8283      return buffer ; 
    8384    } 
     
    8788    { 
    8889      if (!msg.fromBuffer(buffer)) ERROR("CBufferIn& operator>>(CBufferIn& buffer, CMessage& msg)", 
    89                                            <<"Buffer remain size is to low for size type") ; 
     90                                         << "Not enough data in buffer to unqueue the message."); 
     91    return buffer ; 
    9092      return buffer ; 
    9193    } 
  • XIOS/trunk/src/type/type_impl.hpp

    r591 r680  
    201201  void CType<T>::checkEmpty(void) const 
    202202  { 
    203     if (empty) ERROR("template <typename T> void CTypef<T>::checkEmpty(void) const", <<"Type is not initialized") ; 
     203    if (empty) ERROR("template <typename T> void CType<T>::checkEmpty(void) const", << "Data is not initialized") ; 
    204204  }   
    205205 
     
    209209  { 
    210210    if (!type.toBuffer(buffer)) ERROR("CBuffer& operator<<(CBuffer& buffer, CType<T>& type)", 
    211                                            <<"Buffer remain size is to low for size type") ; 
     211                                      << "Not enough free space in buffer to queue the data."); 
    212212    return buffer ; 
    213213  } 
     
    218218  { 
    219219    if (!CType<T>(type).toBuffer(buffer)) ERROR("operator<<(CBuffer& buffer, const T& type)", 
    220                                            <<"Buffer remain size is to low for size type") ;       
     220                                                << "Not enough free space in buffer to queue the data."); 
    221221    return buffer ; 
    222222  } 
    223    
     223 
    224224  template <typename T> 
    225225  CBufferIn& operator>>(CBufferIn& buffer, CType<T>& type) 
    226226  { 
    227227    if (! type.fromBuffer(buffer)) ERROR("CBuffer& operator<<(CBuffer& buffer, CType<T>& type)", 
    228                                            <<"Buffer remain size is to low for size type") ; 
     228                                         << "Not enough data in buffer to unqueue the data."); 
    229229    return buffer ; 
    230230  } 
    231    
    232 /*   
    233   template <typename T> 
    234   CMessage& operator<<(CMessage& msg, const CType<T>& type) 
    235   { 
    236     msg.push(*type.clone()) ; 
    237     return msg ; 
    238   } 
    239 */ 
     231 
    240232  template <typename T> 
    241233  CMessage& operator<<(CMessage& msg, const T& type) 
  • XIOS/trunk/src/type/type_ref_impl.hpp

    r591 r680  
    198198  { 
    199199    if (empty) ERROR("template <typename T> void CType_ref<T>::checkEmpty(void)", 
    200                      <<"Type_ref reference is not assigned") ; 
     200                     <<"Data reference is not initialized.") ; 
    201201  } 
    202202                      
     
    207207  { 
    208208    if (!type.toBuffer(buffer)) ERROR("CBuffer& operator<<(CBuffer& buffer, CType<T>& type)", 
    209                                            <<"Buffer remain size is to low for size type") ; 
     209                                      << "Not enough free space in buffer to queue the data."); 
    210210    return buffer ; 
    211211  } 
     
    215215  { 
    216216    if (!CType_ref<T>(type).toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, T& type)", 
    217                                              <<"Buffer remain size is to low for size type") ;       
     217                                                    << "Not enough free space in buffer to queue the data."); 
    218218    return buffer ; 
    219219  } 
     
    223223  { 
    224224    if (! CType_ref<T>(type).fromBuffer(buffer)) ERROR(" template <typename T> CBufferIn& operator>>(CBufferIn& buffer, T& type)", 
    225                                                 <<"Buffer remain size is to low for size type") ; 
     225                                                       << "Not enough data in buffer to unqueue the data."); 
    226226    return buffer ; 
    227227  } 
     
    231231  { 
    232232    if (! type.fromBuffer(buffer) ) ERROR("CBuffer& operator<<(CBuffer& buffer, CType<T>& type)", 
    233                                            <<"Buffer remain size is to low for size type") ; 
    234     return buffer ; 
    235   } 
    236  
    237  
    238 /* 
    239   template <typename T> 
    240   CMessage& operator<<(CMessage& msg, const CType_ref<T>& type) 
    241   { 
    242     msg.push(type) ; 
    243     return msg ; 
    244   } 
    245 */ 
     233                                          << "Not enough data in buffer to unqueue the data."); 
     234    return buffer ; 
     235  } 
    246236 
    247237  template <typename T> 
Note: See TracChangeset for help on using the changeset viewer.