206 lines
16 KiB
HTML
Executable File
206 lines
16 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
|
<title>MPI On Cell (Documentation): Buffer-Management</title>
|
|
<link href="../../doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="../../tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.5.6 -->
|
|
<div class="navigation" id="top">
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="../../main.html"><span>Main Page</span></a></li>
|
|
<li><a href="../../modules.html"><span>Modules</span></a></li>
|
|
<li><a href="../../annotated.html"><span>Data Structures</span></a></li>
|
|
<li><a href="../../files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>Buffer-Management<br>
|
|
<small>
|
|
[<a class="el" href="../../d2/dd7/group__internal__p2p__buffered.html">Buffered Communication</a>]</small>
|
|
</h1>
|
|
<p>
|
|
<div class="dynheader">
|
|
Collaboration diagram for Buffer-Management:</div>
|
|
<div class="dynsection">
|
|
<center><table><tr><td><img src="../../d3/dd3/group__internal__p2p__bmalloc.png" border="0" alt="" usemap="#dc/dff/d3_2dd3_2group____internal____p2p____bmalloc_map">
|
|
<map name="dc/dff/d3_2dd3_2group____internal____p2p____bmalloc_map">
|
|
<area shape="rect" href="../../d2/dd7/group__internal__p2p__buffered.html" title="Internals about blocking buffered Communication." alt="" coords="5,5,168,32"></map></td></tr></table></center>
|
|
</div>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
This section shows how the buffer used for buffered communication is managed.
|
|
<p>
|
|
Information about already allocated buffer-space is stored in the status-array.<p>
|
|
But this information has no order which forces us everytime we want to allocate buffer-space to create an ordered list of already allocated buffer-space. To avoid this we have additionally an ordered linked-list. This list orders the indexes (== message-IDs) of the status-array-entries in ascending order of the memory-addresses. This enables fast searching for free buffer-space.<p>
|
|
Allocated buffer-space is cleared by the receiving process by setting the appropriate flag in the status-array-entry. This is done by a DMA-Transfer and so no collaboration of the sending-process is needed. During the next allocation of buffer-space nodes with disabled buffer-flags are freed.
|
|
<p>
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/dc0/structmoc__internal__buffer__node__struct.html">moc_internal_buffer_node_struct</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Node of linked list holding information about allocated buffer-space. <a href="../../dd/dc0/structmoc__internal__buffer__node__struct.html#_details">More...</a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef struct <br>
|
|
<a class="el" href="../../dd/dc0/structmoc__internal__buffer__node__struct.html">moc_internal_buffer_node_struct</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/dd3/group__internal__p2p__bmalloc.html#g5335affab6973b22635d8a5616e8bdbc">moc_internal_buffer_node_t</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Node of linked list holding information about allocated buffer-space. <a href="#g5335affab6973b22635d8a5616e8bdbc"></a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">uint64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/dd3/group__internal__p2p__bmalloc.html#g5295b372d853993b2e6cfb6912a0ee41">IMOC_bmalloc</a> (uint32_t size, uint8_t mid)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocate buffer-space. <a href="#g5295b372d853993b2e6cfb6912a0ee41"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="../../dd/dc0/structmoc__internal__buffer__node__struct.html">moc_internal_buffer_node_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/dd3/group__internal__p2p__bmalloc.html#gad8750c7ba3d6da9c137c2c462d2c531">__attribute__</a> ((always_inline))</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">void bmalloc_print_nodes() { if (!bmalloc_first_node) printf("No nodes in list\n"); else { int z = 0; moc_internal_buffer_node_t* t; for (t = bmalloc_first_node; t != 0; t = t->next_node) { printf( "Node %i: offset %u - size %u - valid %i - mid %u\n", z, node_handle.status_array_base[ t->mid ].buffer_offset, node_handle.status_array_base[ t->mid ].message_size, node_handle.status_array_base[ t->mid ].flags.bits.buffer_used, t->mid ); z++; } } } <a href="#gad8750c7ba3d6da9c137c2c462d2c531"></a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="../../dd/dc0/structmoc__internal__buffer__node__struct.html">moc_internal_buffer_node_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/dd3/group__internal__p2p__bmalloc.html#gaf9be7d34fe367a9244d50dde82777ed">bmalloc_first_node</a> = 0</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Pointer to first entry of linked-list. <a href="#gaf9be7d34fe367a9244d50dde82777ed"></a><br></td></tr>
|
|
</table>
|
|
<hr><h2>Typedef Documentation</h2>
|
|
<a class="anchor" name="g5335affab6973b22635d8a5616e8bdbc"></a><!-- doxytag: member="imoc.h::moc_internal_buffer_node_t" ref="g5335affab6973b22635d8a5616e8bdbc" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef struct <a class="el" href="../../dd/dc0/structmoc__internal__buffer__node__struct.html">moc_internal_buffer_node_struct</a> <a class="el" href="../../dd/dc0/structmoc__internal__buffer__node__struct.html">moc_internal_buffer_node_t</a> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Node of linked list holding information about allocated buffer-space.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Function Documentation</h2>
|
|
<a class="anchor" name="gad8750c7ba3d6da9c137c2c462d2c531"></a><!-- doxytag: member="imoc_buffer_malloc.c::__attribute__" ref="gad8750c7ba3d6da9c137c2c462d2c531" args="((always_inline))" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="../../dd/dc0/structmoc__internal__buffer__node__struct.html">moc_internal_buffer_node_t</a>* __attribute__ </td>
|
|
<td>(</td>
|
|
<td class="paramtype">(always_inline) </td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
void bmalloc_print_nodes() { if (!bmalloc_first_node) printf("No nodes in list\n"); else { int z = 0; moc_internal_buffer_node_t* t; for (t = bmalloc_first_node; t != 0; t = t->next_node) { printf( "Node %i: offset %u - size %u - valid %i - mid %u\n", z, node_handle.status_array_base[ t->mid ].buffer_offset, node_handle.status_array_base[ t->mid ].message_size, node_handle.status_array_base[ t->mid ].flags.bits.buffer_used, t->mid ); z++; } } }
|
|
<p>
|
|
Returns the next node holding valid buffer-information coming after node start.<p>
|
|
During the search all invalid nodes the function stumbles across are freed and the links are corrected.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>start</em> </td><td><b>in</b> start-node of search (NULL means beginning of list) </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>next valid node </dd></dl>
|
|
|
|
<p>Definition at line <a class="el" href="../../d7/d1f/imoc__buffer__malloc_8c-source.html#l00056">56</a> of file <a class="el" href="../../d7/d1f/imoc__buffer__malloc_8c-source.html">imoc_buffer_malloc.c</a>.</p>
|
|
|
|
<p>References <a class="el" href="../../dd/df5/structmoc__message__status__struct.html#c0bdc214525521d58f12c72874de0512">moc_message_status_struct::bits</a>, <a class="el" href="../../dd/df5/structmoc__message__status__struct.html#086c0d449d25774d43512b6f7fdab8ed">moc_message_status_struct::flags</a>, <a class="el" href="../../d4/d9b/imoc_8h-source.html#l00184">moc_internal_buffer_node_struct::mid</a>, <a class="el" href="../../d4/d9b/imoc_8h-source.html#l00182">moc_internal_buffer_node_struct::next_node</a>, <a class="el" href="../../db/d45/imoc__core__ppu_8h-source.html#l00052">node_handle</a>, and <a class="el" href="../../db/d45/imoc__core__ppu_8h-source.html#l00036">moc_node_handle_ppu_struct::status_array_base</a>.</p>
|
|
|
|
<p>Referenced by <a class="el" href="../../d7/df2/imoc__dma-get__ppu_8c-source.html#l00009">IMOC_get_data()</a>, <a class="el" href="../../dc/d5d/moc__barrier__ppu_8c-source.html#l00011">MOC_Barrier()</a>, <a class="el" href="../../d2/db6/moc__bsend__ppu_8c-source.html#l00010">MOC_Bsend()</a>, <a class="el" href="../../df/df8/moc__issend__ppu_8c-source.html#l00010">MOC_ISsend()</a>, <a class="el" href="../../d8/dbc/moc__recv__ppu_8c-source.html#l00011">MOC_Recv()</a>, and <a class="el" href="../../d4/db6/moc__ssend__ppu_8c-source.html#l00010">MOC_Ssend()</a>.</p>
|
|
|
|
<p>
|
|
<div class="dynheader">
|
|
Here is the caller graph for this function:</div>
|
|
<div class="dynsection">
|
|
<p><center><img src="../../d3/dd3/group__internal__p2p__bmalloc_gad8750c7ba3d6da9c137c2c462d2c531_icgraph.png" border="0" usemap="#d3/dd3/group__internal__p2p__bmalloc_gad8750c7ba3d6da9c137c2c462d2c531_icgraph_map" alt=""></center>
|
|
<map name="d3/dd3/group__internal__p2p__bmalloc_gad8750c7ba3d6da9c137c2c462d2c531_icgraph_map">
|
|
<area shape="rect" href="../../d2/de2/group__internal__p2p__dma.html#g53d36c567e4c98e5d258a7857096e7ab" title="Internal wrapper-function for a blocking DMA-get operation." alt="" coords="149,5,261,32"><area shape="rect" href="../../d0/d64/group__p2p__main.html#g30c532510cffd36acd1b9b0b3edb3832" title="Performs a blocking standard mode receive operation." alt="" coords="323,56,408,83"><area shape="rect" href="../../db/dc2/group__broadcast.html#g110b00d5a4d9f970ddf8e9bd4c2d8834" title="Blocks the caller until all processes in the communicator have called it; that is..." alt="" coords="157,107,253,133"><area shape="rect" href="../../de/d84/group__p2p__buffered.html#g307bf844e1416c7c021e4a3468209d0b" title="Performs a blocking buffered mode send operation." alt="" coords="157,157,253,184"><area shape="rect" href="../../d7/d62/group__p2p__imm.html#gc148ff9b9bee69164139425a7df53697" title="Performs a non-blocking synchronous mode send operation." alt="" coords="156,208,255,235"><area shape="rect" href="../../d5/dc2/group__p2p__synch.html#g46cb2ff2b5a0601165978598932d6120" title="Performs a blocking synchronous mode send operation." alt="" coords="157,259,253,285"><area shape="rect" href="../../d9/d16/group__dma__access.html#g3716465d42f20379bbf65002ecd9e448" title="Wrapper-function for a blocking DMA-get operation." alt="" coords="309,5,421,32"></map>
|
|
</div>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="g5295b372d853993b2e6cfb6912a0ee41"></a><!-- doxytag: member="imoc.h::IMOC_bmalloc" ref="g5295b372d853993b2e6cfb6912a0ee41" args="(uint32_t size, uint8_t mid)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">uint64_t IMOC_bmalloc </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint32_t </td>
|
|
<td class="paramname"> <em>size</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"> <em>mid</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Allocate buffer-space.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>size</em> </td><td><b>in</b> size of buffer-space </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>mid</em> </td><td><b>in</b> corresponding message-ID </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>effective address of allocated buffer-space (16-byte aligned) </dd></dl>
|
|
|
|
<p>Definition at line <a class="el" href="../../d7/d1f/imoc__buffer__malloc_8c-source.html#l00085">85</a> of file <a class="el" href="../../d7/d1f/imoc__buffer__malloc_8c-source.html">imoc_buffer_malloc.c</a>.</p>
|
|
|
|
<p>References <a class="el" href="../../dd/df5/structmoc__message__status__struct.html#c0bdc214525521d58f12c72874de0512">moc_message_status_struct::bits</a>, <a class="el" href="../../db/d45/imoc__core__ppu_8h-source.html#l00037">moc_node_handle_ppu_struct::buffer_base</a>, <a class="el" href="../../d6/d2c/imoc__core_8h-source.html#l00127">moc_message_status_struct::buffer_offset</a>, <a class="el" href="../../db/d45/imoc__core__ppu_8h-source.html#l00038">moc_node_handle_ppu_struct::buffer_size</a>, <a class="el" href="../../dd/df5/structmoc__message__status__struct.html#086c0d449d25774d43512b6f7fdab8ed">moc_message_status_struct::flags</a>, <a class="el" href="../../d6/d2c/imoc__core_8h-source.html#l00128">moc_message_status_struct::message_size</a>, <a class="el" href="../../d4/d9b/imoc_8h-source.html#l00184">moc_internal_buffer_node_struct::mid</a>, <a class="el" href="../../d4/d9b/imoc_8h-source.html#l00182">moc_internal_buffer_node_struct::next_node</a>, <a class="el" href="../../db/d45/imoc__core__ppu_8h-source.html#l00052">node_handle</a>, and <a class="el" href="../../db/d45/imoc__core__ppu_8h-source.html#l00036">moc_node_handle_ppu_struct::status_array_base</a>.</p>
|
|
|
|
<p>Referenced by <a class="el" href="../../d2/db6/moc__bsend__ppu_8c-source.html#l00010">MOC_Bsend()</a>.</p>
|
|
|
|
<p>
|
|
<div class="dynheader">
|
|
Here is the caller graph for this function:</div>
|
|
<div class="dynsection">
|
|
<p><center><img src="../../d3/dd3/group__internal__p2p__bmalloc_g5295b372d853993b2e6cfb6912a0ee41_icgraph.png" border="0" usemap="#d3/dd3/group__internal__p2p__bmalloc_g5295b372d853993b2e6cfb6912a0ee41_icgraph_map" alt=""></center>
|
|
<map name="d3/dd3/group__internal__p2p__bmalloc_g5295b372d853993b2e6cfb6912a0ee41_icgraph_map">
|
|
<area shape="rect" href="../../de/d84/group__p2p__buffered.html#g307bf844e1416c7c021e4a3468209d0b" title="Performs a blocking buffered mode send operation." alt="" coords="160,5,256,32"></map>
|
|
</div>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Variable Documentation</h2>
|
|
<a class="anchor" name="gaf9be7d34fe367a9244d50dde82777ed"></a><!-- doxytag: member="imoc_buffer_malloc.c::bmalloc_first_node" ref="gaf9be7d34fe367a9244d50dde82777ed" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="../../dd/dc0/structmoc__internal__buffer__node__struct.html">moc_internal_buffer_node_t</a>* <a class="el" href="../../d3/dd3/group__internal__p2p__bmalloc.html#gaf9be7d34fe367a9244d50dde82777ed">bmalloc_first_node</a> = 0 </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Pointer to first entry of linked-list.
|
|
<p>
|
|
|
|
<p>Definition at line <a class="el" href="../../d7/d1f/imoc__buffer__malloc_8c-source.html#l00020">20</a> of file <a class="el" href="../../d7/d1f/imoc__buffer__malloc_8c-source.html">imoc_buffer_malloc.c</a>.</p>
|
|
|
|
<p>Referenced by <a class="el" href="../../d1/d67/moc__finalize__ppu_8c-source.html#l00011">MOC_Finalize()</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
</div>
|
|
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Feb 12 13:51:16 2009 for MPI On Cell (Documentation) by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="../../doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
|
|
</body>
|
|
</html>
|