Index: XIOS/dev/branch_yushan_merged/src/transformation/domain_algorithm_interpolate.cpp
===================================================================
--- XIOS/dev/branch_yushan_merged/src/transformation/domain_algorithm_interpolate.cpp	(revision 1134)
+++ XIOS/dev/branch_yushan_merged/src/transformation/domain_algorithm_interpolate.cpp	(revision 1149)
@@ -404,7 +404,9 @@
   CContext* context = CContext::getCurrent();
   CContextClient* client=context->client;
+  int split_key;
+  ep_lib::MPI_Comm_rank(client->intraComm, &split_key);
 
   ep_lib::MPI_Comm poleComme(MPI_COMM_NULL);
-  ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? MPI_UNDEFINED : 1, 0, &poleComme);
+  ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? 9 : 1, split_key, &poleComme);
   if (MPI_COMM_NULL != poleComme)
   {
@@ -421,9 +423,10 @@
     std::vector<int> recvCount(nbClientPole,0);
     std::vector<int> displ(nbClientPole,0);
-    MPI_Allgather(&nbWeight,1,MPI_INT,&recvCount[0],1,MPI_INT,poleComme) ;
+    ep_lib::MPI_Allgather(&nbWeight,1,MPI_INT,&recvCount[0],1,MPI_INT,poleComme) ;
 
     displ[0]=0;
     for(int n=1;n<nbClientPole;++n) displ[n]=displ[n-1]+recvCount[n-1] ;
     int recvSize=displ[nbClientPole-1]+recvCount[nbClientPole-1] ;
+    
 
     std::vector<int> sendSourceIndexBuff(nbWeight);
@@ -444,6 +447,6 @@
 
     // Gather all index and weight for pole
-    MPI_Allgatherv(&sendSourceIndexBuff[0],nbWeight,MPI_INT,&recvSourceIndexBuff[0],&recvCount[0],&displ[0],MPI_INT,poleComme);
-    MPI_Allgatherv(&sendSourceWeightBuff[0],nbWeight,MPI_DOUBLE,&recvSourceWeightBuff[0],&recvCount[0],&displ[0],MPI_DOUBLE,poleComme);
+    ep_lib::MPI_Allgatherv(&sendSourceIndexBuff[0],nbWeight,MPI_INT,&recvSourceIndexBuff[0],&recvCount[0],&displ[0],MPI_INT,poleComme);
+    ep_lib::MPI_Allgatherv(&sendSourceWeightBuff[0],nbWeight,MPI_DOUBLE,&recvSourceWeightBuff[0],&recvCount[0],&displ[0],MPI_DOUBLE,poleComme);
 
     std::map<int,double> recvTemp;
@@ -567,5 +570,5 @@
 
 
-  MPI_Allreduce(sendBuff, recvBuff, nbClient, MPI_INT, MPI_SUM, client->intraComm);
+  ep_lib::MPI_Allreduce(sendBuff, recvBuff, nbClient, MPI_INT, MPI_SUM, client->intraComm);
 
   int* sendIndexDestBuff = new int [sendBuffSize];
@@ -595,5 +598,5 @@
 
     sendRequest.push_back(ep_lib::MPI_Request());
-    MPI_Isend(sendIndexDestBuff + sendOffSet,
+    ep_lib::MPI_Isend(sendIndexDestBuff + sendOffSet,
              k,
              MPI_INT,
@@ -603,5 +606,5 @@
              &sendRequest.back());
     sendRequest.push_back(ep_lib::MPI_Request());
-    MPI_Isend(sendIndexSrcBuff + sendOffSet,
+    ep_lib::MPI_Isend(sendIndexSrcBuff + sendOffSet,
              k,
              MPI_INT,
@@ -611,5 +614,5 @@
              &sendRequest.back());
     sendRequest.push_back(ep_lib::MPI_Request());
-    MPI_Isend(sendWeightBuff + sendOffSet,
+    ep_lib::MPI_Isend(sendWeightBuff + sendOffSet,
              k,
              MPI_DOUBLE,
@@ -630,5 +633,5 @@
   {
     ep_lib::MPI_Status recvStatus;
-    MPI_Recv((recvIndexDestBuff + receivedSize),
+    ep_lib::MPI_Recv((recvIndexDestBuff + receivedSize),
              recvBuffSize,
              MPI_INT,
@@ -639,5 +642,5 @@
 
     int countBuff = 0;
-    MPI_Get_count(&recvStatus, MPI_INT, &countBuff);
+    ep_lib::MPI_Get_count(&recvStatus, MPI_INT, &countBuff);
     #ifdef _usingMPI
     clientSrcRank = recvStatus.MPI_SOURCE;
@@ -645,5 +648,5 @@
     clientSrcRank = recvStatus.ep_src;
     #endif
-    MPI_Recv((recvIndexSrcBuff + receivedSize),
+    ep_lib::MPI_Recv((recvIndexSrcBuff + receivedSize),
              recvBuffSize,
              MPI_INT,
@@ -653,5 +656,5 @@
              &recvStatus);
 
-    MPI_Recv((recvWeightBuff + receivedSize),
+    ep_lib::MPI_Recv((recvWeightBuff + receivedSize),
              recvBuffSize,
              MPI_DOUBLE,
@@ -671,5 +674,5 @@
   std::vector<ep_lib::MPI_Status> requestStatus(sendRequest.size());
   ep_lib::MPI_Status stat_ignore;
-  MPI_Waitall(sendRequest.size(), &sendRequest[0], &stat_ignore);
+  ep_lib::MPI_Waitall(sendRequest.size(), &sendRequest[0], &stat_ignore);
 
   delete [] sendIndexDestBuff;
@@ -761,5 +764,5 @@
   }
 
-  MPI_Allreduce(&localNbWeight, &globalNbWeight, 1, MPI_LONG, MPI_SUM, client->intraComm);
+  ep_lib::MPI_Allreduce(&localNbWeight, &globalNbWeight, 1, MPI_LONG, MPI_SUM, client->intraComm);
   ep_lib::MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, client->intraComm);
   
