Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/window_manager.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/window_manager.hpp	(revision 2262)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/manager/window_manager.hpp	(revision 2263)
@@ -138,4 +138,28 @@
 
     template< class T >
+    void updateToExclusiveWindow(int rank, T* object, void (T::*dumpOut)(CBufferOut&) )
+    {
+      CBufferOut buffer ;
+      (object->*dumpOut)(buffer) ;
+      size_t size=buffer.count() ;
+      MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, window_) ;
+      MPI_Put(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Put(buffer.start(), size, MPI_CHAR, rank,OFFSET_BUFFER, size, MPI_CHAR, window_) ;
+      MPI_Win_unlock(rank, window_) ;
+    }
+
+    template< class T >
+    void updateTosharedWindow(int rank, T* object, void (T::*dumpOut)(CBufferOut&) )
+    {
+      CBufferOut buffer ;
+      (object->*dumpOut)(buffer) ;
+      size_t size=buffer.count() ;
+      MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, window_) ;
+      MPI_Put(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Put(buffer.start(), size, MPI_CHAR, rank,OFFSET_BUFFER, size, MPI_CHAR, window_) ;
+      MPI_Win_unlock(rank, window_) ;
+    }
+
+    template< class T >
     void updateToLockedWindow(int rank, T* object, void (T::*dumpOut)(CBufferOut&) )
     {
@@ -146,4 +170,5 @@
       MPI_Put(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
       MPI_Put(buffer.start(), size, MPI_CHAR, rank,OFFSET_BUFFER, size, MPI_CHAR, window_) ;
+      MPI_Win_flush(rank, window_) ;
 //      MPI_Win_unlock(rank, window_) ;
     }
@@ -154,4 +179,30 @@
       size_t size ;
       MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, window_) ;
+      MPI_Get(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Win_flush(rank,window_) ;
+      CBufferIn buffer(size) ;
+      MPI_Get(buffer.start(), size, MPI_CHAR, rank,OFFSET_BUFFER, size, MPI_CHAR, window_) ;
+      MPI_Win_unlock(rank, window_) ;
+      (object->*dumpIn)(buffer) ;
+    }
+
+    template< typename T >
+    void updateFromExclusiveWindow(int rank, T* object, void (T::*dumpIn)(CBufferIn&) ) 
+    {
+      size_t size ;
+      MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, window_) ;
+      MPI_Get(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Win_flush(rank,window_) ;
+      CBufferIn buffer(size) ;
+      MPI_Get(buffer.start(), size, MPI_CHAR, rank,OFFSET_BUFFER, size, MPI_CHAR, window_) ;
+      MPI_Win_unlock(rank, window_) ;
+      (object->*dumpIn)(buffer) ;
+    }
+
+    template< typename T >
+    void updateFromSharedWindow(int rank, T* object, void (T::*dumpIn)(CBufferIn&) ) 
+    {
+      size_t size ;
+      MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, window_) ;
       MPI_Get(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
       MPI_Win_flush(rank,window_) ;
@@ -194,7 +245,8 @@
 
     template< class T >
-    void pushToLockedWindow(int rank, T* object, void (T::*dumpOut)(CBufferOut&) )
-    {
-      size_t size ;
+    void pushToExclusiveWindow(int rank, T* object, void (T::*dumpOut)(CBufferOut&) )
+    {
+      size_t size ;
+      MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, window_) ;
       MPI_Get(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
       MPI_Win_flush(rank,window_) ;
@@ -205,4 +257,36 @@
       MPI_Put(&newSize, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
       MPI_Put(buffer.start(), bufferSize, MPI_CHAR, rank, OFFSET_BUFFER+size, bufferSize, MPI_CHAR, window_) ;
+      MPI_Win_unlock(rank, window_) ;
+    }
+
+    template< class T >
+    void pushToSharedWindow(int rank, T* object, void (T::*dumpOut)(CBufferOut&) )
+    {
+      size_t size ;
+      MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, window_) ;
+      MPI_Get(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Win_flush(rank,window_) ;
+      CBufferOut buffer ;
+      (object->*dumpOut)(buffer) ;
+      size_t bufferSize=buffer.count() ;
+      size_t newSize = size + bufferSize;
+      MPI_Put(&newSize, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Put(buffer.start(), bufferSize, MPI_CHAR, rank, OFFSET_BUFFER+size, bufferSize, MPI_CHAR, window_) ;
+      MPI_Win_unlock(rank, window_) ;
+    }
+
+    template< class T >
+    void pushToLockedWindow(int rank, T* object, void (T::*dumpOut)(CBufferOut&) )
+    {
+      size_t size ;
+      MPI_Get(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Win_flush(rank,window_) ;
+      CBufferOut buffer ;
+      (object->*dumpOut)(buffer) ;
+      size_t bufferSize=buffer.count() ;
+      size_t newSize = size + bufferSize;
+      MPI_Put(&newSize, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Put(buffer.start(), bufferSize, MPI_CHAR, rank, OFFSET_BUFFER+size, bufferSize, MPI_CHAR, window_) ;
+      MPI_Win_flush(rank, window_) ;
     }
 
@@ -227,4 +311,42 @@
 
     template< typename T >
+    void popFromExclusiveWindow(int rank, T* object, void (T::*dumpIn)(CBufferIn&) ) 
+    {
+      size_t size ;
+      MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, window_) ;
+      MPI_Get(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Win_flush(rank,window_) ;
+      CBufferIn buffer(size) ;
+      MPI_Get(buffer.start(), size, MPI_CHAR, rank,OFFSET_BUFFER, size, MPI_CHAR, window_) ;
+      MPI_Win_flush(rank,window_) ;
+      (object->*dumpIn)(buffer) ;
+      
+      size=buffer.remain() ;
+      MPI_Put(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Put(buffer.ptr(),buffer.remain(), MPI_CHAR, rank, OFFSET_BUFFER, buffer.remain(), MPI_CHAR, window_) ;
+      MPI_Win_unlock(rank, window_) ;
+      
+    }
+
+    template< typename T >
+    void popFromSharedWindow(int rank, T* object, void (T::*dumpIn)(CBufferIn&) ) 
+    {
+      size_t size ;
+      MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, window_) ;
+      MPI_Get(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Win_flush(rank,window_) ;
+      CBufferIn buffer(size) ;
+      MPI_Get(buffer.start(), size, MPI_CHAR, rank,OFFSET_BUFFER, size, MPI_CHAR, window_) ;
+      MPI_Win_flush(rank,window_) ;
+      (object->*dumpIn)(buffer) ;
+      
+      size=buffer.remain() ;
+      MPI_Put(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
+      MPI_Put(buffer.ptr(),buffer.remain(), MPI_CHAR, rank, OFFSET_BUFFER, buffer.remain(), MPI_CHAR, window_) ;
+      MPI_Win_unlock(rank, window_) ;
+      
+    }
+
+    template< typename T >
     void popFromLockedWindow(int rank, T* object, void (T::*dumpIn)(CBufferIn&) ) 
     {
@@ -240,4 +362,5 @@
       MPI_Put(&size, SIZE_BUFFER_SIZE, MPI_CHAR, rank, OFFSET_BUFFER_SIZE, SIZE_BUFFER_SIZE, MPI_CHAR, window_) ;
       MPI_Put(buffer.ptr(),buffer.remain(), MPI_CHAR, rank, OFFSET_BUFFER, buffer.remain(), MPI_CHAR, window_) ;
+      MPI_Win_flush(rank, window_) ;
     }
 
