Index: XIOS/trunk/src/client.cpp
===================================================================
--- XIOS/trunk/src/client.cpp	(revision 489)
+++ XIOS/trunk/src/client.cpp	(revision 490)
@@ -1,2 +1,3 @@
+#include "globalScopeData.hpp"
 #include "xmlioserver_spl.hpp"
 #include "cxios.hpp"
@@ -12,5 +13,5 @@
 
 namespace xios
-{                      
+{
 
     MPI_Comm CClient::intraComm ;
@@ -18,6 +19,7 @@
     int CClient::serverLeader ;
     bool CClient::is_MPI_Initialized ;
-    
-    
+    int CClient::rank = INVALID_RANK;
+    StdOFStream CClient::m_infoStream;
+
     void CClient::initialize(const string& codeId,MPI_Comm& localComm,MPI_Comm& returnComm)
     {
@@ -26,5 +28,5 @@
       if (initialized) is_MPI_Initialized=true ;
       else is_MPI_Initialized=false ;
-      
+
 // don't use OASIS
       if (!CXios::usingOasis)
@@ -33,5 +35,5 @@
         if (localComm == MPI_COMM_NULL)
         {
-          if (!is_MPI_Initialized) 
+          if (!is_MPI_Initialized)
           {
             int argc=0;
@@ -41,24 +43,24 @@
           CTimer::get("XIOS").resume() ;
           CTimer::get("XIOS init").resume() ;
-          boost::hash<string> hashString ;    
-    
+          boost::hash<string> hashString ;
+
           unsigned long hashClient=hashString(codeId) ;
           unsigned long hashServer=hashString(CXios::xiosCodeId) ;
           unsigned long* hashAll ;
-          int rank ;
           int size ;
           int myColor ;
           int i,c ;
           MPI_Comm newComm ;
-      
+
           MPI_Comm_size(CXios::globalComm,&size) ;
           MPI_Comm_rank(CXios::globalComm,&rank);
+
           hashAll=new unsigned long[size] ;
-     
+
           MPI_Allgather(&hashClient,1,MPI_LONG,hashAll,1,MPI_LONG,CXios::globalComm) ;
 
           map<unsigned long, int> colors ;
           map<unsigned long, int> leaders ;
-      
+
           for(i=0,c=0;i<size;i++)
           {
@@ -70,11 +72,11 @@
             }
           }
-     
+
           myColor=colors[hashClient] ;
-      
+
           MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ;
 
           if (CXios::usingServer)
-          {     
+          {
             int clientLeader=leaders[hashClient] ;
             serverLeader=leaders[hashServer] ;
@@ -88,8 +90,8 @@
         }
         // localComm argument is given
-        else 
+        else
         {
           if (CXios::usingServer)
-          {          
+          {
             //ERROR("void CClient::initialize(const string& codeId,MPI_Comm& localComm,MPI_Comm& returnComm)", << " giving a local communictor is not compatible with using server mode") ;
           }
@@ -113,28 +115,26 @@
         CTimer::get("XIOS").resume() ;
         CTimer::get("XIOS init").resume() ;
-  
-        if (CXios::usingServer) 
+
+        if (CXios::usingServer)
         {
           MPI_Status status ;
-          int rank ;
-          MPI_Comm_rank(intraComm,&rank) ;
-
+            MPI_Comm_rank(intraComm,&rank) ;
           oasis_get_intercomm(interComm,CXios::xiosCodeId) ;
           if (rank==0) MPI_Recv(&serverLeader,1, MPI_INT, 0, 0, interComm, &status) ;
           MPI_Bcast(&serverLeader,1,MPI_INT,0,intraComm) ;
-           
+
         }
         else MPI_Comm_dup(intraComm,&interComm) ;
       }
-          
+
       MPI_Comm_dup(intraComm,&returnComm) ;
     }
-    
-    
+
+
     void CClient::registerContext(const string& id,MPI_Comm contextComm)
     {
       CContext::setCurrent(id) ;
       CContext* context=CContext::create(id) ;
-        
+
       if (!CXios::isServer)
       {
@@ -143,11 +143,11 @@
         int leaderRank ;
         MPI_Comm contextInterComm ;
-      
+
         MPI_Comm_size(contextComm,&size) ;
         MPI_Comm_rank(contextComm,&rank) ;
         MPI_Comm_rank(CXios::globalComm,&globalRank) ;
         if (rank!=0) globalRank=0 ;
-      
-    
+
+
         CMessage msg ;
         msg<<id<<size<<globalRank ;
@@ -157,11 +157,11 @@
         CBufferOut buffer(buff,messageSize) ;
         buffer<<msg ;
-      
+
         MPI_Send(buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ;
         delete [] buff ;
-      
+
         MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ;
         info(10)<<"Register new Context : "<<id<<endl ;
- 
+
         MPI_Comm inter ;
         MPI_Intercomm_merge(contextInterComm,0,&inter) ;
@@ -178,5 +178,5 @@
       }
     }
-    
+
     void CClient::finalize(void)
     {
@@ -185,11 +185,11 @@
       if (!CXios::isServer)
       {
-        MPI_Comm_rank(intraComm,&rank) ;  
-        if (rank==0) 
+        MPI_Comm_rank(intraComm,&rank) ;
+        if (rank==0)
         {
           MPI_Send(&msg,1,MPI_INT,0,0,interComm) ;
         }
       }
-      
+
      CTimer::get("XIOS finalize").suspend() ;
      CTimer::get("XIOS").suspend() ;
@@ -201,5 +201,5 @@
       }
       info(20) << "Client side context is finalized"<<endl ;
-      report(0) <<" Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ; 
+      report(0) <<" Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ;
       report(0)<< " Performance report : time spent for waiting free buffer : "<< CTimer::get("Blocking time").getCumulatedTime()<<" s"<<endl ;
       report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS").getCumulatedTime()*100.<<" %"<<endl ;
@@ -209,3 +209,40 @@
       report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ;
    }
+
+   int CClient::getRank()
+   {
+     return rank;
+   }
+
+     /*!
+      * \brief Open file stream to write in
+      *   Opening a file stream with a specific file name suffix-client+rank
+      * \param [in] protype file name
+     */
+     void CClient::openInfoStream(const StdString& fileName)
+     {
+       std::filebuf* fb = m_infoStream.rdbuf();
+       StdStringStream fileNameClient;
+       fileNameClient << fileName <<"_client_" << getRank() << ".txt";
+       fb->open(fileNameClient.str().c_str(), std::ios::out);
+       if (!fb->is_open())
+       ERROR("void CClient::openInfoStream(const StdString& fileName)",
+            <<endl<< "Can not open <"<<fileNameClient<<"> file to write" );
+
+       info.write2File(fb);
+     }
+
+     //! Write out to standard output
+     void CClient::openInfoStream()
+     {
+       info.write2StdOut();
+     }
+
+     //! Close file if it opens
+     void CClient::closeInfoStream()
+     {
+       if (m_infoStream.is_open()) m_infoStream.close();
+     }
+
+
 }
Index: XIOS/trunk/src/client.hpp
===================================================================
--- XIOS/trunk/src/client.hpp	(revision 489)
+++ XIOS/trunk/src/client.hpp	(revision 490)
@@ -6,9 +6,9 @@
 
 namespace xios
-{                      
+{
     class CClient
     {
        public:
-       
+
        static void initialize(const string& codeId,MPI_Comm& localComm,MPI_Comm& returnComm) ;
        static void finalize(void) ;
@@ -19,4 +19,19 @@
        static int serverLeader;
        static bool is_MPI_Initialized ;
+
+       public:
+        static int getRank();
+
+        static void openInfoStream(const StdString& fileName);
+
+        static void openInfoStream();
+
+        static void closeInfoStream();
+
+       protected:
+       static int rank;
+       static StdOFStream m_infoStream;
+
+
     } ;
 }
Index: XIOS/trunk/src/cxios.cpp
===================================================================
--- XIOS/trunk/src/cxios.cpp	(revision 489)
+++ XIOS/trunk/src/cxios.cpp	(revision 490)
@@ -15,15 +15,18 @@
   string CXios::rootFile="./iodef.xml" ;
   string CXios::xiosCodeId="xios.x" ;
-  
+  string CXios::infoFile="./info_output";
+
   bool CXios::isClient ;
   bool CXios::isServer ;
   MPI_Comm CXios::globalComm ;
   bool CXios::usingOasis ;
-  bool CXios::usingServer ;   
+  bool CXios::usingServer ;
   size_t CXios::bufferSize ;
   double CXios::bufferServerFactorSize=2 ;
   size_t CXios::defaultBufferSize=1024*1024*100 ; // 100Mo
   double CXios::defaultBufferServerFactorSize=2 ;
-  
+  bool CXios::printInfo2File;
+
+
   void CXios::initialize()
   {
@@ -33,4 +36,5 @@
     usingOasis=getin<bool>("using_oasis",false) ;
     info.setLevel(getin<int>("info_level",0)) ;
+    printInfo2File=getin<bool>("info_output_file",false);
     bufferSize=getin<size_t>("buffer_size",defaultBufferSize) ;
     bufferServerFactorSize=getin<double>("buffer_server_factor_size",defaultBufferServerFactorSize) ;
@@ -41,25 +45,31 @@
   void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm)
   {
-     
+
     initialize() ;
-    
+
     isClient=true;
     if (usingServer) isServer=false;
     else isServer=true ;
-    
+
     CClient::initialize(codeId,localComm,returnComm) ;
 
-  }   
+    if (printInfo2File)
+      CClient::openInfoStream(infoFile);
+    else
+      CClient::openInfoStream();
+  }
 
   void CXios::clientFinalize(void)
   {
-     CClient::finalize() ; 
+     CClient::finalize() ;
+     CClient::closeInfoStream();
+
 #ifdef XIOS_MEMTRACK
      MemTrack::TrackListMemoryUsage() ;
-     MemTrack::TrackDumpBlocks();  
+     MemTrack::TrackDumpBlocks();
 #endif
-  }   
-  
-  
+  }
+
+
   void CXios::initServerSide(void)
   {
@@ -70,12 +80,23 @@
     isServer=false ;
 
-    CServer::initialize() ;
-  } 
-  
+    //! Initialize all aspect MPI
+    CServer::initialize();
+
+    if (printInfo2File)
+      CServer::openInfoStream(infoFile);
+    else
+      CServer::openInfoStream();
+
+    //! Enter the loop to listen message from Client
+    CServer::eventLoop();
+
+    //! Finalize
+    CServer::finalize();
+    CServer::closeInfoStream();
+  }
+
   void CXios::parseFile(const string& filename)
   {
-    xml::CXMLParser::ParseFile(filename); 
+    xml::CXMLParser::ParseFile(filename);
   }
-  
-
 }
Index: XIOS/trunk/src/cxios.hpp
===================================================================
--- XIOS/trunk/src/cxios.hpp	(revision 489)
+++ XIOS/trunk/src/cxios.hpp	(revision 490)
@@ -10,34 +10,42 @@
   {
      public:
-     
+
      static string rootFile ;
      static string xiosCodeId ;
-     
+     static string infoFile;
+
      static void initialize(void) ;
-      
-   
+
+
      static void initClientSide(const string & codeId, MPI_Comm& localComm, MPI_Comm& returnComm) ;
      static void initServerSide(void) ;
      static void clientFinalize(void) ;
      static void parseFile(const string& filename) ;
-   
+
      template <typename T>
      static T getin(const string& id,const T& defaultValue) ;
-     
+
      template <typename T>
      static T getin(const string& id) ;
+
+//     static void openFileInfo(const StdString& fileName);
+//     static void closeFileInfo();
 
      static bool isClient ;
      static bool isServer ;
 
-     static MPI_Comm globalComm ; 
-     
+     static MPI_Comm globalComm ;
+
+     static bool printInfo2File;
      static bool usingOasis ;
-     static bool usingServer ;   
+     static bool usingServer ;
      static size_t bufferSize ;
      static size_t defaultBufferSize ;
      static double bufferServerFactorSize ;
      static double defaultBufferServerFactorSize ;
-        
+
+     private:
+//     static StdOFStream infoFileStream_;
+
   } ;
 
Index: XIOS/trunk/src/globalScopeData.hpp
===================================================================
--- XIOS/trunk/src/globalScopeData.hpp	(revision 490)
+++ XIOS/trunk/src/globalScopeData.hpp	(revision 490)
@@ -0,0 +1,14 @@
+/*!
+   \file globalScopeData.hpp
+   \author Ha NGUYEN
+   \since  24 Sep 2014
+   \date 24 Sep 2014
+
+   Global scope variable and object definitions
+ */
+#ifndef __GLOBAL_SCOPE_DATA_HPP__
+#define __GLOBAL_SCOPE_DATA_HPP__
+
+const int INVALID_RANK = -1;
+
+#endif // __GLOBAL_SCOPE_DATA__
Index: XIOS/trunk/src/log.hpp
===================================================================
--- XIOS/trunk/src/log.hpp	(revision 489)
+++ XIOS/trunk/src/log.hpp	(revision 490)
@@ -13,10 +13,11 @@
   {
     public :
-    CLog(const string& name_) : ostream(cout.rdbuf()),level(0),name(name_) {}
-    CLog& operator()(int l) 
-    {  
-      if (l<=level) 
+    CLog(const string& name_) : ostream(cout.rdbuf()),level(0),name(name_), strBuf_(cout.rdbuf()) {}
+    CLog& operator()(int l)
+    {
+      if (l<=level)
       {
-        rdbuf(cout.rdbuf()) ;
+//        rdbuf(cout.rdbuf()) ;
+        rdbuf(strBuf_);
         *this<<"-> "<<name<<" : " ;
       }
@@ -24,12 +25,27 @@
       return *this;
     }
-    void setLevel(int l) {level=l; } 
+    void setLevel(int l) {level=l; }
     int getLevel() {return level ;}
     bool isActive(void) { if (rdbuf()==NULL) return true ; else return false ;}
     bool isActive(int l) {if (l<=level) return true ; else return false ; }
 
+  public:
+    //! Write info into a file with its streambuf
+    void write2File(std::streambuf* sBuff) { changeStreamBuff(sBuff); }
+
+    //! Write info into standard output
+    void write2StdOut() { changeStreamBuff(cout.rdbuf()); }
+  private:
+    /*!
+     * \brief Change current streambuf (by default std::cout) to new one
+     * This function associates a new streambuf to the current log object
+     * \param [in] pointer to new streambuf
+    */
+    void changeStreamBuff(std::streambuf* sBuff) { strBuf_ = sBuff; rdbuf(sBuff); }
+
     private :
     int level ;
     string name ;
+    std::streambuf* strBuf_;
   };
 
Index: XIOS/trunk/src/server.cpp
===================================================================
--- XIOS/trunk/src/server.cpp	(revision 489)
+++ XIOS/trunk/src/server.cpp	(revision 490)
@@ -1,2 +1,3 @@
+#include "globalScopeData.hpp"
 #include "xmlioserver_spl.hpp"
 #include "cxios.hpp"
@@ -13,13 +14,14 @@
 
 namespace xios
-{                      
+{
     MPI_Comm CServer::intraComm ;
     list<MPI_Comm> CServer::interComm ;
     bool CServer::isRoot ;
-    int CServer::rank ;
-    map<string,CContext*> CServer::contextList ;    
+    int CServer::rank = INVALID_RANK;
+    StdOFStream CServer::m_infoStream;
+    map<string,CContext*> CServer::contextList ;
     bool CServer::finished=false ;
     bool CServer::is_MPI_Initialized ;
-    
+
     void CServer::initialize(void)
     {
@@ -28,10 +30,10 @@
       if (initialized) is_MPI_Initialized=true ;
       else is_MPI_Initialized=false ;
-            
+
       // Not using OASIS
       if (!CXios::usingOasis)
       {
-        
-        if (!is_MPI_Initialized) 
+
+        if (!is_MPI_Initialized)
         {
           int argc=0;
@@ -40,20 +42,20 @@
         }
         CTimer::get("XIOS").resume() ;
- 
-        boost::hash<string> hashString ;    
-      
+
+        boost::hash<string> hashString ;
+
         unsigned long hashServer=hashString(CXios::xiosCodeId) ;
         unsigned long* hashAll ;
-      
-        int rank ;
+
+//        int rank ;
         int size ;
         int myColor ;
         int i,c ;
         MPI_Comm newComm ;
-      
+
         MPI_Comm_size(CXios::globalComm,&size) ;
         MPI_Comm_rank(CXios::globalComm,&rank);
         hashAll=new unsigned long[size] ;
-     
+
         MPI_Allgather(&hashServer,1,MPI_LONG,hashAll,1,MPI_LONG,CXios::globalComm) ;
 
@@ -61,5 +63,5 @@
         map<unsigned long, int> leaders ;
         map<unsigned long, int>::iterator it ;
-      
+
         for(i=0,c=0;i<size;i++)
         {
@@ -71,5 +73,5 @@
           }
         }
-     
+
         myColor=colors[hashServer] ;
         MPI_Comm_split(MPI_COMM_WORLD,myColor,rank,&intraComm) ;
@@ -77,5 +79,5 @@
         int serverLeader=leaders[hashServer] ;
         int clientLeader;
-     
+
          serverLeader=leaders[hashServer] ;
          for(it=leaders.begin();it!=leaders.end();it++)
@@ -84,5 +86,5 @@
            {
              clientLeader=it->second ;
-           
+
              MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ;
              interComm.push_back(newComm) ;
@@ -95,6 +97,8 @@
       else
       {
-        int rank ,size;
-        if (!is_MPI_Initialized) oasis_init(CXios::xiosCodeId) ;
+//        int rank ,size;
+        int size;
+        if (!is_MPI_Initialized) oasis_init(CXios::xiosCodeId);
+
         CTimer::get("XIOS").resume() ;
         oasis_get_localcomm(intraComm) ;
@@ -102,5 +106,5 @@
         MPI_Comm_size(intraComm,&size) ;
         string codesId=CXios::getin<string>("oasis_codes_id") ;
-         
+
         vector<string> splitted ;
         boost::split( splitted, codesId, boost::is_any_of(","), boost::token_compress_on ) ;
@@ -110,5 +114,5 @@
         int globalRank ;
         MPI_Comm_rank(CXios::globalComm,&globalRank);
-        
+
         for(it=splitted.begin();it!=splitted.end();it++)
         {
@@ -120,18 +124,18 @@
 	oasis_enddef() ;
       }
-      
-      int rank ;
+
+//      int rank;
       MPI_Comm_rank(intraComm,&rank) ;
       if (rank==0) isRoot=true;
-      else isRoot=false; 
-      eventLoop() ;
-      finalize() ;
+      else isRoot=false;
+//      eventLoop() ;
+//      finalize() ;
     }
-    
+
     void CServer::finalize(void)
     {
       CTimer::get("XIOS").suspend() ;
       if (!is_MPI_Initialized)
-      { 
+      {
         if (CXios::usingOasis) oasis_finalize();
         else MPI_Finalize() ;
@@ -141,9 +145,9 @@
       report(0)<<"Performance report : Ratio : "<<CTimer::get("Process events").getCumulatedTime()/CTimer::get("XIOS server").getCumulatedTime()*100.<<"%"<<endl  ;
     }
-    
+
      void CServer::eventLoop(void)
      {
        bool stop=false ;
-       
+
        CTimer::get("XIOS server").resume() ;
        while(!stop)
@@ -159,5 +163,5 @@
            if (!finished) listenRootFinalize() ;
          }
-       
+
          contextEventLoop() ;
          if (finished && contextList.empty()) stop=true ;
@@ -165,5 +169,5 @@
        CTimer::get("XIOS server").suspend() ;
      }
-     
+
      void CServer::listenFinalize(void)
      {
@@ -171,5 +175,5 @@
         int msg ;
         int flag ;
-        
+
         for(it=interComm.begin();it!=interComm.end();it++)
         {
@@ -186,5 +190,5 @@
             }
          }
-         
+
          if (interComm.empty())
          {
@@ -193,5 +197,5 @@
            MPI_Request* requests= new MPI_Request[size-1] ;
            MPI_Status* status= new MPI_Status[size-1] ;
-          
+
            for(int i=1;i<size;i++) MPI_Isend(&msg,1,MPI_INT,i,4,intraComm,&requests[i-1]) ;
            MPI_Waitall(size-1,requests,status) ;
@@ -202,6 +206,6 @@
          }
      }
-      
-     
+
+
      void CServer::listenRootFinalize()
      {
@@ -209,5 +213,5 @@
         MPI_Status status ;
         int msg ;
-        
+
         traceOff() ;
         MPI_Iprobe(0,4,intraComm, &flag, &status) ;
@@ -219,8 +223,8 @@
         }
       }
-      
+
      void CServer::listenContext(void)
      {
-       
+
        MPI_Status status ;
        int flag ;
@@ -230,5 +234,5 @@
        int rank ;
        int count ;
-       
+
        if (recept==false)
        {
@@ -236,5 +240,5 @@
          MPI_Iprobe(MPI_ANY_SOURCE,1,CXios::globalComm, &flag, &status) ;
          traceOn() ;
-         if (flag==true) 
+         if (flag==true)
          {
            rank=status.MPI_SOURCE ;
@@ -242,5 +246,5 @@
            buffer=new char[count] ;
            MPI_Irecv(buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ;
-           recept=true ;   
+           recept=true ;
          }
        }
@@ -256,16 +260,14 @@
            recvContextMessage(buffer,count) ;
            delete [] buffer ;
-           recept=false ;         
-         }
-       }
-     }
-     
+           recept=false ;
+         }
+       }
+     }
+
      void CServer::recvContextMessage(void* buff,int count)
      {
- 
-       
        static map<string,contextMessage> recvContextId ;
        map<string,contextMessage>::iterator it ;
-       
+
        CBufferIn buffer(buff,count) ;
        string id ;
@@ -274,23 +276,23 @@
 
        buffer>>id>>nbMessage>>clientLeader ;
-                       
+
        it=recvContextId.find(id) ;
        if (it==recvContextId.end())
-       {         
+       {
          contextMessage msg={0,0} ;
          pair<map<string,contextMessage>::iterator,bool> ret ;
          ret=recvContextId.insert(pair<string,contextMessage>(id,msg)) ;
          it=ret.first ;
-       }  
+       }
        it->second.nbRecv+=1 ;
        it->second.leaderRank+=clientLeader ;
-         
+
        if (it->second.nbRecv==nbMessage)
-       { 
+       {
          int size ;
          MPI_Comm_size(intraComm,&size) ;
          MPI_Request* requests= new MPI_Request[size-1] ;
          MPI_Status* status= new MPI_Status[size-1] ;
-         
+
          for(int i=1;i<size;i++)
          {
@@ -305,9 +307,9 @@
 
        }
-     }     
-     
+     }
+
      void CServer::listenRootContext(void)
      {
-       
+
        MPI_Status status ;
        int flag ;
@@ -318,5 +320,5 @@
        int count ;
        const int root=0 ;
-       
+
        if (recept==false)
        {
@@ -324,10 +326,10 @@
          MPI_Iprobe(root,2,intraComm, &flag, &status) ;
          traceOn() ;
-         if (flag==true) 
+         if (flag==true)
          {
            MPI_Get_count(&status,MPI_CHAR,&count) ;
            buffer=new char[count] ;
            MPI_Irecv(buffer,count,MPI_CHAR,root,2,intraComm,&request) ;
-           recept=true ;   
+           recept=true ;
          }
        }
@@ -340,14 +342,14 @@
            registerContext(buffer,count) ;
            delete [] buffer ;
-           recept=false ;         
-         }
-       }
-     } 
-     
-     
-     
+           recept=false ;
+         }
+       }
+     }
+
+
+
      void CServer::registerContext(void* buff,int count, int leaderRank)
      {
-     
+
        string contextId;
        CBufferIn buffer(buff,count) ;
@@ -356,25 +358,25 @@
        MPI_Comm contextIntercomm ;
        MPI_Intercomm_create(intraComm,0,CXios::globalComm,leaderRank,10+leaderRank,&contextIntercomm) ;
-       
+
        info(20)<<"CServer : Register new Context : "<<contextId<<endl  ;
        MPI_Comm inter ;
        MPI_Intercomm_merge(contextIntercomm,1,&inter) ;
        MPI_Barrier(inter) ;
-       if (contextList.find(contextId)!=contextList.end()) 
+       if (contextList.find(contextId)!=contextList.end())
         ERROR("void CServer::registerContext(void* buff,int count, int leaderRank)",
               <<"Context has already been registred") ;
-      
+
       CContext* context=CContext::create(contextId) ;
       contextList[contextId]=context ;
       context->initServer(intraComm,contextIntercomm) ;
-             
-     }    
-     
-     
+
+     }
+
+
      void CServer::contextEventLoop(void)
      {
        bool finished ;
        map<string,CContext*>::iterator it ;
-       for(it=contextList.begin();it!=contextList.end();it++) 
+       for(it=contextList.begin();it!=contextList.end();it++)
        {
          finished=it->second->eventLoop() ;
@@ -385,6 +387,42 @@
          }
        }
