Index: XIOS/dev/branch_yushan_merged/extern/remap/src/intersect.cpp
===================================================================
--- XIOS/dev/branch_yushan_merged/extern/remap/src/intersect.cpp	(revision 1151)
+++ XIOS/dev/branch_yushan_merged/extern/remap/src/intersect.cpp	(revision 1153)
@@ -57,19 +57,20 @@
     {
       // share a full edge ? be carefull at the orientation
-      /*
-      if(squaredist(a.vertex[i], b.vertex[j]) > 1e-10*1e-10 ||
-         squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10 )
-      {      
-        printf("A : squaredist(a.vertex[%d], b.vertex[%d]) = %.10e  %d\n", 
-                i, j, squaredist(a.vertex[i], b.vertex[j]), 
-                squaredist(a.vertex[i], b.vertex[j]) > 1e-10*1e-10 ? true : false);
-        printf("B : squaredist(a.vertex[%d], b.vertex[%d]) = %.10e  %d\n", 
-                (i+1)%a.n, (j+1)%b.n, squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]),
-                squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10 ? true : false);
+      
+      //if(squaredist(a.vertex[i], b.vertex[j]) > 1e-10*1e-10 ||
+      //   squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10 )
+      //{      
+        //printf("A : squaredist(a.vertex[%d], b.vertex[%d]) = %.10e  %d\n", 
+        //        i, j, squaredist(a.vertex[i], b.vertex[j]), 
+        //        squaredist(a.vertex[i], b.vertex[j]) > 1e-10*1e-10 ? true : false);
+        //printf("B : squaredist(a.vertex[%d], b.vertex[%d]) = %.10e  %d\n", 
+        //        (i+1)%a.n, (j+1)%b.n, squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]),
+        //        squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10 ? true : false);
 
         assert(squaredist(a.vertex[ i       ], b.vertex[ j       ]) > 1e-10*1e-10 ||
                squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+1)%b.n]) > 1e-10*1e-10);
-        exit(0);
-      }*/
+        
+      //}
+
       if (   squaredist(a.vertex[ i       ], b.vertex[ j           ]) < 1e-10*1e-10 &&
              squaredist(a.vertex[(i+1)%a.n], b.vertex[(j+b.n-1)%b.n]) < 1e-10*1e-10)
Index: XIOS/dev/branch_yushan_merged/extern/remap/src/mapper.cpp
===================================================================
--- XIOS/dev/branch_yushan_merged/extern/remap/src/mapper.cpp	(revision 1151)
+++ XIOS/dev/branch_yushan_merged/extern/remap/src/mapper.cpp	(revision 1153)
@@ -303,12 +303,12 @@
             MPI_Issend(sendValue[rank], nbRecvElement[rank], MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]);
             nbSendRequest++;
-            MPI_Issend(sendArea[rank], nbRecvElement[rank], MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]);
+            MPI_Issend(sendArea[rank], nbRecvElement[rank], MPI_DOUBLE, rank, 1, communicator, &sendRequest[nbSendRequest]);
             nbSendRequest++;
             if (order == 2)
             {
                 MPI_Issend(sendGrad[rank], 3*nbRecvElement[rank]*(NMAX+1),
-                        MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]);
+                        MPI_DOUBLE, rank, 2, communicator, &sendRequest[nbSendRequest]);
                 nbSendRequest++;
-                MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank]*(NMAX+1), MPI_INT, rank, 0, communicator, &sendRequest[nbSendRequest]);
+                MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank]*(NMAX+1), MPI_INT, rank, 3, communicator, &sendRequest[nbSendRequest]);
                 //ym  --> attention taille GloId
                 nbSendRequest++;
@@ -316,5 +316,5 @@
             else
             {
-                MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank], MPI_INT, rank, 0, communicator, &sendRequest[nbSendRequest]);
+                MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank], MPI_INT, rank, 4, communicator, &sendRequest[nbSendRequest]);
                 //ym  --> attention taille GloId
                 nbSendRequest++;                
