/*!
    In case of attached mode, the current context must be reset to context for client
    \param [in] event Event sent to server
    */
    void CContextClient::sendEvent(CEventClient& event)
    {
      list<int> ranks = event.getRanks();

      if (!event.isEmpty())
      {
        list<int> sizes = event.getSizes();

        // We force the getBuffers call to be non-blocking on the servers
        list<CBufferOut*> buffList;
        bool couldBuffer = getBuffers(ranks, sizes, buffList, !CXios::isClient);

        if (couldBuffer)
        {
          event.send(timeLine, sizes, buffList);

          checkBuffers(ranks);

          if (isAttachedModeEnabled()) // couldBuffer is always true in attached mode
          {
            waitEvent(ranks);
            CContext::setCurrent(context->getId());
          }
        }
        else
        {
          tmpBufferedEvent.ranks = ranks;
          tmpBufferedEvent.sizes = sizes;

          for (list<int>::const_iterator it = sizes.begin(); it != sizes.end(); it++)
            tmpBufferedEvent.buffers.push_back(new CBufferOut(*it));

          event.send(timeLine, tmpBufferedEvent.sizes, tmpBufferedEvent.buffers);
        }
      }

      timeLine++;
    }