title: C, openMPI: What is the best way to distribute blocks of data from each process to all other processes?
body: <p>in my mpi program each process has or works with a block of data:</p>
  
  <pre><code>char *datablock;
  </code></pre>
  
  <p>the blocks are of <strong>similar</strong> but <strong>not identical</strong> size.</p>
  
  <p>What is the best way (which functions to use and how) to distribute those blocks from each process to each other process?
  In the end i want each process to have (maybe) an array of all blocks:</p>
  
  <pre><code>char **blockarray;
  </code></pre>
  
  <p>so that</p>
  
  <pre><code>*blockarray[i] // for i in [0... number_of_processes-1]
  </code></pre>
  
  <p>is the former block of the ith process.
  BUT it is not the order that matters, "i" does not have to be the process id and the order can differ on each process (if this is faster)!
  I just want the fastest way to get each block on each thread.</p>