-         
-     }
-     
+
+     }
+
+     //! Get rank of the current process
+     int CServer::getRank()
+     {
+       return rank;
+     }
+
+     /*!
+      * \brief Open file stream to write in
+      *   Opening a file stream with a specific file name suffix-server+rank
+      * \param [in] protype file name
+     */
+     void CServer::openInfoStream(const StdString& fileName)
+     {
+       std::filebuf* fb = m_infoStream.rdbuf();
+       StdStringStream fileNameServer;
+       fileNameServer << fileName <<"_server_"<<getRank() << ".txt";
+       fb->open(fileNameServer.str().c_str(), std::ios::out);
+       if (!fb->is_open())
+       ERROR("void CServer::openInfoStream(const StdString& fileName)",
+            <<endl<< "Can not open <"<<fileNameServer<<"> file to write" );
+
+       info.write2File(fb);
+     }
+
+     //! Open stream for standard output
+     void CServer::openInfoStream()
+     {
+       info.write2StdOut();
+     }
+
+     //! Close opening stream
+     void CServer::closeInfoStream()
+     {
+       if (m_infoStream.is_open()) m_infoStream.close();
+     }
+
 }
Index: XIOS/trunk/src/server.hpp
===================================================================
--- XIOS/trunk/src/server.hpp	(revision 489)
+++ XIOS/trunk/src/server.hpp	(revision 490)
@@ -11,5 +11,5 @@
     {
        public:
-       
+
        static void initialize(void) ;
        static void finalize(void) ;
@@ -22,5 +22,5 @@
        static void listenRootFinalize(void) ;
        static void registerContext(void* buff,int count, int leaderRank=0) ;
-       
+
        static MPI_Comm intraComm ;
        static list<MPI_Comm> interComm ;
@@ -31,10 +31,27 @@
          int leaderRank ;
        } ;
-       
-      static bool isRoot ;
-      static int rank ;
-      static map<string,CContext*> contextList ;
-      static bool finished ;
-      static bool is_MPI_Initialized ;
+
+       static bool isRoot ;
+
+       static map<string,CContext*> contextList ;
+       static bool finished ;
+       static bool is_MPI_Initialized ;
+
+       public:
+         //! Get rank of the current process
+         static int getRank();
+
+        //! Print Information into a file
+        static void openInfoStream(const StdString& fileName);
+
+        //! Print information to standard output
+        static void openInfoStream();
+
+        //! Close Info stream (closing file)
+        static void closeInfoStream();
+
+       private:
+        static StdOFStream m_infoStream;
+        static int rank ;
     } ;
 }
Index: XIOS/trunk/src/xmlioserver_spl.hpp
===================================================================
--- XIOS/trunk/src/xmlioserver_spl.hpp	(revision 489)
+++ XIOS/trunk/src/xmlioserver_spl.hpp	(revision 490)
@@ -39,4 +39,5 @@
 typedef std::ostringstream StdOStringStream;
 typedef std::istringstream StdIStringStream;
+typedef std::stringstream  StdStringStream;
 typedef std::ofstream      StdOFStream;
 typedef std::ifstream      StdIFStream;
