title: Display a MPI typemap
body: <p>The <code>type map</code> is an important but confounding concept in MPI.  I would like a routine to display or print a type map for me. </p>
  
  <p>For example (taken from the MPI-3 standard),</p>
  
  <pre><code> MPI_TYPE_CREATE_RESIZED(MPI_INT, -3, 9, type1) 
  </code></pre>
  
  <p>results in the typemap </p>
  
  <pre><code>{(lb_marker, -3), (int, 0), (ub_marker, 6)}.
  </code></pre>
  
  <p>Use that type again:</p>
  
  <pre><code>MPI_TYPE_CONTIGUOUS(2, type1, type2) 
  </code></pre>
  
  <p>and the typemap is </p>
  
  <pre><code>{(lb_marker, -3), (int, 0), (int,9), (ub_marker, 15)}
  </code></pre>
  
  <p>I would like a way to display that typemap automatically. </p>
  
  <p>Certainly one could use <code>MPI_Type_get_contents</code> and <code>MPI_Type_get_envelope</code> and recursively descend until hitting the built-in types.  This is rather a giant pain and I would have thought 20 years on some tool would exist to do this for me. </p>
  
  <p>Some tools that are promising, but not quite working:</p>
  
  <ul>
  <li><p>I had found MPImap from ~ 2001 <a href="http://computation.llnl.gov/casc/mpimap/" rel="noreferrer">here</a>.  First, it needs to be updated for modern Tcl/TK, patched to address some memory errors and after you do that; you get an unresponsive GUI.  Instead, I'm looking for a library/routine I can call at run time. </p></li>
  <li><p><code>MPIDU_Datatype_deubg</code> is an MPICH specific internal type-dumping routine.  It does not display the type map (it does display the dataloop representation, again close)</p></li>
  <li><p>There once was a debugger called XMPI that lists among its features the ability to display a MPI type map.  This debugger appears to be LAM-MPI specific and does not make use of get_contents/ get_envelope.</p></li>
  </ul>