Changeset 1482
- Timestamp:
- 04/13/18 16:25:46 (7 years ago)
- Location:
- XIOS/dev/branch_openmp
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/arch/arch-X64_CURIE_GCC.env
r574 r1482 1 1 module unload netcdf 2 2 module unload hdf5 3 module unload boost 4 module unload blitz 3 5 module load netcdf/4.3.3.1_hdf5_parallel 4 6 module load gnu/4.9.1 7 module load boost 8 module load blitz 5 9 export OMPI_CC=gcc 6 10 export OMPI_CXX=g++ -
XIOS/dev/branch_openmp/arch/arch-X64_CURIE_GCC.path
r574 r1482 11 11 HDF5_LIB="" 12 12 13 BOOST_INCDIR="-I $BOOST_INCDIR" 14 BOOST_LIBDIR="-L $BOOST_LIBDIR" 15 BOOST_LIB="" 16 17 BLITZ_INCDIR="-I $BLITZ_INCDIR" 18 BLITZ_LIBDIR="-L $BLITZ_LIBDIR" 19 BLITZ_LIB="" 20 13 21 OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1" 14 22 OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib" -
XIOS/dev/branch_openmp/arch/arch-X64_CURIE_PGI.env
r574 r1482 1 module unload netcdf2 module unload hdf53 1 module load netcdf/4.3.3.1_hdf5_parallel 4 2 #module unload intel 5 3 module unload pgi 6 4 module unload gnu 5 module unload boost 6 module unload blitz 7 7 module load pgi/14.10 8 module load boost 9 module load blitz 10 11 8 12 9 13 export OMPI_CC=pgcc -
XIOS/dev/branch_openmp/arch/arch-X64_CURIE_PGI.path
r574 r1482 11 11 HDF5_LIB="" 12 12 13 BOOST_INCDIR="-I $BOOST_INCDIR" 14 BOOST_LIBDIR="-L $BOOST_LIBDIR" 15 BOOST_LIB="" 16 17 BLITZ_INCDIR="-I $BLITZ_INCDIR" 18 BLITZ_LIBDIR="-L $BLITZ_LIBDIR" 19 BLITZ_LIB="" 20 13 21 OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1" 14 22 OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib" -
XIOS/dev/branch_openmp/bld.cfg
r1468 r1482 33 33 bld::target libxios.a 34 34 #bld::target generate_fortran_interface.exe 35 #bld::target xios_server.exe35 bld::target xios_server.exe 36 36 #bld::target test_regular.exe 37 37 #bld::target test_expand_domain.exe -
XIOS/dev/branch_openmp/extern/ep_dev/ep_type.hpp
r1388 r1482 184 184 struct BUFFER 185 185 { 186 void * void_buffer[1 2];186 void * void_buffer[16]; 187 187 }; 188 188 -
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.cpp
r1460 r1482 25 25 ::MPI_Datatype MPI_UNSIGNED_CHAR_STD = MPI_UNSIGNED_CHAR; 26 26 ::MPI_Datatype MPI_UINT64_T_STD = MPI_UINT64_T; 27 ::MPI_Datatype MPI_LONG_LONG_INT_STD = MPI_LONG_LONG_INT; 27 28 28 29 #undef MPI_INT … … 34 35 #undef MPI_UNSIGNED_CHAR 35 36 #undef MPI_UINT64_T 37 #undef MPI_LONG_LONG_INT 36 38 37 39 … … 57 59 extern ::MPI_Datatype MPI_UNSIGNED_CHAR_STD; 58 60 extern ::MPI_Datatype MPI_UINT64_T_STD; 61 extern ::MPI_Datatype MPI_LONG_LONG_INT_STD; 59 62 60 63 … … 79 82 ep_lib::MPI_Datatype MPI_UNSIGNED_CHAR = &MPI_UNSIGNED_CHAR_STD; 80 83 ep_lib::MPI_Datatype MPI_UINT64_T = &MPI_UINT64_T_STD; 84 ep_lib::MPI_Datatype MPI_LONG_LONG_INT = &MPI_LONG_LONG_INT_STD; 81 85 82 86 -
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.hpp
r1460 r1482 10 10 #undef MPI_UNSIGNED_CHAR 11 11 #undef MPI_UINT64_T 12 #undef MPI_LONG_LONG_INT 12 13 13 14 #undef MPI_SUM … … 31 32 extern ep_lib::MPI_Datatype MPI_UNSIGNED_CHAR; 32 33 extern ep_lib::MPI_Datatype MPI_UINT64_T; 34 extern ep_lib::MPI_Datatype MPI_LONG_LONG_INT; 33 35 34 36 extern ep_lib::MPI_Op MPI_SUM; -
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_reduce.cpp
r1461 r1482 130 130 reduce_max<uint64_t>(static_cast<uint64_t*>(comm.my_buffer->void_buffer[i]), static_cast<uint64_t*>(recvbuf), count); 131 131 } 132 133 else if(datatype == MPI_LONG_LONG_INT) 134 { 135 assert(datasize == sizeof(long long)); 136 for(int i=1; i<num_ep; i++) 137 reduce_max<long long>(static_cast<long long*>(comm.my_buffer->void_buffer[i]), static_cast<long long*>(recvbuf), count); 138 } 132 139 133 140 else printf("datatype Error\n"); … … 185 192 reduce_min<uint64_t>(static_cast<uint64_t*>(comm.my_buffer->void_buffer[i]), static_cast<uint64_t*>(recvbuf), count); 186 193 } 194 195 else if(datatype == MPI_LONG_LONG_INT) 196 { 197 assert(datasize == sizeof(long long)); 198 for(int i=1; i<num_ep; i++) 199 reduce_min<long long>(static_cast<long long*>(comm.my_buffer->void_buffer[i]), static_cast<long long*>(recvbuf), count); 200 } 187 201 188 202 else printf("datatype Error\n"); … … 240 254 for(int i=1; i<num_ep; i++) 241 255 reduce_sum<uint64_t>(static_cast<uint64_t*>(comm.my_buffer->void_buffer[i]), static_cast<uint64_t*>(recvbuf), count); 256 } 257 258 else if(datatype ==MPI_LONG_LONG_INT) 259 { 260 assert(datasize == sizeof(long long)); 261 for(int i=1; i<num_ep; i++) 262 reduce_sum<long long>(static_cast<long long*>(comm.my_buffer->void_buffer[i]), static_cast<long long*>(recvbuf), count); 242 263 } 243 264 -
XIOS/dev/branch_openmp/src/attribute_template.hpp
r1460 r1482 52 52 void set(const CAttributeTemplate& attr) ; 53 53 void reset(void) ; 54 void checkEmpty(void) const; 54 55 55 56 void setInheritedValue(const CAttributeTemplate& attr ); -
XIOS/dev/branch_openmp/src/attribute_template_impl.hpp
r1117 r1482 69 69 70 70 template <class T> 71 T CAttributeTemplate<T>::getValue(void) const 71 void CAttributeTemplate<T>::checkEmpty(void) const 72 { 73 if (CType<T>::empty) 74 { 75 StdString msg("On checking attribute with id="); 76 msg.append(this->getId()); 77 msg.append(" : "); 78 msg.append("data is not initialized\n"); 79 ERROR("template <typename T> void CType<T>::checkEmpty(void) const", << msg); 80 } 81 } 82 83 template <class T> 84 T CAttributeTemplate<T>::getValue(void) const 72 85 { 73 86 return CType<T>::get() ; 74 /* 75 if (SuperClass::isEmpty()) 76 { 77 ERROR("T CAttributeTemplate<T>::getValue(void) const", 78 << "[ id = " << this->getId() << "]" 79 << " L'attribut est requis mais n'est pas défini !"); 80 } 81 return (SuperClass::getValue<T>()); 82 */ 83 } 84 85 /* 86 template <class T> 87 T* CAttributeTemplate<T>::getRef(void) 88 { 89 if (SuperClass::isEmpty()) 90 { 91 ERROR("T CAttributeTemplate<T>::getValue(void) const", 92 << "[ id = " << this->getId() << "]" 93 << " L'attribut est requis mais n'est pas défini !"); 94 } 95 return (SuperClass::getRef<T>()); 96 } 97 */ 98 99 template <class T> 100 void CAttributeTemplate<T>::setValue(const T & value) 87 } 88 89 90 91 template <class T> 92 void CAttributeTemplate<T>::setValue(const T & value) 101 93 { 102 94 CType<T>::set(value) ; -
XIOS/dev/branch_openmp/src/calendar_util.cpp
r643 r1482 130 130 { 131 131 // TODO :: Vérifier que les deux dates (dt0 et dt1) ont une référence vers le même calendrier. 132 CDuration dur =133 { dt0.getYear() - dt1.getYear(), dt0.getMonth() - dt1.getMonth() , dt0.getDay() - dt1.getDay(),134 dt0.getHour() - dt1.getHour(), dt0.getMinute() - dt1.getMinute(), dt0.getSecond() - dt1.getSecond() }; 132 CDuration dur( dt0.getYear() - dt1.getYear(), dt0.getMonth() - dt1.getMonth() , dt0.getDay() - dt1.getDay(), 133 dt0.getHour() - dt1.getHour(), dt0.getMinute() - dt1.getMinute(), dt0.getSecond() - dt1.getSecond() ); 134 135 135 return (dur.resolve(dt0.getRelCalendar())); 136 136 } -
XIOS/dev/branch_openmp/src/context_client.cpp
r1460 r1482 107 107 typeId_in=event.getTypeId() ; 108 108 classId_in=event.getClassId() ; 109 MPI_Allreduce(&timeLine,&timeLine_out, 1, MPI_UINT64_T, MPI_SUM, intraComm) ; 109 //MPI_Allreduce(&timeLine,&timeLine_out, 1, MPI_UINT64_T, MPI_SUM, intraComm) ; 110 MPI_Allreduce(&timeLine,&timeLine_out, 1, MPI_LONG_LONG_INT, MPI_SUM, intraComm) ; 110 111 MPI_Allreduce(&typeId_in,&typeId, 1, MPI_INT, MPI_SUM, intraComm) ; 111 112 MPI_Allreduce(&classId_in,&classId, 1, MPI_INT, MPI_SUM, intraComm) ; … … 343 344 for (std::map<int,StdSize>::const_iterator it = mapSize.begin(), ite = mapSize.end(); it != ite; ++it) 344 345 { 345 double ratio = double(it->second) / maxEventSize .at(it->first);346 double ratio = double(it->second) / maxEventSizes[it->first]; 346 347 if (ratio < minBufferSizeEventSizeRatio) minBufferSizeEventSizeRatio = ratio; 347 348 } -
XIOS/dev/branch_openmp/src/duration.cpp
r1105 r1482 7 7 { 8 8 /// ////////////////////// Définitions ////////////////////// /// 9 const CDuration Year = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, 10 Month = { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, 11 Week = { 0.0, 0.0, 7.0, 0.0, 0.0, 0.0, 0.0 }, 12 Day = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0 }, 13 Hour = { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 }, 14 Minute = { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, 15 Second = { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 }, 16 TimeStep = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 }, 17 NoneDu = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; 9 10 const CDuration Year ( 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ); 11 const CDuration Month ( 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 ); 12 const CDuration Week ( 0.0, 0.0, 7.0, 0.0, 0.0, 0.0, 0.0 ); 13 const CDuration Day ( 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0 ); 14 const CDuration Hour ( 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 ); 15 const CDuration Minute ( 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 ); 16 const CDuration Second ( 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ); 17 const CDuration TimeStep ( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 ); 18 const CDuration NoneDu ( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ); 18 19 19 20 ///--------------------------------------------------------------- 21 22 CDuration::CDuration(double y, double m, double d, double h, double min, double s, double ts) : 23 year(y), month(m), day(d), hour(h), minute(min), second(s), timestep(ts) 24 { 25 } 26 20 27 21 28 CDuration& CDuration::operator=(const CDuration& duration) -
XIOS/dev/branch_openmp/src/duration.hpp
r1105 r1482 20 20 21 21 public: 22 CDuration(double year=0.0, double month=0.0, double day=0.0, double hour=0.0, double minute=0.0, double second=0.0, double timestep=0.0); 23 22 24 /// Opérateurs /// 23 25 CDuration& operator=(const CDuration& duration); -
XIOS/dev/branch_openmp/src/filter/file_writer_filter.cpp
r1460 r1482 29 29 for (size_t idx = 0; idx < nbData; ++idx) 30 30 { 31 if (NumTraits<double>::is nan(dataArray(idx)))31 if (NumTraits<double>::isNan(dataArray(idx))) 32 32 dataArray(idx) = missingValue; 33 33 } -
XIOS/dev/branch_openmp/src/filter/spatial_transform_filter.cpp
r1460 r1482 204 204 bool ignoreMissingValue = false; 205 205 double defaultValue = std::numeric_limits<double>::quiet_NaN(); 206 if (0 != dataDest.numElements()) ignoreMissingValue = NumTraits<double>::is nan(dataDest(0));206 if (0 != dataDest.numElements()) ignoreMissingValue = NumTraits<double>::isNan(dataDest(0)); 207 207 208 208 const std::list<CGridTransformation::SendingIndexGridSourceMap>& listLocalIndexSend = gridTransformation->getLocalIndexToSendFromGridSource(); -
XIOS/dev/branch_openmp/src/filter/store_filter.cpp
r1460 r1482 93 93 for (size_t idx = 0; idx < nbData; ++idx) 94 94 { 95 if (NumTraits<double>::is nan(packet->data(idx)))95 if (NumTraits<double>::isNan(packet->data(idx))) 96 96 packet->data(idx) = missingValue; 97 97 } -
XIOS/dev/branch_openmp/src/filter/temporal_filter.cpp
r1460 r1482 17 17 , samplingOffset(samplingOffset) 18 18 , opFreq(opFreq) 19 , offsetMonth( {0, this->samplingOffset.month, 0, 0, 0, 0, 0})20 , offsetAllButMonth( {this->samplingOffset.year, 0 , this->samplingOffset.day,21 this->samplingOffset.hour, this->samplingOffset.minute,22 this->samplingOffset.second, this->samplingOffset.timestep})19 , offsetMonth(0, this->samplingOffset.month, 0, 0, 0, 0, 0) 20 , offsetAllButMonth(this->samplingOffset.year, 0 , this->samplingOffset.day, 21 this->samplingOffset.hour, this->samplingOffset.minute, 22 this->samplingOffset.second, this->samplingOffset.timestep) 23 23 , initDate(initDate) 24 24 , nextSamplingDate(initDate + (this->samplingOffset + initDate.getRelCalendar().getTimeStep())) 25 25 , nbOperationDates(1) 26 , nbSamplingDates(0) 26 27 // , nextOperationDate(initDate + opFreq + this->samplingOffset) 27 28 , isFirstOperation(true) … … 48 49 if (usePacket) 49 50 { 51 nbSamplingDates ++; 50 52 if (!copyLess) 51 53 { … … 56 58 } 57 59 58 nextSamplingDate = nextSamplingDate + samplingFreq;60 nextSamplingDate = ((initDate + offsetMonth) + nbSamplingDates * samplingFreq) + offsetAllButMonth + initDate.getRelCalendar().getTimeStep(); 59 61 } 60 62 -
XIOS/dev/branch_openmp/src/filter/temporal_filter.hpp
r1460 r1482 67 67 CDate nextSamplingDate; //!< The date of the next sampling 68 68 int nbOperationDates; //!< The number of times an operation is performed 69 int nbSamplingDates; 69 70 // CDate nextOperationDate; //!< The date of the next operation 70 71 bool isFirstOperation; //!< True before the first operation was been computed -
XIOS/dev/branch_openmp/src/functor/accumulate.cpp
r1018 r1482 34 34 double* out=_doutput.dataFirst(); 35 35 for (i=0; i<n; ++i,++in,++out) 36 if (!NumTraits<double>::is nan(*in))36 if (!NumTraits<double>::isNan(*in)) 37 37 { 38 if(!NumTraits<double>::is nan(*out)) *out += *in;38 if(!NumTraits<double>::isNan(*out)) *out += *in; 39 39 else *out=*in ; 40 40 } -
XIOS/dev/branch_openmp/src/functor/average.cpp
r1018 r1482 43 43 int* nc=nbcalls.dataFirst() ; 44 44 for (i=0; i<n; ++i,++nc,++in) 45 if (!NumTraits<double>::is nan(*in)) (*nc) ++;45 if (!NumTraits<double>::isNan(*in)) (*nc) ++; 46 46 } 47 47 } … … 55 55 int* nc=nbcalls.dataFirst() ; 56 56 for (i=0; i<n; ++i,++in,++out,++nc) 57 if (!NumTraits<double>::is nan(*in))57 if (!NumTraits<double>::isNan(*in)) 58 58 { 59 59 if (*nc != 0) (*out) += *in; -
XIOS/dev/branch_openmp/src/functor/maximum.cpp
r1018 r1482 34 34 { 35 35 for (; it1 != end1; it1++, it++) 36 if (!NumTraits<double>::is nan(*it1))36 if (!NumTraits<double>::isNan(*it1)) 37 37 { 38 if (!NumTraits<double>::is nan(*it)) *it = std::max(*it1, *it);38 if (!NumTraits<double>::isNan(*it)) *it = std::max(*it1, *it); 39 39 else *it=*it1 ; 40 40 } -
XIOS/dev/branch_openmp/src/functor/minimum.cpp
r1018 r1482 36 36 { 37 37 for (; it1 != end1; it1++, it++) 38 if (!NumTraits<double>::is nan(*it1))38 if (!NumTraits<double>::isNan(*it1)) 39 39 { 40 if (!NumTraits<double>::is nan(*it)) *it = std::min(*it1, *it);40 if (!NumTraits<double>::isNan(*it)) *it = std::min(*it1, *it); 41 41 else *it=*it1 ; 42 42 } -
XIOS/dev/branch_openmp/src/interface/c/icdate.cpp
r801 r1482 70 70 date_c.year, date_c.month, date_c.day, 71 71 date_c.hour, date_c.minute, date_c.second); 72 xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day, 73 dur_c.hour, dur_c.minute, dur_c.second, 74 dur_c.timestep }; 72 73 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 75 74 xios::CDate res = date + dur; 76 75 return { res.getYear(), res.getMonth(), res.getDay(), res.getHour(), res.getMinute(), res.getSecond() }; … … 82 81 date_c.year, date_c.month, date_c.day, 83 82 date_c.hour, date_c.minute, date_c.second); 84 xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day, 85 dur_c.hour, dur_c.minute, dur_c.second, 86 dur_c.timestep }; 83 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 87 84 xios::CDate res = date - dur; 88 85 return { res.getYear(), res.getMonth(), res.getDay(), res.getHour(), res.getMinute(), res.getSecond() }; -
XIOS/dev/branch_openmp/src/interface/c/icduration.cpp
r801 r1482 7 7 void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size) 8 8 { 9 xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day, 10 dur_c.hour, dur_c.minute, dur_c.second, 11 dur_c.timestep }; 12 9 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 13 10 if (!string_copy(dur.toString(), str, str_size)) 14 11 ERROR("void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size)", << "Input string is too short"); … … 28 25 cxios_duration cxios_duration_add(cxios_duration dur1_c, cxios_duration dur2_c) 29 26 { 30 xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day, 31 dur1_c.hour, dur1_c.minute, dur1_c.second, 32 dur1_c.timestep }; 33 xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day, 34 dur2_c.hour, dur2_c.minute, dur2_c.second, 35 dur2_c.timestep }; 27 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 28 xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep ); 36 29 xios::CDuration res = dur1 + dur2; 37 30 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; … … 40 33 cxios_duration cxios_duration_sub(cxios_duration dur1_c, cxios_duration dur2_c) 41 34 { 42 xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day, 43 dur1_c.hour, dur1_c.minute, dur1_c.second, 44 dur1_c.timestep }; 45 xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day, 46 dur2_c.hour, dur2_c.minute, dur2_c.second, 47 dur2_c.timestep }; 35 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 36 xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep ); 48 37 xios::CDuration res = dur1 - dur2; 49 38 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; … … 52 41 cxios_duration cxios_duration_mult(double val, cxios_duration dur_c) 53 42 { 54 xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day, 55 dur_c.hour, dur_c.minute, dur_c.second, 56 dur_c.timestep }; 43 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 57 44 xios::CDuration res = val * dur; 58 45 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; … … 61 48 cxios_duration cxios_duration_neg(cxios_duration dur_c) 62 49 { 63 xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day, 64 dur_c.hour, dur_c.minute, dur_c.second, 65 dur_c.timestep }; 50 xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep ); 66 51 xios::CDuration res = -dur; 67 52 return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep }; … … 70 55 bool cxios_duration_eq(cxios_duration dur1_c, cxios_duration dur2_c) 71 56 { 72 xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day, 73 dur1_c.hour, dur1_c.minute, dur1_c.second, 74 dur1_c.timestep }; 75 xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day, 76 dur2_c.hour, dur2_c.minute, dur2_c.second, 77 dur2_c.timestep }; 57 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 58 xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep ); 78 59 return (dur1 == dur2); 79 60 } … … 81 62 bool cxios_duration_neq(cxios_duration dur1_c, cxios_duration dur2_c) 82 63 { 83 xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day, 84 dur1_c.hour, dur1_c.minute, dur1_c.second, 85 dur1_c.timestep }; 86 xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day, 87 dur2_c.hour, dur2_c.minute, dur2_c.second, 88 dur2_c.timestep }; 64 xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep ); 65 xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep ); 89 66 return (dur1 != dur2); 90 67 } -
XIOS/dev/branch_openmp/src/io/nc4_data_input.cpp
r1460 r1482 189 189 */ 190 190 191 if (!SuperClassWriter::isRectilinear(fieldId)) 191 //if (!SuperClassWriter::isRectilinear(fieldId)) 192 if (true) 192 193 { 193 194 for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it) … … 471 472 itMapNj = itMapNi; ++itMapNj; 472 473 473 if (this->isRectilinear(fieldId) || this->isCurvilinear(fieldId)) 474 if (CDomain::type_attr::rectilinear == domain->type || CDomain::type_attr::curvilinear == domain->type || 475 this->isRectilinear(fieldId) || this->isCurvilinear(fieldId)) 474 476 { 475 477 if (!domain->nj_glo.isEmpty() && (domain->nj_glo != itMapNj->second)) … … 495 497 domain->ni_glo.setValue(itMapNi->second); 496 498 } 497 else if ( this->isUnstructured(fieldId))499 else if (CDomain::type_attr::unstructured == domain->type|| this->isUnstructured(fieldId)) 498 500 { 499 501 domain->nj_glo.setValue(1); -
XIOS/dev/branch_openmp/src/node/field.cpp
r1460 r1482 224 224 CArray<double,1> recv_data_tmp(recvDataSrv.numElements()); 225 225 const CDate& currDate = context->getCalendar()->getCurrentDate(); 226 const CDate opeDate = (last_operation_srv + context->getCalendar()->getTimeStep()) +freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep(); 226 CDuration offsetAllButMonth (freq_offset.getValue().year, 0 , freq_offset.getValue().day, 227 freq_offset.getValue().hour, freq_offset.getValue().minute, 228 freq_offset.getValue().second, freq_offset.getValue().timestep); 229 const CDate opeDate = (last_operation_srv - offsetAllButMonth + context->getCalendar()->getTimeStep()) 230 + freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep() + offsetAllButMonth; 227 231 228 232 if (opeDate <= currDate) … … 251 255 252 256 const CDate& currDate = context->getCalendar()->getCurrentDate(); 253 const CDate opeDate = (last_operation_srv + context->getCalendar()->getTimeStep()) + freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep(); 257 CDuration offsetAllButMonth (freq_offset.getValue().year, 0 , freq_offset.getValue().day, 258 freq_offset.getValue().hour, freq_offset.getValue().minute, 259 freq_offset.getValue().second, freq_offset.getValue().timestep); 260 const CDate opeDate = (last_operation_srv - offsetAllButMonth + context->getCalendar()->getTimeStep()) 261 + freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep() + offsetAllButMonth; 254 262 const CDate writeDate = last_Write_srv + freq_write_srv; 255 263 -
XIOS/dev/branch_openmp/src/parse_expr/operator_expr.hpp
r1038 r1482 7 7 #include "exception.hpp" 8 8 #include "array_new.hpp" 9 #include "utils.hpp" 9 10 10 11 using namespace std; … … 253 254 static inline double div_ss(double x, double y) { return x / y; } 254 255 static inline double pow_ss(double x, double y) { return std::pow(x,y); } 255 static inline double eq_ss(double x, double y) { return x == y; } 256 static inline double eq_ss(double x, double y) // specific check for NaN 257 { 258 bool xNan=NumTraits<double>::isNan(x) ; 259 bool yNan=NumTraits<double>::isNan(y) ; 260 if (xNan && yNan) return true ; 261 else if (xNan) return false ; 262 else if (yNan) return false ; 263 else return x == y; 264 } 265 256 266 static inline double lt_ss(double x, double y) { return x < y; } 257 267 static inline double gt_ss(double x, double y) { return x > y; } 258 268 static inline double le_ss(double x, double y) { return x <= y; } 259 269 static inline double ge_ss(double x, double y) { return x >= y; } 260 static inline double ne_ss(double x, double y) { return x != y; } 270 static inline double ne_ss(double x, double y) // specific check for NaN 271 { 272 bool xNan=NumTraits<double>::isNan(x) ; 273 bool yNan=NumTraits<double>::isNan(y) ; 274 if (xNan && yNan) return false ; 275 else if (xNan) return true ; 276 else if (yNan) return true ; 277 else return x != y; 278 } 261 279 262 280 static inline CArray<double,1> neg_f(const CArray<double,1>& x) { return Array<double,1>(-x); } … … 286 304 static inline CArray<double,1> div_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x / y); } 287 305 static inline CArray<double,1> pow_fs(const CArray<double,1>& x, double y) { return Array<double,1>(pow(x,y)); } 288 static inline CArray<double,1> eq_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x == y); } 306 static inline CArray<double,1> eq_fs(const CArray<double,1>& x, double y) // specific check for NaN 307 { 308 if (NumTraits<double>::isNan(y)) 309 { 310 CArray<double,1> ret(x.numElements()) ; 311 Array<double,1>::const_iterator itx=x.begin(),itxe=x.end(); 312 Array<double,1>::iterator itret=ret.begin() ; 313 for(;itx!=itxe;++itx,++itret) *itret=NumTraits<double>::isNan(*itx) ; 314 return ret ; 315 } 316 else return Array<double,1>(x == y); 317 } 318 289 319 static inline CArray<double,1> lt_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x < y); } 290 320 static inline CArray<double,1> gt_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x > y); } 291 321 static inline CArray<double,1> le_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x <= y); } 292 322 static inline CArray<double,1> ge_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x >= y); } 293 static inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x != y); } 323 static inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y) // specific check for NaN 324 { 325 if (NumTraits<double>::isNan(y)) 326 { 327 CArray<double,1> ret(x.numElements()) ; 328 Array<double,1>::const_iterator itx=x.begin(),itxe=x.end(); 329 Array<double,1>::iterator itret=ret.begin() ; 330 for(;itx!=itxe;++itx,++itret) *itret = !NumTraits<double>::isNan(*itx) ; 331 return ret ; 332 } 333 else return Array<double,1>(x != y); 334 } 294 335 295 336 static inline CArray<double,1> add_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x + y); } … … 297 338 static inline CArray<double,1> mult_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x * y); } 298 339 static inline CArray<double,1> div_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x / y); } 299 static inline CArray<double,1> eq_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x == y); } 340 static inline CArray<double,1> eq_sf(double x, const CArray<double,1>& y) // specific check for NaN 341 { 342 if (NumTraits<double>::isNan(x)) 343 { 344 CArray<double,1> ret(y.numElements()) ; 345 Array<double,1>::const_iterator ity=y.begin(),itye=y.end(); 346 Array<double,1>::iterator itret=ret.begin() ; 347 for(;ity!=itye;++ity,++itret) *itret=NumTraits<double>::isNan(*ity) ; 348 return ret ; 349 } 350 else return Array<double,1>(x == y); 351 } 352 300 353 static inline CArray<double,1> lt_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x < y); } 301 354 static inline CArray<double,1> gt_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x > y); } 302 355 static inline CArray<double,1> le_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x <= y); } 303 356 static inline CArray<double,1> ge_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x >= y); } 304 static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x != y); } 357 static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y) // specific check for NaN 358 { 359 if (NumTraits<double>::isNan(x)) 360 { 361 CArray<double,1> ret(y.numElements()) ; 362 Array<double,1>::const_iterator ity=y.begin(),itye=y.end(); 363 Array<double,1>::iterator itret=ret.begin() ; 364 for(;ity!=itye;++ity,++itret) *itret=!NumTraits<double>::isNan(*ity) ; 365 return ret ; 366 } 367 else return Array<double,1>(x != y); 368 } 369 305 370 306 371 -
XIOS/dev/branch_openmp/src/transformation/Functions/average_reduction.cpp
r1328 r1482 47 47 currentlocalIndex = localIndex[idx].first; 48 48 currentWeight = localIndex[idx].second; 49 if (!NumTraits<double>::is nan(*(dataInput + idx)))49 if (!NumTraits<double>::isNan(*(dataInput + idx))) 50 50 { 51 51 if (flagInitial[currentlocalIndex]) -
XIOS/dev/branch_openmp/src/transformation/Functions/max_reduction.cpp
r1328 r1482 41 41 { 42 42 currentlocalIndex = localIndex[idx].first; 43 if (!NumTraits<double>::is nan(*(dataInput + idx)))43 if (!NumTraits<double>::isNan(*(dataInput + idx))) 44 44 { 45 45 if (flagInitial[currentlocalIndex]) -
XIOS/dev/branch_openmp/src/transformation/Functions/min_reduction.cpp
r1328 r1482 41 41 { 42 42 currentlocalIndex = localIndex[idx].first; 43 if (!NumTraits<double>::is nan(*(dataInput + idx)))43 if (!NumTraits<double>::isNan(*(dataInput + idx))) 44 44 { 45 45 if (flagInitial[currentlocalIndex]) -
XIOS/dev/branch_openmp/src/transformation/Functions/sum_reduction.cpp
r1328 r1482 43 43 { 44 44 currentlocalIndex = localIndex[idx].first; 45 if (!NumTraits<double>::is nan(*(dataInput + idx)))45 if (!NumTraits<double>::isNan(*(dataInput + idx))) 46 46 { 47 47 if (flagInitial[currentlocalIndex]) -
XIOS/dev/branch_openmp/src/transformation/domain_algorithm_interpolate.cpp
r1460 r1482 916 916 renormalizationFactor=1 ; 917 917 } 918 919 if (firstPass) 920 { 921 allMissing.resize(dataOut.numElements()) ; 922 allMissing=true ; 923 } 918 924 919 925 for (int idx = 0; idx < nbLocalIndex; ++idx) 920 926 { 921 if (NumTraits<double>::is nan(*(dataInput + idx)))927 if (NumTraits<double>::isNan(*(dataInput + idx))) 922 928 { 923 flagInitial[localIndex[idx].first] = false;929 allMissing(localIndex[idx].first) = allMissing(localIndex[idx].first) && true; 924 930 if (renormalize) renormalizationFactor(localIndex[idx].first)-=localIndex[idx].second ; 925 931 } 926 932 else 927 933 { 928 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 929 flagInitial[localIndex[idx].first] = true; // Reset flag to indicate not all data source are nan 934 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 930 935 } 931 936 } 932 937 933 // If all data source are nan then data destination must be nan 938 } 939 else 940 { 934 941 for (int idx = 0; idx < nbLocalIndex; ++idx) 935 942 { 936 if (!flagInitial[localIndex[idx].first])937 dataOut(localIndex[idx].first) = defaultValue;938 }939 }940 else941 {942 for (int idx = 0; idx < nbLocalIndex; ++idx)943 {944 943 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 945 944 } … … 949 948 void CDomainAlgorithmInterpolate::updateData(CArray<double,1>& dataOut) 950 949 { 951 if (detectMissingValue && renormalize) 952 { 953 if (renormalizationFactor.numElements()>0) dataOut/=renormalizationFactor ; // In some case, process doesn't received any data for interpolation (mask) 954 // so renormalizationFactor is not initialized 955 } 956 } 957 958 } 950 if (detectMissingValue) 951 { 952 double defaultValue = std::numeric_limits<double>::quiet_NaN(); 953 size_t nbIndex=dataOut.numElements() ; 954 955 for (int idx = 0; idx < nbIndex; ++idx) 956 { 957 if (allMissing(idx)) dataOut(idx) = defaultValue; // If all data source are nan then data destination must be nan 958 } 959 960 if (renormalize) 961 { 962 if (renormalizationFactor.numElements()>0) dataOut/=renormalizationFactor ; // In some case, process doesn't received any data for interpolation (mask) 963 // so renormalizationFactor is not initialized 964 } 965 } 966 } 967 968 } -
XIOS/dev/branch_openmp/src/transformation/domain_algorithm_interpolate.hpp
r1460 r1482 55 55 private: 56 56 CArray<double,1> renormalizationFactor ; 57 CArray<bool,1> allMissing ; 57 58 bool detectMissingValue ; 58 59 bool renormalize ; -
XIOS/dev/branch_openmp/src/transformation/generic_algorithm_transformation.cpp
r1460 r1482 37 37 int nbLocalIndex = localIndex.size(); 38 38 double defaultValue = std::numeric_limits<double>::quiet_NaN(); 39 39 40 if (ignoreMissingValue) 40 41 { 42 if (firstPass) dataOut=defaultValue ; 43 41 44 for (int idx = 0; idx < nbLocalIndex; ++idx) 42 45 { 43 if (NumTraits<double>::isnan(*(dataInput + idx))) 44 { 45 flagInitial[localIndex[idx].first] = false; 46 } 47 else 48 { 49 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 50 flagInitial[localIndex[idx].first] = true; // Reset flag to indicate not all data source are nan 51 } 52 } 53 54 // If all data source are nan then data destination must be nan 55 for (int idx = 0; idx < nbLocalIndex; ++idx) 56 { 57 if (!flagInitial[localIndex[idx].first]) 58 dataOut(localIndex[idx].first) = defaultValue; 46 if (! NumTraits<double>::isNan(*(dataInput + idx))) 47 { 48 if (flagInitial[localIndex[idx].first]) dataOut(localIndex[idx].first) = *(dataInput + idx) * localIndex[idx].second; 49 else dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 50 flagInitial[localIndex[idx].first] = false; // Reset flag to indicate not all data source are nan 51 } 59 52 } 60 53 } -
XIOS/dev/branch_openmp/src/type/type.hpp
r1334 r1482 47 47 48 48 void allocate(void) ; 49 v oid checkEmpty(void) const;49 virtual void checkEmpty(void) const {return _checkEmpty();}; 50 50 51 51 T* ptrValue ; … … 63 63 void _reset(void) ; 64 64 bool _isEmpty() const ; 65 void _checkEmpty(void) const; 65 66 size_t _size(void) const ; 66 67 -
XIOS/dev/branch_openmp/src/type/type_impl.hpp
r1105 r1482 87 87 T& CType<T>::get(void) 88 88 { 89 checkEmpty();90 return *ptrValue ;89 this->checkEmpty(); 90 return *ptrValue ; 91 91 } 92 92 … … 94 94 const T& CType<T>::get(void) const 95 95 { 96 checkEmpty();96 this->checkEmpty(); 97 97 return *ptrValue ; 98 98 } … … 122 122 CType<T>::operator T&() 123 123 { 124 checkEmpty();125 return *ptrValue ;124 this->checkEmpty(); 125 return *ptrValue ; 126 126 } 127 127 … … 129 129 CType<T>::operator const T&() const 130 130 { 131 checkEmpty();132 return *ptrValue ;131 this->checkEmpty(); 132 return *ptrValue ; 133 133 } 134 134 … … 136 136 CType<T>* CType<T>::_clone(void) const 137 137 { 138 checkEmpty();138 this->checkEmpty(); 139 139 return new CType(*this) ; 140 140 } … … 165 165 { 166 166 ostringstream oss; 167 checkEmpty();167 this->checkEmpty(); 168 168 oss<<*ptrValue ; 169 169 return oss.str() ; … … 173 173 bool CType<T>::_toBuffer(CBufferOut& buffer) const 174 174 { 175 checkEmpty();175 this->checkEmpty(); 176 176 return buffer.put(*ptrValue) ; 177 177 } … … 206 206 207 207 template <typename T> 208 void CType<T>:: checkEmpty(void) const208 void CType<T>::_checkEmpty(void) const 209 209 { 210 210 if (empty) ERROR("template <typename T> void CType<T>::checkEmpty(void) const", << "Data is not initialized") ; -
XIOS/dev/branch_openmp/src/utils.hpp
r1018 r1482 257 257 return 1e-12; 258 258 } 259 static inline bool is nan(const Scalar& v) {259 static inline bool isNan(const Scalar& v) { 260 260 return (v != v); 261 261 } -
XIOS/dev/branch_openmp/src/xios_server.f90
r1328 r1482 4 4 INCLUDE "mpif.h" 5 5 INTEGER :: ierr 6 6 7 7 8 CALL xios_init_server 9 8 10 9 11 END PROGRAM server_main
Note: See TracChangeset
for help on using the changeset viewer.