Index: /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_barrier.cpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_barrier.cpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_barrier.cpp	(revision 1185)
@@ -60,5 +60,5 @@
   int MPI_Barrier_local(MPI_Comm comm)
   {
-    Message_Check(comm);
+    //Message_Check(comm);
     comm.ep_barrier->wait();
   }
Index: /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_intercomm_kernel.cpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_intercomm_kernel.cpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_intercomm_kernel.cpp	(revision 1185)
@@ -96,5 +96,5 @@
         ::MPI_Comm_rank(static_cast< ::MPI_Comm>(peer_comm.mpi_comm), &rank_in_peer_mpi[0]);
 
-        MPI_Status status;
+        
 
         send_buf[0] = size_info[0];
@@ -102,7 +102,14 @@
         send_buf[2] = rank_in_peer_mpi[0];
 
-        MPI_Send(send_buf.data(), 3, MPI_INT_STD, remote_leader, tag, peer_comm);
-        MPI_Recv(recv_buf.data(), 3, MPI_INT_STD, remote_leader, tag, peer_comm, &status);
-
+        MPI_Request req_send, req_recv;
+        MPI_Status sta_send, sta_recv;
+        
+        MPI_Isend(send_buf.data(), 3, MPI_INT_STD, remote_leader, tag, peer_comm, &req_send);
+        MPI_Irecv(recv_buf.data(), 3, MPI_INT_STD, remote_leader, tag, peer_comm, &req_recv);
+
+
+        MPI_Wait(&req_send, &sta_send);
+        MPI_Wait(&req_recv, &sta_recv);
+        
         size_info[1] = recv_buf[0];
         remote_ep_size = recv_buf[1];
@@ -142,6 +149,6 @@
         std::copy ( ep_info[0].data(),   ep_info[0].data()   + size_info[0], send_buf.begin() + 2*size_info[0] );
 
-        MPI_Send(send_buf.data(), 3*size_info[0], MPI_INT_STD, remote_leader, tag, peer_comm);
-        MPI_Recv(recv_buf.data(), 3*size_info[1], MPI_INT_STD, remote_leader, tag, peer_comm, &status);
+        MPI_Send(send_buf.data(), 3*size_info[0], MPI_INT_STD, remote_leader, tag+1, peer_comm);
+        MPI_Recv(recv_buf.data(), 3*size_info[1], MPI_INT_STD, remote_leader, tag+1, peer_comm, &status);
       }
 
@@ -263,6 +270,6 @@
         size_info[2] = new_ep_info[0].size();
         MPI_Status status;
-        MPI_Send(&size_info[2], 1, MPI_INT_STD, remote_leader, tag, peer_comm);
-        MPI_Recv(&size_info[3], 1, MPI_INT_STD, remote_leader, tag, peer_comm, &status);
+        MPI_Send(&size_info[2], 1, MPI_INT_STD, remote_leader, tag+2, peer_comm);
+        MPI_Recv(&size_info[3], 1, MPI_INT_STD, remote_leader, tag+2, peer_comm, &status);
       }
 
@@ -284,6 +291,6 @@
         std::copy ( new_ep_info[0].data(),   new_ep_info[0].data()   + size_info[0], send_buf.begin() + 2*size_info[2] );
 
-        MPI_Send(send_buf.data(), 3*size_info[2], MPI_INT_STD, remote_leader, tag, peer_comm);
-        MPI_Recv(recv_buf.data(), 3*size_info[3], MPI_INT_STD, remote_leader, tag, peer_comm, &status);
+        MPI_Send(send_buf.data(), 3*size_info[2], MPI_INT_STD, remote_leader, tag+3, peer_comm);
+        MPI_Recv(recv_buf.data(), 3*size_info[3], MPI_INT_STD, remote_leader, tag+3, peer_comm, &status);
       }
 