@@ -325,12 +325,12 @@
             MPI_Irecv(recvValue[rank],  nbSendElement[rank], MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]);
             nbRecvRequest++;
-            MPI_Irecv(recvArea[rank],  nbSendElement[rank], MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]);
+            MPI_Irecv(recvArea[rank],  nbSendElement[rank], MPI_DOUBLE, rank, 1, communicator, &recvRequest[nbRecvRequest]);
             nbRecvRequest++;
             if (order == 2)
             {
                 MPI_Irecv(recvGrad[rank], 3*nbSendElement[rank]*(NMAX+1),
-                        MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]);
+                        MPI_DOUBLE, rank, 2, communicator, &recvRequest[nbRecvRequest]);
                 nbRecvRequest++;
-                MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank]*(NMAX+1), MPI_INT, rank, 0, communicator, &recvRequest[nbRecvRequest]);
+                MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank]*(NMAX+1), MPI_INT, rank, 3, communicator, &recvRequest[nbRecvRequest]);
                 //ym  --> attention taille GloId
                 nbRecvRequest++;
@@ -338,5 +338,5 @@
             else
             {
-                MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank], MPI_INT, rank, 0, communicator, &recvRequest[nbRecvRequest]);
+                MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank], MPI_INT, rank, 4, communicator, &recvRequest[nbRecvRequest]);
                 //ym  --> attention taille GloId
                 nbRecvRequest++;
Index: XIOS/dev/branch_yushan_merged/extern/remap/src/node.hpp
===================================================================
--- XIOS/dev/branch_yushan_merged/extern/remap/src/node.hpp	(revision 1151)
+++ XIOS/dev/branch_yushan_merged/extern/remap/src/node.hpp	(revision 1153)
@@ -15,6 +15,6 @@
 struct Circle
 {
-	Coord centre;
-	double radius;
+  Coord centre;
+  double radius;
 };
 
