Files
MPIonCell/documentation/developer/html/d5/d4e/moc__isend_8c-source.html
T
2017-10-26 19:57:24 +02:00

77 lines
9.4 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): src/noarch/communication/moc_isend.c Source File</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&nbsp;Page</span></a></li>
<li><a href="../../modules.html"><span>Modules</span></a></li>
<li><a href="../../annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li class="current"><a href="../../files.html"><span>Files</span></a></li>
</ul>
</div>
<h1>src/noarch/communication/moc_isend.c</h1><a href="../../d3/dc2/moc__isend_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00003"></a>00003
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;<a class="code" href="../../d0/d3a/spu_2moc_8h.html">moc.h</a>&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;<a class="code" href="../../d9/db3/imoc_8h.html">internal/imoc.h</a>&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#ifdef __SPU__</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span><span class="preprocessor">#include &lt;<a class="code" href="../../d0/d1d/moc__datatype__spu_8h.html">spu/moc_datatype_spu.h</a>&gt;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;<a class="code" href="../../d9/d00/imoc__core__spu_8h.html">internal/spu/imoc_core_spu.h</a>&gt;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &lt;<a class="code" href="../../d4/dce/imoc__dma__spu_8h.html">internal/spu/imoc_dma_spu.h</a>&gt;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;<a class="code" href="../../d2/d42/imoc__macros_8h.html">internal/imoc_macros.h</a>&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#else</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#include &lt;<a class="code" href="../../d8/de2/moc__datatype__ppu_8h.html">ppu/moc_datatype_ppu.h</a>&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;<a class="code" href="../../d6/d09/imoc__core__ppu_8h.html">internal/ppu/imoc_core_ppu.h</a>&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;<a class="code" href="../../de/df9/imoc__dma__ppu_8h.html">internal/ppu/imoc_dma_ppu.h</a>&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;<a class="code" href="../../d8/d98/imoc__macros__ppu_8h.html">internal/ppu/imoc_macros_ppu.h</a>&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#endif</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a><a class="code" href="../../d7/d62/group__p2p__imm.html#gd88773e68570adfad9f99159c69502af">00018</a> <span class="keywordtype">int</span> <a class="code" href="../../d7/d62/group__p2p__imm.html#gd88773e68570adfad9f99159c69502af" title="Performs a non-blocking standard mode send operation.">MOC_ISend</a>(<span class="keywordtype">void</span>* buf, <span class="keywordtype">int</span> count, <a class="code" href="../../dc/d6e/group__p2p__datatype.html#gb4e45f15c08578bd3fc97c0cca2a509a" title="Typedef defining MOC_Datatype.">MOC_Datatype</a> datatype, <span class="keywordtype">int</span> dest, <span class="keywordtype">int</span> tag,
<a name="l00019"></a>00019 <a class="code" href="../../d1/dd1/group__comm__mgt.html#g3d2b8a9af65bff5f79d02bda13616767" title="Communicator-Handle.">MOC_Comm</a> comm, <a class="code" href="../../db/d17/structmoc__request__struct.html" title="Communication-Request (Handle).">MOC_Request</a> *request)
<a name="l00020"></a>00020 {
<a name="l00021"></a>00021 <span class="keywordtype">int</span> bytecount;
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="keywordflow">if</span> (((datatype &amp; 0xF0) &gt;&gt; 4) == 0)
<a name="l00024"></a>00024 bytecount = count;
<a name="l00025"></a>00025 <span class="keywordflow">else</span>
<a name="l00026"></a>00026 bytecount = count * (((datatype &amp; 0xF0) &gt;&gt; 4) * 2);
<a name="l00027"></a>00027 <span class="comment"></span>
<a name="l00028"></a>00028 <span class="comment"> /** byte-count &lt;= 4096 ==&gt; buffered send **/</span>
<a name="l00029"></a>00029 <span class="keywordflow">if</span> (bytecount &lt;= <a class="code" href="../../d0/d64/group__p2p__main.html#g1efd7c092411ed106006e6a75a1de78b" title="Indicates, at which message-size MOC_Send switches to synchronous send.">MOC_SEND_TRESHOLD</a>)
<a name="l00030"></a>00030 {
<a name="l00031"></a>00031 uint32_t err = <a class="code" href="../../de/d84/group__p2p__buffered.html#g307bf844e1416c7c021e4a3468209d0b" title="Performs a blocking buffered mode send operation.">MOC_Bsend</a>(buf, count, datatype, dest, tag, comm);
<a name="l00032"></a>00032 <span class="keywordflow">if</span> (!err)
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034 request-&gt;<a class="code" href="../../db/d17/structmoc__request__struct.html#56ab14d3df6e8c232e66aec78be949f3">request_type</a> = <a class="code" href="../../d7/d41/group__internal__p2p__imm.html#g755884e41591a0d838f45b04f3a92ab9" title="MOC_Request is associated with aISsend-Communication.">MOC_REQ_TYPE_ISSEND</a>;
<a name="l00035"></a>00035 request-&gt;<a class="code" href="../../db/d17/structmoc__request__struct.html#4878ce199375f8a411520c887f908a4f">request_data</a>.<a class="code" href="../../db/d17/structmoc__request__struct.html#47db330291fdf4864201fe106ec53db8">issend_request</a>.<a class="code" href="../../d9/d89/structimoc__issend__request__struct.html#db3150d28936af45c475ec5c9fb65cd8">isFinished</a> = 1;
<a name="l00036"></a>00036 request-&gt;<a class="code" href="../../db/d17/structmoc__request__struct.html#4878ce199375f8a411520c887f908a4f">request_data</a>.<a class="code" href="../../db/d17/structmoc__request__struct.html#47db330291fdf4864201fe106ec53db8">issend_request</a>.<a class="code" href="../../d9/d89/structimoc__issend__request__struct.html#2cfe5aa07e2fc69eff15e0e65da4efea">source</a> = <a class="code" href="../../dd/df8/group__internal__core.html#geed5a271d50368d3cf9a858c4f57c895" title="Information each node knowns about himself and the world.">node_handle</a>.<a class="code" href="../../d8/d93/structmoc__node__handle__ppu__struct.html#9005ee3d6d0ee8b2f15628dcca724710" title="rank of node">rank</a>;
<a name="l00037"></a>00037 request-&gt;<a class="code" href="../../db/d17/structmoc__request__struct.html#4878ce199375f8a411520c887f908a4f">request_data</a>.<a class="code" href="../../db/d17/structmoc__request__struct.html#47db330291fdf4864201fe106ec53db8">issend_request</a>.<a class="code" href="../../d9/d89/structimoc__issend__request__struct.html#526dc209a5b20ff98169e0803812fbb1">tag</a> = tag;
<a name="l00038"></a>00038 request-&gt;<a class="code" href="../../db/d17/structmoc__request__struct.html#4878ce199375f8a411520c887f908a4f">request_data</a>.<a class="code" href="../../db/d17/structmoc__request__struct.html#47db330291fdf4864201fe106ec53db8">issend_request</a>.<a class="code" href="../../d9/d89/structimoc__issend__request__struct.html#942c10dc3d21a8830d7714a4018cd42b">message_size</a> = bytecount;
<a name="l00039"></a>00039 }
<a name="l00040"></a>00040 <span class="keywordflow">else</span>
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042 request-&gt;<a class="code" href="../../db/d17/structmoc__request__struct.html#4878ce199375f8a411520c887f908a4f">request_data</a>.<a class="code" href="../../db/d17/structmoc__request__struct.html#47db330291fdf4864201fe106ec53db8">issend_request</a>.<a class="code" href="../../d9/d89/structimoc__issend__request__struct.html#db3150d28936af45c475ec5c9fb65cd8">isFinished</a> = 1;
<a name="l00043"></a>00043 <span class="keywordflow">return</span> err;
<a name="l00044"></a>00044 }
<a name="l00045"></a>00045 }<span class="comment"></span>
<a name="l00046"></a>00046 <span class="comment"> /** other ==&gt; true non-blocking send **/</span>
<a name="l00047"></a>00047 <span class="keywordflow">else</span>
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 <span class="keywordflow">return</span> <a class="code" href="../../d7/d62/group__p2p__imm.html#gc148ff9b9bee69164139425a7df53697" title="Performs a non-blocking synchronous mode send operation.">MOC_ISsend</a>(buf, count, datatype, dest, tag, comm, request);
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="keywordflow">return</span> 0;
<a name="l00053"></a>00053 }
<a name="l00054"></a>00054
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Feb 12 13:49:47 2009 for MPI On Cell (Documentation) by&nbsp;
<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>