title: Sending dynamic arrays in MPI, C++
body: <p>My task is to measure time of communication betweeen two processes.
  I want to send 4,8,...,1000,...., 10000 bytes of data and measure time it takes to send and receive back the message.
  So i figured out that i will send an array of shorts.</p>
  
  <p>When i send array initialised like that:</p>
  
  <pre><code>mpi::communicator world;
  short message[100000];
  ....
  world.send(1,0, message);
  </code></pre>
  
  <p>time seems to be ok, and I can see a time difference between message[100000] and [1000]</p>
  
  <p>But I want to allocate array dynamically like that:</p>
  
  <pre><code>short *message = new short[100000];
  ...
  world.send(1,0, *message);
  </code></pre>
  
  <p>It seems like the second send is always sending the same amount of data no matter what size the array will be.</p>
  
  <p>So my question is, how to send a dynamically allocated array?</p>