Index: XIOS/dev/branch_yushan/src/transformation/Functions/reduction.cpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/reduction.cpp	(revision 1079)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/reduction.cpp	(revision 1103)
@@ -9,29 +9,55 @@
 
 CReductionAlgorithm::CallBackMap* CReductionAlgorithm::reductionCreationCallBacks_ = 0;
-std::map<StdString,EReductionType> CReductionAlgorithm::ReductionOperations = std::map<StdString,EReductionType>();
-bool CReductionAlgorithm::initReductionOperation(std::map<StdString,EReductionType>& m)
+//std::map<StdString,EReductionType> CReductionAlgorithm::ReductionOperations = std::map<StdString,EReductionType>();
+std::map<StdString,EReductionType> *CReductionAlgorithm::ReductionOperations_ptr = 0; 
+
+// bool CReductionAlgorithm::initReductionOperation(std::map<StdString,EReductionType>& m)
+// {
+//   // So so stupid way to intialize operation but it works ...
+//   m["sum"] = TRANS_REDUCE_SUM;
+//   CSumReductionAlgorithm::registerTrans();
+
+//   m["min"] = TRANS_REDUCE_MIN;
+//   CMinReductionAlgorithm::registerTrans();
+
+//   m["max"] = TRANS_REDUCE_MAX;
+//   CMaxReductionAlgorithm::registerTrans();
+
+//   m["extract"] = TRANS_REDUCE_EXTRACT;
+//   CExtractReductionAlgorithm::registerTrans();
+
+//   m["average"] = TRANS_REDUCE_AVERAGE;
+//   CAverageReductionAlgorithm::registerTrans();
+// }
+
+bool CReductionAlgorithm::initReductionOperation(std::map<StdString,EReductionType>* m)
 {
+  if(m==NULL) m=new std::map<StdString,EReductionType>();
   // So so stupid way to intialize operation but it works ...
-  m["sum"] = TRANS_REDUCE_SUM;
+  (*m)["sum"] = TRANS_REDUCE_SUM;
   CSumReductionAlgorithm::registerTrans();
 
-  m["min"] = TRANS_REDUCE_MIN;
+  (*m)["min"] = TRANS_REDUCE_MIN;
   CMinReductionAlgorithm::registerTrans();
 
-  m["max"] = TRANS_REDUCE_MAX;
+  (*m)["max"] = TRANS_REDUCE_MAX;
   CMaxReductionAlgorithm::registerTrans();
 
-  m["extract"] = TRANS_REDUCE_EXTRACT;
+  (*m)["extract"] = TRANS_REDUCE_EXTRACT;
   CExtractReductionAlgorithm::registerTrans();
 
-  m["average"] = TRANS_REDUCE_AVERAGE;
+  (*m)["average"] = TRANS_REDUCE_AVERAGE;
   CAverageReductionAlgorithm::registerTrans();
 }
 
-bool CReductionAlgorithm::_dummyInit = CReductionAlgorithm::initReductionOperation(CReductionAlgorithm::ReductionOperations);
+//bool CReductionAlgorithm::_dummyInit = CReductionAlgorithm::initReductionOperation(CReductionAlgorithm::ReductionOperations);
+bool CReductionAlgorithm::_dummyInit = CReductionAlgorithm::initReductionOperation(CReductionAlgorithm::ReductionOperations_ptr);
 
 CReductionAlgorithm* CReductionAlgorithm::createOperation(EReductionType reduceType)
 {
   int reduceTypeInt = reduceType;
+  if (0 == reductionCreationCallBacks_)
+    reductionCreationCallBacks_ = new CallBackMap();
+
   CallBackMap::const_iterator it = (*reductionCreationCallBacks_).find(reduceType);
   if ((*reductionCreationCallBacks_).end() == it)
Index: XIOS/dev/branch_yushan/src/transformation/Functions/reduction.hpp
===================================================================
--- XIOS/dev/branch_yushan/src/transformation/Functions/reduction.hpp	(revision 1079)
+++ XIOS/dev/branch_yushan/src/transformation/Functions/reduction.hpp	(revision 1103)
@@ -23,5 +23,7 @@
 {
 public:
-  static std::map<StdString,EReductionType> ReductionOperations;
+  //static std::map<StdString,EReductionType> ReductionOperations;
+  static std::map<StdString,EReductionType> *ReductionOperations_ptr;
+  #pragma omp threadprivate(ReductionOperations_ptr)
 
 public:
@@ -59,5 +61,5 @@
   typedef std::map<EReductionType, CreateOperationCallBack> CallBackMap;
   static CallBackMap* reductionCreationCallBacks_;
-  //#pragma omp threadprivate(reductionCreationCallBacks_)
+  #pragma omp threadprivate(reductionCreationCallBacks_)
 
   static bool registerOperation(EReductionType reduceType, CreateOperationCallBack createFn);
@@ -65,7 +67,8 @@
 
 protected:
-  static bool initReductionOperation(std::map<StdString,EReductionType>& m);
+  //static bool initReductionOperation(std::map<StdString,EReductionType>& m);
+  static bool initReductionOperation(std::map<StdString,EReductionType>* m);
   static bool _dummyInit;
-  //#pragma omp threadprivate(_dummyInit)
+  #pragma omp threadprivate(_dummyInit)
 };
 