@@ -482,9 +489,9 @@
     {
       MPI_Status status;
-      MPI_Send((*newintercomm).ep_comm_ptr->intercomm->local_rank_map->data(), 2*local_ep_size, MPI_INT_STD, remote_leader, tag, peer_comm);
-      MPI_Recv((*newintercomm).ep_comm_ptr->intercomm->remote_rank_map->data(), 2*remote_ep_size, MPI_INT_STD, remote_leader, tag, peer_comm, &status);
-
-      MPI_Send(&local_intercomm_size, 1, MPI_INT_STD, remote_leader, tag, peer_comm);
-      MPI_Recv(&remote_intercomm_size, 1, MPI_INT_STD, remote_leader, tag, peer_comm, &status);
+      MPI_Send((*newintercomm).ep_comm_ptr->intercomm->local_rank_map->data(), 2*local_ep_size, MPI_INT_STD, remote_leader, tag+4, peer_comm);
+      MPI_Recv((*newintercomm).ep_comm_ptr->intercomm->remote_rank_map->data(), 2*remote_ep_size, MPI_INT_STD, remote_leader, tag+4, peer_comm, &status);
+
+      MPI_Send(&local_intercomm_size, 1, MPI_INT_STD, remote_leader, tag+5, peer_comm);
+      MPI_Recv(&remote_intercomm_size, 1, MPI_INT_STD, remote_leader, tag+5, peer_comm, &status);
 
       new_bcast_root_0 = intercomm_ep_rank;
@@ -507,6 +514,6 @@
     {
       MPI_Status status;
-      MPI_Send((*newintercomm).rank_map->data(), 2*local_intercomm_size, MPI_INT_STD, remote_leader, tag, peer_comm);
-      MPI_Recv((*newintercomm).ep_comm_ptr->intercomm->intercomm_rank_map->data(), 2*remote_intercomm_size, MPI_INT_STD, remote_leader, tag, peer_comm, &status);
+      MPI_Send((*newintercomm).rank_map->data(), 2*local_intercomm_size, MPI_INT_STD, remote_leader, tag+6, peer_comm);
+      MPI_Recv((*newintercomm).ep_comm_ptr->intercomm->intercomm_rank_map->data(), 2*remote_intercomm_size, MPI_INT_STD, remote_leader, tag+6, peer_comm, &status);
     }
 
@@ -538,4 +545,6 @@
 //    MPI_Comm_rank(*test_comm, &test_rank);
 //    printf("=================test_rank = %d\n", test_rank);
+    
+    
 
     return MPI_SUCCESS;
Index: /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_lib_intercomm.hpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_lib_intercomm.hpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_lib_intercomm.hpp	(revision 1185)
@@ -50,4 +50,7 @@
 
   int MPI_Comm_test_inter(MPI_Comm comm, int *flag);
+
+  int test_sendrecv(MPI_Comm comm);
+
 }
 
Index: /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_message.cpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_message.cpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_message.cpp	(revision 1185)
@@ -77,6 +77,7 @@
              
         msg_block->ep_src  = get_ep_rank(comm, src_loc,  src_mpi);        //printf("myRank = %d, msg_block->ep_src = %d\n",  myRank, msg_block->ep_src);
-
-        //printf("myRank = %d, probed one message, ep_src = %d, ep_dest = %d, tag = %d, message = %d\n", myRank, msg_block->ep_src, msg_block->ep_dest, msg_block->ep_tag, msg_block->mpi_message);
+        int dest_mpi = comm.ep_comm_ptr->size_rank_info[2].first;
+        int ep_dest = get_ep_rank(comm, dest_loc, dest_mpi);
+        printf("myRank = %d, probed one message, ep_src = %d, ep_dest = %d, tag = %d, message = %d\n", myRank, msg_block->ep_src, ep_dest, msg_block->ep_tag, msg_block->mpi_message);
         msg_block->mpi_status = new ::MPI_Status(status);
 
@@ -89,8 +90,8 @@
           #pragma omp flush
           ptr_comm_target->ep_comm_ptr->message_queue->push_back(*msg_block);  
-          // printf("myRank = %d, push_back OK, ep_src = %d, ep_tag = %d, mpi_status = %p (%p)\n", myRank, 
-          //                                                                                   ptr_comm_target->ep_comm_ptr->message_queue->back().ep_src,
-          //                                                                                   ptr_comm_target->ep_comm_ptr->message_queue->back().ep_tag,
-          //                                                                                   msg_block->mpi_status, &status);
+          printf("myRank = %d, push_back OK, ep_src = %d, ep_tag = %d, dest = %d(%d)\n", myRank, 
+                                                                                             ptr_comm_target->ep_comm_ptr->message_queue->back().ep_src,
+                                                                                             ptr_comm_target->ep_comm_ptr->message_queue->back().ep_tag,
+                                                                                             ep_dest, dest_loc);
     
           #pragma omp flush