@@ -116,21 +116,21 @@
 struct Node
 {
-	int level; /* FIXME leafs are 0 and root is max level? */
-	int leafCount; /* number of leafs that are descendants of this node (the elements in it's cycle) */
-	Coord centre;
-	double radius;
-	NodePtr parent, ref;
-	std::vector<NodePtr> child;
-	std::list<NodePtr> intersectors;
-	bool reinserted;
-	int updateCount;  // double var;
-	CBasicTree* tree;
-	void *data;
-	int route;
+  int level; /* FIXME leafs are 0 and root is max level? */
+  int leafCount; /* number of leafs that are descendants of this node (the elements in it's cycle) */
+  Coord centre;
+  double radius;
+  NodePtr parent, ref;
+  std::vector<NodePtr> child;
+  std::list<NodePtr> intersectors;
+  bool reinserted;
+  int updateCount;  // double var;
+  CBasicTree* tree;
+  void *data;
+  int route;
   bool toDelete ;
 
-	Node() : level(0), leafCount(1), centre(ORIGIN), radius(0), reinserted(false), updateCount(0), toDelete(false) {}
-	Node(const Coord& centre, double radius, void *data)
-		: level(0), leafCount(1), centre(centre), radius(radius), reinserted(false), updateCount(0), data(data), toDelete(false) {}
+  Node() : level(0), leafCount(1), centre(ORIGIN), radius(0), reinserted(false), updateCount(0), toDelete(false) {}
+  Node(const Coord& centre, double radius, void *data)
+    : level(0), leafCount(1), centre(centre), radius(radius), reinserted(false), updateCount(0), data(data), toDelete(false) {}
 
 //#ifdef DEBUG
@@ -178,26 +178,26 @@
 //#endif
 
-	void move(const NodePtr node);
-	void remove(const NodePtr node);
-	void inflate(const NodePtr node);
-	void update();
+  void move(const NodePtr node);
+  void remove(const NodePtr node);
+  void inflate(const NodePtr node);
+  void update();
   void output(std::ostream& flux, int level, int color) ;
-	NodePtr closest(std::vector<NodePtr>& list, int n = CLOSEST);
-	NodePtr farthest(std::vector<NodePtr>& list);
-	void findClosest(int level, NodePtr src, double& minDist, NodePtr &closest);
-
-	void search(NodePtr node);
-	bool centreInside(Node &node);
-	bool intersects(NodePtr node);
-	bool isInside(Node &node);
-	int incluCheck();
+  NodePtr closest(std::vector<NodePtr>& list, int n = CLOSEST);
+  NodePtr farthest(std::vector<NodePtr>& list);
+  void findClosest(int level, NodePtr src, double& minDist, NodePtr &closest);
+
+  void search(NodePtr node);
+  bool centreInside(Node &node);
+  bool intersects(NodePtr node);
+  bool isInside(Node &node);
+  int incluCheck();
   void checkParent(void) ;
-	void printChildren();
-	void assignRoute(std::vector<int>::iterator& rank, int level);
-	void assignCircleAndPropagateUp(Coord *centres, double *radia, int level);
-	void printLevel(int level);
-	void routeNode(NodePtr node, int level);
-	void routingIntersecting(std::vector<Node>* routingList, NodePtr node);
-	void routeIntersection(std::vector<int>& routes, NodePtr node);
+  void printChildren();
+  void assignRoute(std::vector<int>::iterator& rank, int level);
+  void assignCircleAndPropagateUp(Coord *centres, double *radia, int level);
+  void printLevel(int level);
+  void routeNode(NodePtr node, int level);
+  void routingIntersecting(std::vector<Node>* routingList, NodePtr node);
+  void routeIntersection(std::vector<int>& routes, NodePtr node);
   void getNodeLevel(int level,std::list<NodePtr>& NodeList) ;
   bool removeDeletedNodes(int assignLevel) ;
Index: XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_wait.cpp
===================================================================
--- XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_wait.cpp	(revision 1151)
+++ XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_wait.cpp	(revision 1153)
@@ -58,7 +58,18 @@
     if(request->type == 3)
     {
-      ::MPI_Request mpi_request = static_cast< ::MPI_Request >(request->mpi_request);
+      ::MPI_Request *mpi_request = static_cast< ::MPI_Request* >(&(request->mpi_request));
       ::MPI_Status mpi_status;
-      ::MPI_Wait(&mpi_request, &mpi_status);
+      ::MPI_Errhandler_set(MPI_COMM_WORLD_STD, MPI_ERRORS_RETURN);
+      int error_code = ::MPI_Wait(mpi_request, &mpi_status);
+      if (error_code != MPI_SUCCESS) {
+      
+         char error_string[BUFSIZ];
+         int length_of_error_string, error_class;
+      
+         ::MPI_Error_class(error_code, &error_class);
+         ::MPI_Error_string(error_class, error_string, &length_of_error_string);
+         printf("%s\n", error_string);
+      }
+      
 
       status->mpi_status = new ::MPI_Status(mpi_status);
@@ -81,6 +92,7 @@
   int MPI_Waitall(int count, MPI_Request *array_of_requests, MPI_Status *array_of_statuses)
   {
-    int dest_rank;
-    MPI_Comm_rank(MPI_COMM_WORLD, &dest_rank);
+    //int dest_rank;
+    //MPI_Comm_rank(MPI_COMM_WORLD, &dest_rank);
+    //printf("proc %d enters waitall\n", dest_rank);
 
     int finished = 0;
@@ -100,7 +112,7 @@
           if(array_of_requests[i].type != 2) // isend or imrecv
           {      
-            //MPI_Wait(&array_of_requests[i], &array_of_statuses[i]);
-            int tested=false;
-            while(!tested) MPI_Test(&array_of_requests[i], &tested, &array_of_statuses[i]);
+            MPI_Wait(&array_of_requests[i], &array_of_statuses[i]);
+            //int tested=false;
+            //while(!tested) MPI_Test(&array_of_requests[i], &tested, &array_of_statuses[i]);
             finished++;
             finished_index[i] = true;
@@ -127,4 +139,5 @@
       }    
     }
+    //printf("proc %d exits waitall\n", dest_rank);
     return MPI_SUCCESS;
   }  /* end of mpi_waitall*/
