Index: XIOS/trunk/src/context_client.cpp
===================================================================
--- XIOS/trunk/src/context_client.cpp	(revision 702)
+++ XIOS/trunk/src/context_client.cpp	(revision 704)
@@ -104,5 +104,5 @@
       }
 
-      if (0 != parentServer) // attached mode
+      if (isAttachedModeEnabled())
       {
         waitEvent(ranks);
@@ -141,5 +141,5 @@
       }
 
-      if (0 != parentServer) // attached mode
+      if (isAttachedModeEnabled())
       {
         while (checkBuffers())
@@ -288,5 +288,13 @@
   }
 
- 
+  /*!
+   * Check if the attached mode is used.
+   *
+   * \return true if and only if attached mode is used
+   */
+  bool CContextClient::isAttachedModeEnabled() const
+  {
+    return (parentServer != 0);
+  }
 
    /*!
Index: XIOS/trunk/src/context_client.hpp
===================================================================
--- XIOS/trunk/src/context_client.hpp	(revision 702)
+++ XIOS/trunk/src/context_client.hpp	(revision 704)
@@ -43,4 +43,6 @@
       const std::list<int>& getRanksServerLeader(void) const;
 
+      bool isAttachedModeEnabled() const;
+
       // Close and finalize context client
       void closeContext(void);
Index: XIOS/trunk/src/interface/c/iccalendar.cpp
===================================================================
--- XIOS/trunk/src/interface/c/iccalendar.cpp	(revision 702)
+++ XIOS/trunk/src/interface/c/iccalendar.cpp	(revision 704)
@@ -13,5 +13,6 @@
     CTimer::get("XIOS").resume();
     xios::CContext* context = CContext::getCurrent();
-    if (!context->hasServer) context->checkBuffersAndListen();
+    if (!context->hasServer && !context->client->isAttachedModeEnabled())
+      context->checkBuffersAndListen();
     context->updateCalendar(step);
     context->sendUpdateCalendar(step);
Index: XIOS/trunk/src/interface/c/icdata.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icdata.cpp	(revision 702)
+++ XIOS/trunk/src/interface/c/icdata.cpp	(revision 704)
@@ -373,5 +373,6 @@
       CTimer::get("XIOS send field").resume();
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
       CArray<double, 1> data(data_k8, shape(data_Xsize), neverDeleteData);
       CField::get(fieldid_str)->setData(data);
@@ -389,5 +390,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<double, 1> data(data_k8, shape(data_Xsize), neverDeleteData);
@@ -407,5 +409,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<double, 2>data(data_k8, shape(data_Xsize, data_Ysize), neverDeleteData);
@@ -425,5 +428,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData);
@@ -442,5 +446,6 @@
       CTimer::get("XIOS send field").resume();
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<float, 1> data_tmp(data_k4, shape(data_Xsize), neverDeleteData);
@@ -461,5 +466,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<float, 1> data_tmp(data_k4, shape(data_Xsize), neverDeleteData);
@@ -481,5 +487,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<float, 2> data_tmp(data_k4, shape(data_Xsize, data_Ysize), neverDeleteData);
@@ -501,5 +508,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<float, 3> data_tmp(data_k4, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData);
@@ -523,5 +531,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<double, 1> data(data_k8, shape(data_Xsize), neverDeleteData);
@@ -541,5 +550,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<double, 2>data(data_k8, shape(data_Xsize, data_Ysize), neverDeleteData);
@@ -559,5 +569,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<double, 3>data(data_k8, shape(data_Xsize, data_Ysize, data_Zsize), neverDeleteData);
@@ -577,5 +588,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<double, 1> data(data_Xsize);
@@ -597,5 +609,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<double, 2> data(data_Xsize, data_Ysize);
@@ -617,5 +630,6 @@
 
       CContext* context = CContext::getCurrent();
-      if (!context->hasServer) context->checkBuffersAndListen();
+      if (!context->hasServer && !context->client->isAttachedModeEnabled())
+        context->checkBuffersAndListen();
 
       CArray<double, 3> data(data_Xsize, data_Ysize, data_Zsize);