Index: /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_probe.cpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_probe.cpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_probe.cpp	(revision 1185)
@@ -102,5 +102,5 @@
 
     
-    Message_Check(comm);
+    //Message_Check(comm);
 
     #pragma omp flush
Index: /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_recv.cpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_recv.cpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_recv.cpp	(revision 1185)
@@ -16,4 +16,5 @@
 namespace ep_lib 
 {
+  
 
   int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status *status)
@@ -66,7 +67,4 @@
     }
 
-    Message_Check(comm);
-		
-
     request->mpi_request = MPI_REQUEST_NULL_STD;
     request->buf = buf;
@@ -81,4 +79,48 @@
     Message_Check(comm);
 
+    EP_PendingRequests->push_back(request);
+    printf("proc %d : EP_PendingRequests insert one request, add = %p(%p), buf = %p(%p)\n", dest_rank, EP_PendingRequests->back(), request, buf, request->buf);
+    
+    // check all EP_PendingRequests
+    
+    //if(EP_PendingRequests == 0 ) EP_PendingRequests = new std::list< MPI_Request* >; 
+    if(!EP_PendingRequests->empty())
+    {
+      printf("proc %d have %d pending irecv request\n", dest_rank, EP_PendingRequests->size());
+      
+      for(std::list<MPI_Request* >::iterator it = EP_PendingRequests->begin(); it!=EP_PendingRequests->end(); )
+      {
+        if((*it)->type != 2) 
+        {
+          printf("proc %d : pending request type = %d, src= %d, tag = %d, add = %p skip\n", dest_rank, (*it)->type, (*it)->ep_src, (*it)->ep_tag, *it);
+          EP_PendingRequests->erase(it);
+          it = EP_PendingRequests->begin();
+          printf("proc %d : pending request processed, size = %d, it = %p\n", dest_rank, EP_PendingRequests->size(), *it);
+          continue;
+        }
+        
+        printf("proc %d : pending irecv request src = %d, tag = %d, type = %d, add = %p\n", dest_rank, (*it)->ep_src, (*it)->ep_tag, (*it)->type, *it);
+        int probed = false;
+        MPI_Message pending_message;
+        MPI_Status pending_status;
+    
+        MPI_Improbe((*it)->ep_src, (*it)->ep_tag, (*it)->comm, &probed, &pending_message, &pending_status);
+        printf("proc %d : pending irecv request probed to be %d, add = %p\n",dest_rank, probed, *it);
+    
+        if(probed) 
+        { 
+          int count;
+          MPI_Get_count(&pending_status, (*it)->ep_datatype, &count);
+          MPI_Imrecv((*it)->buf, count, (*it)->ep_datatype, &pending_message, *it);
+          printf("proc %d : pending request is imrecving src = %d, tag = %d, add = %p, buf = %p, count = %d\n", dest_rank, (*it)->ep_src, (*it)->ep_tag, *it, (*it)->buf, count);
+          EP_PendingRequests->erase(it);
+          it = EP_PendingRequests->begin();
+          printf("proc %d : pending request processed, size = %d\n", dest_rank, EP_PendingRequests->size());
+          continue;
+        }
+        else it++;
+      }
+    }
+/*
     int flag = false;
     MPI_Message message;
@@ -90,5 +132,7 @@
     {
       MPI_Imrecv(buf, count, datatype, &message, request);
+      printf("proc %d : found message in local queue, src = %d, tag = %d\n", dest_rank, src, tag);
     }
+  */  
 
     return 0;
@@ -110,5 +154,5 @@
     request->ep_tag = message->ep_tag;
     request->ep_src = message->ep_src;
-    request->buf = buf;
+    //request->buf = buf;
 
     return 0;
Index: /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_send.cpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_send.cpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_send.cpp	(revision 1185)
@@ -101,4 +101,5 @@
     request->type = 1; 		// used in wait
     request->comm = comm;
+    request->buf = const_cast<void*>(buf);
 
     Message_Check(comm);
Index: /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_test.cpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_test.cpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_test.cpp	(revision 1185)
@@ -20,4 +20,5 @@
 
     *flag = false;
+    
 
     if(request->type == 1)      // isend
