Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_lib_endpoint.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_lib_endpoint.hpp	(revision 1531)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_lib_endpoint.hpp	(revision 1532)
@@ -16,4 +16,7 @@
   
   int MPI_Comm_dup_endpoint(MPI_Comm comm, MPI_Comm *newcomm);
+  
+  int MPI_Iprobe_endpoint(int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status);
+  int MPI_Improbe_endpoint(int source, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status);
 
 }
Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_message.cpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_message.cpp	(revision 1531)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_message.cpp	(revision 1532)
@@ -67,5 +67,5 @@
         #pragma omp critical (_query0)
         {
-          MPI_Iprobe((*(*it))->ep_src, (*(*it))->ep_tag, ((*(*it))->comm), &probed, &status);
+          MPI_Iprobe_endpoint((*(*it))->ep_src, (*(*it))->ep_tag, ((*(*it))->comm), &probed, &status);
           if(probed)
           {
@@ -77,5 +77,5 @@
           
           
-            MPI_Improbe((*(*it))->ep_src, (*(*it))->ep_tag, (*(*it))->comm, &probed, message, &status);
+            MPI_Improbe_endpoint((*(*it))->ep_src, (*(*it))->ep_tag, (*(*it))->comm, &probed, message, &status);
         
           }
@@ -196,13 +196,4 @@
         continue;
       }
-      
-      if((*(*it))->state == 2)
-      {
-        EP_PendingRequests->erase(it);
-        
-        memcheck("EP_PendingRequests["<<ep_rank<<"]->size() = " << EP_PendingRequests->size());
-        it = EP_PendingRequests->begin();
-        continue;
-      }
           
       if((*(*it))->ep_src>6)
@@ -217,2 +208,3 @@
 
 }
+
Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_probe.cpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_probe.cpp	(revision 1531)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_probe.cpp	(revision 1532)
@@ -46,6 +46,4 @@
 
 
-
-
   int MPI_Iprobe(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *status)
   {
@@ -55,33 +53,39 @@
       return MPI_Iprobe_mpi(src, tag, comm, flag, status);
     }
+
+    if(comm->is_intercomm)
+    {
+      src = comm->inter_rank_map->at(src);
+    } 
     
-    else
+    return MPI_Iprobe_endpoint(src, tag, comm, flag, status);
+  }
+
+  int MPI_Iprobe_endpoint(int src, int tag, MPI_Comm comm, int *flag, MPI_Status *status)
+  {
+    Debug("MPI_Iprobe with EP\n");
+
+    *flag = false;
+    
+    Message_Check(comm);
+
+    #pragma omp flush
+
+    #pragma omp critical (_query)
+    for(Message_list::iterator it = comm->ep_comm_ptr->message_queue->begin(); it!= comm->ep_comm_ptr->message_queue->end(); ++it)
     {
-      Debug("MPI_Iprobe with EP\n");
+      bool src_matched = src<0? true: (*it)->ep_src == src;
+      bool tag_matched = tag<0? true: (*it)->ep_tag == tag;
+      
+      if(src_matched && tag_matched)        
+      {
+        Debug("find message\n");
+         
+        status->mpi_status = new ::MPI_Status(*static_cast< ::MPI_Status*>((*it)->mpi_status));
+        status->ep_src = (*it)->ep_src;
+        status->ep_tag = (*it)->ep_tag;
 
-      *flag = false;
-    
-      Message_Check(comm);
-
-      #pragma omp flush
-
-      #pragma omp critical (_query)
-      for(Message_list::iterator it = comm->ep_comm_ptr->message_queue->begin(); it!= comm->ep_comm_ptr->message_queue->end(); ++it)
-      {
-        bool src_matched = src<0? true: (*it)->ep_src == src;
-        bool tag_matched = tag<0? true: (*it)->ep_tag == tag;
-        
-        if(src_matched && tag_matched)        
-        {
-          Debug("find message\n");
-          
-
-          status->mpi_status = new ::MPI_Status(*static_cast< ::MPI_Status*>((*it)->mpi_status));
-          status->ep_src = (*it)->ep_src;
-          status->ep_tag = (*it)->ep_tag;
-
-          *flag = true;
-          break;
-        }
+        *flag = true;
+        break;
       }
     }
@@ -90,17 +94,33 @@
   
 
+  int MPI_Improbe(int src, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status)
+  {
+    if(!comm->is_ep)
+    {
+      Debug("MPI_Iprobe with MPI\n");
+      return MPI_Improbe_mpi(src, tag, comm, flag, message, status);
+    }
+
+    if(comm->is_intercomm)
+    {
+      src = comm->inter_rank_map->at(src);
+      *message = new ep_message;
+      printf("============= new *message = %p\n", *message);
+    } 
+    
+    return MPI_Improbe_endpoint(src, tag, comm, flag, message, status);
+  }
 
 
-  int MPI_Improbe(int src, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status)
+
+  int MPI_Improbe_endpoint(int src, int tag, MPI_Comm comm, int *flag, MPI_Message *message, MPI_Status *status)
   {
     int ep_rank_loc = comm->ep_comm_ptr->size_rank_info[1].first;
     int mpi_rank    = comm->ep_comm_ptr->size_rank_info[2].first;
+
     *flag = false;
-    if(!comm->is_ep)
-    {
-      Debug("calling MPI_Improbe MPI\n");
-      return MPI_Improbe_mpi(src, tag, comm, flag, message, status);
-    } 
-
+    
+    Message_Check(comm);
+    
     #pragma omp flush
 
@@ -155,2 +175,3 @@
 }
 
+
Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_recv.cpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_recv.cpp	(revision 1531)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_recv.cpp	(revision 1532)
@@ -106,4 +106,6 @@
     memcheck("delete " << (*message)->mpi_message << " : in ep_lib::MPI_Mrecv, delete (*message)->mpi_message");
     delete (*message)->mpi_message;
+    memcheck("delete " << *message << " : in ep_lib::MPI_Imrecv, delete *message");
+    delete *message;
 
 #ifdef _check_sum
@@ -130,4 +132,5 @@
     memcheck("delete " << (*message)->mpi_message << " : in ep_lib::MPI_Imrecv, delete (*message)->mpi_message");
     delete (*message)->mpi_message;
+
 
 #ifdef _check_sum
Index: XIOS/dev/branch_openmp/extern/ep_dev/main.cpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/main.cpp	(revision 1531)
+++ XIOS/dev/branch_openmp/extern/ep_dev/main.cpp	(revision 1532)
@@ -144,4 +144,33 @@
 
       if(rank == 0) printf("            \t Test iP2P for intercomm \t OK\n");
+
+      if(color==2 && split_rank==0)
+      {
+        double sendbuf[9]={1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9};
+        MPI_Request send_request;
+        MPI_Status send_status;
+        MPI_Isend(sendbuf, 9, MPI_DOUBLE, 0, 10, inter_comm, &send_request);
+        MPI_Wait(&send_request, &send_status);
+      }
+
+      if(color==1 && split_rank==0)
+      {
+        double recvbuf[9];
+        MPI_Request recv_request;
+        MPI_Status recv_status;
+        int probed = false;
+        MPI_Message message;
+        while(!probed)
+        {
+          MPI_Improbe(0, 10, inter_comm, &probed, &message, &recv_status);  
+        }
+        MPI_Mrecv(recvbuf, 9, MPI_DOUBLE, &message, &recv_status);
+        for(int i=0; i<9; i++)
+        {
+          printf("==========recvbuf[%d] = %lf\n", i, recvbuf[i]);
+        }
+      }
+
+
 
 
@@ -1546,2 +1575,3 @@
 
 }
+
