- Timestamp:
- 06/06/17 15:12:34 (7 years ago)
- Location:
- XIOS/dev/branch_yushan_merged
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/extern/remap/src/gridRemap.cpp
r688 r1155 11 11 12 12 CRemapGrid srcGrid; 13 #pragma omp threadprivate(srcGrid) 14 13 15 CRemapGrid tgtGrid; 16 #pragma omp threadprivate(tgtGrid) 14 17 15 18 } -
XIOS/dev/branch_yushan_merged/extern/remap/src/gridRemap.hpp
r688 r1155 14 14 Coord readPole(std::istream&); 15 15 16 extern CRemapGrid srcGrid; 17 extern CRemapGrid tgtGrid; 16 18 17 19 18 } -
XIOS/dev/branch_yushan_merged/extern/remap/src/intersect.cpp
r1153 r1155 16 16 17 17 using namespace std; 18 19 extern CRemapGrid srcGrid; 20 #pragma omp threadprivate(srcGrid) 21 22 extern CRemapGrid tgtGrid; 23 #pragma omp threadprivate(tgtGrid) 18 24 19 25 /** returns index of edge of a that is shared with b, -
XIOS/dev/branch_yushan_merged/extern/remap/src/intersection_ym.cpp
r849 r1155 16 16 using namespace std; 17 17 using namespace ClipperLib ; 18 19 extern CRemapGrid srcGrid; 20 #pragma omp threadprivate(srcGrid) 21 22 extern CRemapGrid tgtGrid; 23 #pragma omp threadprivate(tgtGrid) 18 24 19 25 double intersect_ym(Elt *a, Elt *b) -
XIOS/dev/branch_yushan_merged/extern/remap/src/libmapper.cpp
r694 r1155 14 14 #include "mapper.hpp" 15 15 #include "cputime.hpp" // cputime 16 #include "gridRemap.hpp" 16 17 17 18 using namespace sphereRemap ; 19 20 extern CRemapGrid srcGrid; 21 #pragma omp threadprivate(srcGrid) 22 23 extern CRemapGrid tgtGrid; 24 #pragma omp threadprivate(tgtGrid) 25 18 26 19 27 /* mapper is a ponter to a global class instance whoes members are allocated in the first step (finding the sizes of the weight arrays) 20 28 and deallocated during the second step (computing the weights) */ 21 29 Mapper *mapper; 22 30 #pragma omp threadprivate(mapper) 23 31 24 32 /** xxx_bounds_yyy is of length n_vert_per_cell_xxx*n_cell_xxx … … 148 156 char **argv = NULL; 149 157 MPI_Init(&argc, &argv);*/ 150 MPI_Init(NULL, NULL); 158 //MPI_Init(NULL, NULL); 159 int provided; 160 MPI_Init_thread(NULL, NULL, 3, &provided); 161 assert(provided >= 3); 151 162 } 152 163 -
XIOS/dev/branch_yushan_merged/extern/remap/src/mapper.cpp
r1153 r1155 14 14 15 15 namespace sphereRemap { 16 17 extern CRemapGrid srcGrid; 18 #pragma omp threadprivate(srcGrid) 19 20 extern CRemapGrid tgtGrid; 21 #pragma omp threadprivate(tgtGrid) 16 22 17 23 /* A subdivition of an array into N sub-arays -
XIOS/dev/branch_yushan_merged/extern/remap/src/node.cpp
r923 r1155 254 254 NodePtr insert(NodePtr thIs, NodePtr node) 255 255 { 256 257 258 259 260 261 262 263 264 256 int la = thIs->level; // node to be inserted 257 int lb = node->level; // node where insertation 258 assert(la < lb); // node to be inserted must have lower level then parent 259 //if (thIs->parent) assert(find_in_tree1(thIs) == true); 260 NodePtr q = NULL; 261 NodePtr chd = NULL; 262 node->move(thIs); 263 if (la == lb - 1) 264 { 265 265 node->child.push_back(thIs); 266 thIs->parent = node; 267 if (node->child.size() > MAX_NODE_SZ && node->tree->canSplit() ) // with us as additional child `node` is now too large :( 268 return (node->reinserted || node->parent == NULL) ? split(node) : reinsert(node); 269 } 270 else // la < lb - 1 271 { 272 chd = thIs->closest(node->child); 273 q = insert(thIs, chd); 274 } 275 if ((node->updateCount + 1) % UPDATE_EVERY == 0) 276 node->update(); 277 else 278 { 279 if (q) node->remove(q); 280 node->inflate(chd); 281 } 282 266 thIs->parent = node; 267 if (node->child.size() > MAX_NODE_SZ && node->tree->canSplit() ) // with us as additional child `node` is now too large :( 268 return (node->reinserted || node->parent == NULL) ? split(node) : reinsert(node); 269 } 270 else // la < lb - 1 271 { 272 chd = thIs->closest(node->child); 273 q = insert(thIs, chd); 274 } 275 if ((node->updateCount + 1) % UPDATE_EVERY == 0) 276 node->update(); 277 else 278 { 279 if (q) node->remove(q); 280 node->inflate(chd); 281 } 283 282 284 283 return q; -
XIOS/dev/branch_yushan_merged/extern/remap/src/parallel_tree.cpp
r923 r1155 16 16 17 17 static const int assignLevel = 2; 18 19 extern CRemapGrid srcGrid; 20 #pragma omp threadprivate(srcGrid) 21 22 extern CRemapGrid tgtGrid; 23 #pragma omp threadprivate(tgtGrid) 18 24 19 25 // only the circle is packed, rest of node will be initialized on unpacking -
XIOS/dev/branch_yushan_merged/inputs/REMAP/iodef.xml
r1076 r1155 67 67 </file_group> 68 68 <file_group id="read_then_write_files" enabled=".TRUE."> 69 <file id="output_regular_pole" name="output_dst_regular" >69 <file id="output_regular_pole" name="output_dst_regular" enabled=".FALSE." > 70 70 <field field_ref="tmp_field_0" name="field_regular_0" /> 71 71 <field field_ref="dst_field_regular" name="field_regular" /> -
XIOS/dev/branch_yushan_merged/src/node/field.cpp
r1153 r1155 292 292 while (currentDate >= lastDataRequestedFromServer) 293 293 { 294 info(20) << "currentDate : " << currentDate << endl ; 295 info(20) << "lastDataRequestedFromServer : " << lastDataRequestedFromServer << endl ; 296 info(20) << "file->output_freq.getValue() : " << file->output_freq.getValue() << endl ; 297 info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ; 298 294 #pragma omp critical (_output) 295 { 296 info(20) << "currentDate : " << currentDate << endl ; 297 info(20) << "lastDataRequestedFromServer : " << lastDataRequestedFromServer << endl ; 298 info(20) << "file->output_freq.getValue() : " << file->output_freq.getValue() << endl ; 299 info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ; 300 } 299 301 dataRequested |= sendReadDataRequest(lastDataRequestedFromServer + file->output_freq); 300 302 } -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/reduction.cpp
r1153 r1155 11 11 //std::map<StdString,EReductionType> CReductionAlgorithm::ReductionOperations = std::map<StdString,EReductionType>(); 12 12 std::map<StdString,EReductionType> *CReductionAlgorithm::ReductionOperations_ptr = 0; 13 14 bool CReductionAlgorithm::initReductionOperation(std::map<StdString,EReductionType>& m) 15 { 16 // So so stupid way to intialize operation but it works ... 17 m["sum"] = TRANS_REDUCE_SUM; 18 CSumReductionAlgorithm::registerTrans(); 19 20 m["min"] = TRANS_REDUCE_MIN; 21 CMinReductionAlgorithm::registerTrans(); 22 23 m["max"] = TRANS_REDUCE_MAX; 24 CMaxReductionAlgorithm::registerTrans(); 25 26 m["extract"] = TRANS_REDUCE_EXTRACT; 27 CExtractReductionAlgorithm::registerTrans(); 28 29 m["average"] = TRANS_REDUCE_AVERAGE; 30 CAverageReductionAlgorithm::registerTrans(); 31 } 13 //#pragma omp threadprivate(CReductionAlgorithm::ReductionOperations_ptr) 32 14 33 15 34 16 bool CReductionAlgorithm::initReductionOperation() 35 17 { 36 if(CReductionAlgorithm::ReductionOperations_ptr == NULL)CReductionAlgorithm::ReductionOperations_ptr = new std::map<StdString,EReductionType>();18 CReductionAlgorithm::ReductionOperations_ptr = new std::map<StdString,EReductionType>(); 37 19 // So so stupid way to intialize operation but it works ... 38 20 (*CReductionAlgorithm::ReductionOperations_ptr)["sum"] = TRANS_REDUCE_SUM; … … 50 32 (*CReductionAlgorithm::ReductionOperations_ptr)["average"] = TRANS_REDUCE_AVERAGE; 51 33 CAverageReductionAlgorithm::registerTrans(); 52 53 printf("*CReductionAlgorithm::ReductionOperations_ptr = %p\t %p\n", *CReductionAlgorithm::ReductionOperations_ptr, &(*CReductionAlgorithm::ReductionOperations_ptr));54 34 } 55 35 56 36 //bool CReductionAlgorithm::_dummyInit = CReductionAlgorithm::initReductionOperation(CReductionAlgorithm::ReductionOperations); 57 bool CReductionAlgorithm::_dummyInit = CReductionAlgorithm::initReductionOperation();37 //bool CReductionAlgorithm::_dummyInit = CReductionAlgorithm::initReductionOperation(); 58 38 59 39 CReductionAlgorithm* CReductionAlgorithm::createOperation(EReductionType reduceType) 60 40 { 61 41 int reduceTypeInt = reduceType; 62 //if (0 == reductionCreationCallBacks_)63 // reductionCreationCallBacks_ = new CallBackMap();64 42 65 43 CallBackMap::const_iterator it = (*reductionCreationCallBacks_).find(reduceType); -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/reduction.hpp
r1134 r1155 28 28 29 29 public: 30 CReductionAlgorithm() { }30 CReductionAlgorithm() { } 31 31 32 32 /*! -
XIOS/dev/branch_yushan_merged/src/transformation/axis_algorithm_extract_domain.cpp
r1134 r1155 13 13 #include "grid.hpp" 14 14 #include "grid_transformation_factory_impl.hpp" 15 #include "reduction.hpp"16 15 17 16 namespace xios { … … 62 61 63 62 pos_ = algo->position; 63 64 if(CReductionAlgorithm::ReductionOperations_ptr == 0) 65 CReductionAlgorithm::initReductionOperation(); 66 64 67 reduction_ = CReductionAlgorithm::createOperation((*CReductionAlgorithm::ReductionOperations_ptr)[op]); 65 68 } -
XIOS/dev/branch_yushan_merged/src/transformation/axis_algorithm_extract_domain.hpp
r1076 r1155 12 12 #include "axis_algorithm_transformation.hpp" 13 13 #include "transformation.hpp" 14 #include "reduction.hpp" 14 15 15 16 namespace xios { … … 25 26 Extract a domain to an axis 26 27 */ 27 class CAxisAlgorithmExtractDomain : public CAxisAlgorithmTransformation 28 class CAxisAlgorithmExtractDomain : public CAxisAlgorithmTransformation, public CReductionAlgorithm 28 29 { 29 30 public: -
XIOS/dev/branch_yushan_merged/src/transformation/axis_algorithm_reduce_domain.cpp
r1134 r1155 13 13 #include "grid.hpp" 14 14 #include "grid_transformation_factory_impl.hpp" 15 #include "reduction.hpp"16 15 17 16 namespace xios { … … 70 69 71 70 dir_ = (CReduceDomainToAxis::direction_attr::iDir == algo->direction) ? iDir : jDir; 71 72 if(CReductionAlgorithm::ReductionOperations_ptr == 0) 73 CReductionAlgorithm::initReductionOperation(); 74 72 75 reduction_ = CReductionAlgorithm::createOperation((*CReductionAlgorithm::ReductionOperations_ptr)[op]); 73 76 } -
XIOS/dev/branch_yushan_merged/src/transformation/axis_algorithm_reduce_domain.hpp
r1076 r1155 12 12 #include "axis_algorithm_transformation.hpp" 13 13 #include "transformation.hpp" 14 #include "reduction.hpp" 14 15 15 16 namespace xios { … … 24 25 Reduce a domain to an axis 25 26 */ 26 class CAxisAlgorithmReduceDomain : public CAxisAlgorithmTransformation 27 class CAxisAlgorithmReduceDomain : public CAxisAlgorithmTransformation, public CReductionAlgorithm 27 28 { 28 29 public: -
XIOS/dev/branch_yushan_merged/src/transformation/domain_algorithm_interpolate.cpp
r1149 r1155 111 111 const int constNVertex = 4; // Value by default number of vertex for rectangular domain 112 112 int nVertexSrc, nVertexDest; 113 nVertexSrc = nVertexDest = constNVertex; 113 nVertexSrc = constNVertex; 114 nVertexDest = constNVertex; 114 115 115 116 // First of all, try to retrieve the boundary values of domain source and domain destination -
XIOS/dev/branch_yushan_merged/src/transformation/scalar_algorithm_extract_axis.cpp
r1134 r1155 14 14 #include "grid_transformation_factory_impl.hpp" 15 15 16 #include "reduction.hpp" 16 17 17 18 18 namespace xios { … … 49 49 StdString op = "extract"; 50 50 pos_ = algo->position; 51 52 if(CReductionAlgorithm::ReductionOperations_ptr == 0) 53 CReductionAlgorithm::initReductionOperation(); 54 51 55 reduction_ = CReductionAlgorithm::createOperation((*CReductionAlgorithm::ReductionOperations_ptr)[op]); 52 56 } -
XIOS/dev/branch_yushan_merged/src/transformation/scalar_algorithm_extract_axis.hpp
r1076 r1155 12 12 #include "scalar_algorithm_transformation.hpp" 13 13 #include "transformation.hpp" 14 #include "reduction.hpp" 14 15 15 16 namespace xios { … … 24 25 Extract a scalar from an axis 25 26 */ 26 class CScalarAlgorithmExtractAxis : public CScalarAlgorithmTransformation 27 class CScalarAlgorithmExtractAxis : public CScalarAlgorithmTransformation, public CReductionAlgorithm 27 28 { 28 29 public: -
XIOS/dev/branch_yushan_merged/src/transformation/scalar_algorithm_reduce_axis.cpp
r1153 r1155 13 13 #include "grid.hpp" 14 14 #include "grid_transformation_factory_impl.hpp" 15 #include "reduction.hpp"16 17 #include "reduction.hpp"18 15 19 16 namespace xios { 17 18 //extern std::map<StdString,EReductionType> *CReductionAlgorithm::ReductionOperations_ptr; 19 //#pragma omp threadprivate(CReductionAlgorithm::ReductionOperations_ptr) 20 20 21 CGenericAlgorithmTransformation* CScalarAlgorithmReduceAxis::create(CGrid* gridDst, CGrid* gridSrc, 21 22 CTransformation<CScalar>* transformation, … … 75 76 } 76 77 77 //if ((*CReductionAlgorithm::ReductionOperations_ptr).end() == (*CReductionAlgorithm::ReductionOperations_ptr).find(op)) 78 // if ((CReductionAlgorithm::ReductionOperations_ptr)->end() == (CReductionAlgorithm::ReductionOperations_ptr)->find(op)) 79 // ERROR("CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToScalar* algo)", 80 // << "Operation '" << op << "' not found. Please make sure to use a supported one" 81 // << "Axis source " <<axisSource->getId() << std::endl 82 // << "Scalar destination " << scalarDestination->getId()); 78 if(CReductionAlgorithm::ReductionOperations_ptr == 0) 79 CReductionAlgorithm::initReductionOperation(); 80 81 if ((*CReductionAlgorithm::ReductionOperations_ptr).end() == (*CReductionAlgorithm::ReductionOperations_ptr).find(op)) 82 ERROR("CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToScalar* algo)", 83 << "Operation '" << op << "' not found. Please make sure to use a supported one" 84 << "Axis source " <<axisSource->getId() << std::endl 85 << "Scalar destination " << scalarDestination->getId()); 83 86 84 87 reduction_ = CReductionAlgorithm::createOperation((*CReductionAlgorithm::ReductionOperations_ptr)[op]); -
XIOS/dev/branch_yushan_merged/src/transformation/scalar_algorithm_reduce_axis.hpp
r1082 r1155 12 12 #include "scalar_algorithm_transformation.hpp" 13 13 #include "transformation.hpp" 14 #include "reduction.hpp" 14 15 15 16 namespace xios { … … 24 25 Reducing an axis to a scalar 25 26 */ 26 class CScalarAlgorithmReduceAxis : public CScalarAlgorithmTransformation 27 class CScalarAlgorithmReduceAxis : public CScalarAlgorithmTransformation, public CReductionAlgorithm 27 28 { 28 29 public: -
XIOS/dev/branch_yushan_merged/src/transformation/scalar_algorithm_reduce_domain.cpp
r1134 r1155 14 14 #include "grid_transformation_factory_impl.hpp" 15 15 16 #include "reduction.hpp" 16 17 17 18 18 namespace xios { … … 68 68 69 69 } 70 70 71 if(CReductionAlgorithm::ReductionOperations_ptr == 0) 72 CReductionAlgorithm::initReductionOperation(); 73 71 74 if ((*CReductionAlgorithm::ReductionOperations_ptr).end() == (*CReductionAlgorithm::ReductionOperations_ptr).find(op)) 72 75 ERROR("CScalarAlgorithmReduceDomain::CScalarAlgorithmReduceDomain(CDomain* domainDestination, CDomain* domainSource, CReduceDomainToScalar* algo)", -
XIOS/dev/branch_yushan_merged/src/transformation/scalar_algorithm_reduce_domain.hpp
r1076 r1155 12 12 #include "scalar_algorithm_transformation.hpp" 13 13 #include "transformation.hpp" 14 #include "reduction.hpp" 14 15 15 16 namespace xios { … … 24 25 Reducing an DOMAIN to a scalar 25 26 */ 26 class CScalarAlgorithmReduceDomain : public CScalarAlgorithmTransformation 27 class CScalarAlgorithmReduceDomain : public CScalarAlgorithmTransformation, public CReductionAlgorithm 27 28 { 28 29 public:
Note: See TracChangeset
for help on using the changeset viewer.