@@ -46,7 +47,9 @@
       if(*flag)
       {
+        
         int count;
         MPI_Get_count(status, request->ep_datatype, &count);
         MPI_Imrecv(request->buf, count, request->ep_datatype, &message, request);
+        printf("in ep_test, found message src = %d, tag = %d, type = %d\n", request->ep_src, request->ep_tag, request->type);
         MPI_Test(request, flag, status);
       }
Index: /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_type.hpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_type.hpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_type.hpp	(revision 1185)
@@ -490,4 +490,6 @@
             //    <MPI_Fint,thread_num>   EP_Comm
 
+  static std::list< MPI_Request* > * EP_PendingRequests = new std::list< MPI_Request* >;
+  #pragma omp threadprivate(EP_PendingRequests)
 }
 
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 1184)
+++ /XIOS/dev/branch_yushan_merged/extern/src_ep_dev/ep_wait.cpp	(revision 1185)
@@ -57,4 +57,5 @@
 
       int count;
+      request->type = 3;
       MPI_Get_count(status, request->ep_datatype, &count);
       MPI_Mrecv(request->buf, count, request->ep_datatype, &message, status);
@@ -116,4 +117,5 @@
     while(finished < count)
     {
+
       for(int i=0; i<count; i++)
       {
@@ -131,4 +133,13 @@
           else // irecv
           {
+            // parcours pending list
+            // find request in waitall
+                Message_Check(array_of_requests[i].comm);
+               // improbe + mrecv
+               // erase element in pending list
+ //             finished++;
+ //             finished_index[i] = true;
+            
+
             int flag = false;
             MPI_Message message;
Index: /XIOS/dev/branch_yushan_merged/inputs/REMAP/iodef.xml
===================================================================
--- /XIOS/dev/branch_yushan_merged/inputs/REMAP/iodef.xml	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/inputs/REMAP/iodef.xml	(revision 1185)
@@ -40,5 +40,5 @@
           <field field_ref="dst_field_regular" name="field_regular" enabled=".TRUE."/>
           <field field_ref="dst_field_regular_pole_0" name="field_regular_pole_0" enabled=".TRUE." />
-          <field field_ref="dst_field_regular_pole_1" name="field_regular_pole_1" enabled=".FALSE." />
+          <field field_ref="dst_field_regular_pole_1" name="field_regular_pole_1" enabled=".TRUE." />
        </file>
        <file id="output_dst_curvilinear" name="output_dst_curvilinear" enabled=".TRUE." >
Index: /XIOS/dev/branch_yushan_merged/src/client.cpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/src/client.cpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/src/client.cpp	(revision 1185)
@@ -107,13 +107,13 @@
             MPI_Comm_rank(intraComm,&intraCommRank) ;
             
-            #pragma omp critical(_output)
+            /*#pragma omp critical(_output)
             {
               info(10)<<"intercommCreate::client "<<test_omp_rank<< " "<< &test_omp_rank <<" intraCommSize : "<<intraCommSize
                  <<" intraCommRank :"<<intraCommRank<<"  serverLeader "<< serverLeader
                  <<" globalComm : "<< &(CXios::globalComm) << endl ;  
-            }
+            }*/
 
             
-            
+            test_sendrecv(CXios::globalComm);
             MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ;
 
Index: /XIOS/dev/branch_yushan_merged/src/client_client_dht_template_impl.hpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/src/client_client_dht_template_impl.hpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/src/client_client_dht_template_impl.hpp	(revision 1185)
@@ -12,4 +12,5 @@
 #ifdef _usingEP
 #include "ep_declaration.hpp"
+#include "ep_lib.hpp"
 #endif
 
Index: /XIOS/dev/branch_yushan_merged/src/server.cpp
===================================================================
--- /XIOS/dev/branch_yushan_merged/src/server.cpp	(revision 1184)
+++ /XIOS/dev/branch_yushan_merged/src/server.cpp	(revision 1185)
@@ -90,7 +90,8 @@
              MPI_Comm_size(intraComm,&intraCommSize) ;
              MPI_Comm_rank(intraComm,&intraCommRank) ;
-             info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize
-                     <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;
-
+             /*info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize
+                     <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;*/
+
+             test_sendrecv(CXios::globalComm);
              MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ;
              interComm.push_back(newComm) ;
