Files
MPIonCell/documentation/developer/html/dd/dcb/moc__init__ppu_8c-source.html
T
2017-10-26 19:57:24 +02:00

149 lines
35 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/ppu/system/moc_init_ppu.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/ppu/system/moc_init_ppu.c</h1><a href="../../d9/d04/moc__init__ppu_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;malloc_align.h&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &lt;free_align.h&gt;</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00005"></a>00005
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;<a class="code" href="../../db/dae/ppu_2moc_8h.html">moc.h</a>&gt;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;<a class="code" href="../../db/dae/ppu_2moc_8h.html">ppu/moc.h</a>&gt;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;<a class="code" href="../../d9/db3/imoc_8h.html">internal/imoc.h</a>&gt;</span>
<a name="l00009"></a>00009 <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="l00010"></a>00010
<a name="l00011"></a><a class="code" href="../../d9/d04/moc__init__ppu_8c.html#9f5e3249bff688ab3258c8c5bfc7d61b">00011</a> <span class="keywordtype">int</span> <a class="code" href="../../d8/d9a/group__environment__startup.html#g9a59090c9d03e89f019e8276d4013c72" title="Initialize the MPI execution environment.">MOC_Init</a>(<span class="keywordtype">int</span> *argc <a class="code" href="../../d3/dd3/group__internal__p2p__bmalloc.html#gad8750c7ba3d6da9c137c2c462d2c531" title="void bmalloc_print_nodes() { if (!bmalloc_first_node) printf(&amp;quot;No nodes in list\n&amp;quot;);...">__attribute__</a>((unused)), <span class="keywordtype">char</span> ***argv <a class="code" href="../../d3/dd3/group__internal__p2p__bmalloc.html#gad8750c7ba3d6da9c137c2c462d2c531" title="void bmalloc_print_nodes() { if (!bmalloc_first_node) printf(&amp;quot;No nodes in list\n&amp;quot;);...">__attribute__</a>((unused)) )
<a name="l00012"></a>00012 {
<a name="l00013"></a>00013 <span class="keywordtype">int</span> i;
<a name="l00014"></a>00014 <span class="keywordtype">char</span> temp[16];
<a name="l00015"></a>00015 uint32_t temp2[1];
<a name="l00016"></a>00016 <span class="comment">/* create own node-handle and data-structures */</span>
<a name="l00017"></a>00017 <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> = 0;
<a name="l00018"></a>00018 <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#3779cc1bda02c45a880389b109173778" title="number of overall processes">comm_size</a> = <a class="code" href="../../dc/df1/group__internal__spu__thread.html#g6cf68c0afe2da7b3a29ecaab8ed45961" title="actual number of SPU-Threads.">moc_spu_thread_count</a> + 1;
<a name="l00019"></a>00019 <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#ee1aa72cd99190cf97523a955cfa6141" title="Size of a message-queue.">queue_size</a> = <a class="code" href="../../dc/df1/group__internal__spu__thread.html#g2af87be0fa5a8b93ac563c819047328a" title="init message-queue size">moc_spu_queue_size</a>;
<a name="l00020"></a>00020 <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#58ca7dd0e2874d0317038dbb0c279b82" title="base-address of own message-queues">message_queue_base</a> = _malloc_align(
<a name="l00021"></a>00021 <span class="keyword">sizeof</span>(<a class="code" href="../../df/dd4/structmoc__message__envelope__struct.html" title="Message-envelope structure.">moc_message_envelope_t</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#3779cc1bda02c45a880389b109173778" title="number of overall processes">comm_size</a> - 1)
<a name="l00022"></a>00022 * <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#ee1aa72cd99190cf97523a955cfa6141" title="Size of a message-queue.">queue_size</a>, 4);
<a name="l00023"></a>00023 <span class="keywordflow">if</span> (<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#58ca7dd0e2874d0317038dbb0c279b82" title="base-address of own message-queues">message_queue_base</a> == 0)
<a name="l00024"></a>00024 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#gfd59894aba31d32eeff506d8df838089" title="Insufficient Memory.">MOC_ERR_NO_MEMORY</a>;
<a name="l00025"></a>00025 <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#abccbc7beefa7b1e2ccc84b8bd2b8805" title="base-address of own message-status-array">status_array_base</a> = _malloc_align(<span class="keyword">sizeof</span>(<a class="code" href="../../dd/df5/structmoc__message__status__struct.html" title="Message-status structure.">moc_message_status_t</a>)
<a name="l00026"></a>00026 * (<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#3779cc1bda02c45a880389b109173778" title="number of overall processes">comm_size</a> - 1) * <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#ee1aa72cd99190cf97523a955cfa6141" title="Size of a message-queue.">queue_size</a>, 4);
<a name="l00027"></a>00027 <span class="keywordflow">if</span> (<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#abccbc7beefa7b1e2ccc84b8bd2b8805" title="base-address of own message-status-array">status_array_base</a> == 0)
<a name="l00028"></a>00028 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#gfd59894aba31d32eeff506d8df838089" title="Insufficient Memory.">MOC_ERR_NO_MEMORY</a>;
<a name="l00029"></a>00029 <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#ee118aad604058291438923545af37db" title="base-address of own buffer">buffer_base</a> = _malloc_align(<a class="code" href="../../dc/df1/group__internal__spu__thread.html#g8ad19e80234fb6b4d73684e47e007106" title="init buffer size">moc_spu_buffer_size</a>, 4);
<a name="l00030"></a>00030 <span class="keywordflow">if</span> (<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#ee118aad604058291438923545af37db" title="base-address of own buffer">buffer_base</a> == 0)
<a name="l00031"></a>00031 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#gfd59894aba31d32eeff506d8df838089" title="Insufficient Memory.">MOC_ERR_NO_MEMORY</a>;
<a name="l00032"></a>00032 <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#90096c2a63d01f0251fdd6c642601f45" title="size of own buffer">buffer_size</a> = <a class="code" href="../../dc/df1/group__internal__spu__thread.html#g8ad19e80234fb6b4d73684e47e007106" title="init buffer size">moc_spu_buffer_size</a>;
<a name="l00033"></a>00033 <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#3d13ba21e187a05cb548b6b3ae39ffe7" title="address of own signal-area">signal_area</a> = _malloc_align(16, 4);
<a name="l00034"></a>00034 <span class="keywordflow">if</span> (<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#3d13ba21e187a05cb548b6b3ae39ffe7" title="address of own signal-area">signal_area</a> == 0)
<a name="l00035"></a>00035 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#gfd59894aba31d32eeff506d8df838089" title="Insufficient Memory.">MOC_ERR_NO_MEMORY</a>;
<a name="l00036"></a>00036 <span class="comment">/* create prozess list*/</span>
<a name="l00037"></a>00037 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a> = _malloc_align(<span class="keyword">sizeof</span>(<a class="code" href="../../d0/db8/structmoc__process__struct.html" title="Process-information structure.">moc_process_t</a>)
<a name="l00038"></a>00038 * <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#3779cc1bda02c45a880389b109173778" title="number of overall processes">comm_size</a>, 7);
<a name="l00039"></a>00039 <span class="keywordflow">if</span> (<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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a> == 0)
<a name="l00040"></a>00040 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#gfd59894aba31d32eeff506d8df838089" title="Insufficient Memory.">MOC_ERR_NO_MEMORY</a>;
<a name="l00041"></a>00041 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[0].<a class="code" href="../../d0/db8/structmoc__process__struct.html#9fa234bed220e0a3daa5b110a036e72e" title="Process-type (SPU or PPU).">type</a> = <a class="code" href="../../dd/df8/group__internal__core.html#ge8939a6190d1b74b2526d480e434894d" title="Constant for moc_process_struct.type.">MOC_PPU_PROCESS</a>;
<a name="l00042"></a>00042 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[0].<a class="code" href="../../d0/db8/structmoc__process__struct.html#9aefc9d4ee29f7c0ca1dff18cb41713c" title="effective base-address of message-queues">inbox_queue_base</a>
<a name="l00043"></a>00043 = (uint64_t) <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#58ca7dd0e2874d0317038dbb0c279b82" title="base-address of own message-queues">message_queue_base</a>;
<a name="l00044"></a>00044 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[0].<a class="code" href="../../d0/db8/structmoc__process__struct.html#6331f5f40bddc0b08409a3599af9b8c8" title="effective base-address of message-status-array">stat_array_base</a>
<a name="l00045"></a>00045 = (uint64_t) <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#abccbc7beefa7b1e2ccc84b8bd2b8805" title="base-address of own message-status-array">status_array_base</a>;
<a name="l00046"></a>00046 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[0].<a class="code" href="../../d0/db8/structmoc__process__struct.html#a8eea33631234dc3eccf859a3d3de40e" title="effective base-address of problem-state (Signals, mailboxes, .">ps_base</a>
<a name="l00047"></a>00047 = (uint64_t) <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#3d13ba21e187a05cb548b6b3ae39ffe7" title="address of own signal-area">signal_area</a>;
<a name="l00048"></a>00048 <a class="code" href="../../dc/df1/group__internal__spu__thread.html#gf4270da4dbf663fde50a876067ed0d52" title="actual number of PPU-Threads.">moc_ppu_thread_count</a> = 1;
<a name="l00049"></a>00049 <span class="comment">/* start SPU-Threads */</span>
<a name="l00050"></a>00050 for (i = 0; i &lt; <a class="code" href="../../dc/df1/group__internal__spu__thread.html#g6cf68c0afe2da7b3a29ecaab8ed45961" title="actual number of SPU-Threads.">moc_spu_thread_count</a>; i++)
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052 <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].<a class="code" href="../../d1/d8b/structmoc__spu__thread__struct.html#603a62c8b05bb561c467e34acbcff2b5" title="Pointer to environment information.">envp</a> = NULL;
<a name="l00053"></a>00053 <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].<a class="code" href="../../d1/d8b/structmoc__spu__thread__struct.html#610f1390167566df9b451401c0bb8667" title="rank of SPU-thread">rank</a> = i + <a class="code" href="../../dc/df1/group__internal__spu__thread.html#gf4270da4dbf663fde50a876067ed0d52" title="actual number of PPU-Threads.">moc_ppu_thread_count</a>;
<a name="l00054"></a>00054 <span class="comment">/* start pthread */</span>
<a name="l00055"></a>00055 <span class="keywordflow">if</span> (pthread_create(&amp;<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].pthread, NULL,
<a name="l00056"></a>00056 &amp;<a class="code" href="../../dc/df1/group__internal__spu__thread.html#g669046500ec44affc79468b12ddaaf92" title="PThread-function for creating SPU-Threads.">moc_spe_pthread_func</a>, &amp;<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i]) != 0)
<a name="l00057"></a>00057 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00058"></a>00058 <span class="comment">/* create buffer-space for thread */</span>
<a name="l00059"></a>00059 <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].<a class="code" href="../../d1/d8b/structmoc__spu__thread__struct.html#a65e6d8f5252b43a69951b57305ebcbf" title="base-address of the SPU-Thread&amp;#39;s buffer">buffer_base</a> = _malloc_align(<a class="code" href="../../dc/df1/group__internal__spu__thread.html#g8ad19e80234fb6b4d73684e47e007106" title="init buffer size">moc_spu_buffer_size</a>,
<a name="l00060"></a>00060 4);
<a name="l00061"></a>00061 <span class="keywordflow">if</span> (<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].buffer_base == 0)
<a name="l00062"></a>00062 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#gfd59894aba31d32eeff506d8df838089" title="Insufficient Memory.">MOC_ERR_NO_MEMORY</a>;
<a name="l00063"></a>00063 <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].<a class="code" href="../../d1/d8b/structmoc__spu__thread__struct.html#67de0b34d22a702f8d06c0c26e01cc46" title="size of the SPU-Thread&amp;#39;s buffer">buffer_size</a> = <a class="code" href="../../dc/df1/group__internal__spu__thread.html#g8ad19e80234fb6b4d73684e47e007106" title="init buffer size">moc_spu_buffer_size</a>;
<a name="l00064"></a>00064 <span class="comment">/* prefill entry of prozess-list */</span>
<a name="l00065"></a>00065 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[i + moc_ppu_thread_count].<a class="code" href="../../d0/db8/structmoc__process__struct.html#9fa234bed220e0a3daa5b110a036e72e" title="Process-type (SPU or PPU).">type</a>
<a name="l00066"></a>00066 = <a class="code" href="../../dd/df8/group__internal__core.html#gde1178e17b18360542f46e09a4f3fce0" title="Constant for moc_process_struct.type.">MOC_SPU_PROCESS</a>;
<a name="l00067"></a>00067 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[i + moc_ppu_thread_count].<a class="code" href="../../d0/db8/structmoc__process__struct.html#a8eea33631234dc3eccf859a3d3de40e" title="effective base-address of problem-state (Signals, mailboxes, .">ps_base</a>
<a name="l00068"></a>00068 = (uint64_t) spe_ps_area_get(<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].speid,
<a name="l00069"></a>00069 SPE_MSSYNC_AREA);
<a name="l00070"></a>00070 <span class="keywordflow">if</span> (<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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[i + moc_ppu_thread_count].<a class="code" href="../../d0/db8/structmoc__process__struct.html#a8eea33631234dc3eccf859a3d3de40e" title="effective base-address of problem-state (Signals, mailboxes, .">ps_base</a> == 0)
<a name="l00071"></a>00071 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00072"></a>00072 <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].<a class="code" href="../../d1/d8b/structmoc__spu__thread__struct.html#a1af310737612cbf58480cbb172e33c4" title="Effective Basis-Address of SPU&amp;#39;s local-storage.">ls_base</a> = (uint64_t) spe_ls_area_get(
<a name="l00073"></a>00073 <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].speid);
<a name="l00074"></a>00074 <span class="keywordflow">if</span> (<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].ls_base == 0)
<a name="l00075"></a>00075 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00076"></a>00076 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[i + moc_ppu_thread_count].<a class="code" href="../../d0/db8/structmoc__process__struct.html#9aefc9d4ee29f7c0ca1dff18cb41713c" title="effective base-address of message-queues">inbox_queue_base</a>
<a name="l00077"></a>00077 = (uint64_t) <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].ls_base;
<a name="l00078"></a>00078 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[i + moc_ppu_thread_count].<a class="code" href="../../d0/db8/structmoc__process__struct.html#6331f5f40bddc0b08409a3599af9b8c8" title="effective base-address of message-status-array">stat_array_base</a>
<a name="l00079"></a>00079 = (uint64_t) <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].ls_base;
<a name="l00080"></a>00080
<a name="l00081"></a>00081 <span class="comment">/* send rank, overall prozess-count, queue-size, buffer_size</span>
<a name="l00082"></a>00082 <span class="comment"> * and memory-adress of buffer to SPU via mailbox */</span>
<a name="l00083"></a>00083 temp[0] = i + moc_ppu_thread_count;
<a name="l00084"></a>00084 temp[1] = <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#3779cc1bda02c45a880389b109173778" title="number of overall processes">comm_size</a>;
<a name="l00085"></a>00085 temp[2] = <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#ee1aa72cd99190cf97523a955cfa6141" title="Size of a message-queue.">queue_size</a>;
<a name="l00086"></a>00086 *((uint32_t*) &amp;temp[4]) = <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].<a class="code" href="../../d1/d8b/structmoc__spu__thread__struct.html#67de0b34d22a702f8d06c0c26e01cc46" title="size of the SPU-Thread&amp;#39;s buffer">buffer_size</a>;
<a name="l00087"></a>00087 *((uint64_t*) &amp;temp[8]) = (uint64_t) <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].buffer_base;
<a name="l00088"></a>00088 <span class="keywordflow">if</span> (spe_in_mbox_write(<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].speid, (uint32_t*) temp,
<a name="l00089"></a>00089 4, SPE_MBOX_ALL_BLOCKING) != 4)
<a name="l00090"></a>00090 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00091"></a>00091 <span class="comment">/* send SPU-thread's local-store base-address to SPU */</span>
<a name="l00092"></a>00092 *((uint64_t*) temp) = (uint64_t) spe_ls_area_get(
<a name="l00093"></a>00093 <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].speid);
<a name="l00094"></a>00094 <span class="keywordflow">if</span> (spe_in_mbox_write(<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].speid, (uint32_t*) temp,
<a name="l00095"></a>00095 2, SPE_MBOX_ALL_BLOCKING) != 2)
<a name="l00096"></a>00096 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00097"></a>00097 <span class="comment">/* wait till incoming mailbox-message from SPU */</span>
<a name="l00098"></a>00098 <span class="keywordflow">while</span> (spe_out_mbox_status(<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].speid) &lt; 1)
<a name="l00099"></a>00099 ;
<a name="l00100"></a>00100 <span class="keywordflow">if</span> (spe_out_mbox_read(<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].speid, temp2, 1) != 1)
<a name="l00101"></a>00101 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00102"></a>00102 <span class="comment">/* write base addresses of SPU's message-queues into prozess-list */</span>
<a name="l00103"></a>00103 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[i + moc_ppu_thread_count].<a class="code" href="../../d0/db8/structmoc__process__struct.html#9aefc9d4ee29f7c0ca1dff18cb41713c" title="effective base-address of message-queues">inbox_queue_base</a>
<a name="l00104"></a>00104 += temp2[0];
<a name="l00105"></a>00105 <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].<a class="code" href="../../d1/d8b/structmoc__spu__thread__struct.html#0813ce58844b7a7d6df0341e5e1c1b17" title="Address of message-queue in SPU&amp;#39;s local-storage.">queue_base_in_ls</a> = temp2[0];
<a name="l00106"></a>00106 <span class="comment">/* wait till incoming mailbox-message from SPU */</span>
<a name="l00107"></a>00107 <span class="keywordflow">while</span> (spe_out_mbox_status(<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].speid) &lt; 1)
<a name="l00108"></a>00108 ;
<a name="l00109"></a>00109 <span class="keywordflow">if</span> (spe_out_mbox_read(<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].speid, temp2, 1) != 1)
<a name="l00110"></a>00110 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00111"></a>00111 <span class="comment">/* write base addresses of SPU's status-array into prozess-list */</span>
<a name="l00112"></a>00112 <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>[i + moc_ppu_thread_count].<a class="code" href="../../d0/db8/structmoc__process__struct.html#6331f5f40bddc0b08409a3599af9b8c8" title="effective base-address of message-status-array">stat_array_base</a>
<a name="l00113"></a>00113 += temp2[0];
<a name="l00114"></a>00114 <a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].<a class="code" href="../../d1/d8b/structmoc__spu__thread__struct.html#93433bc21fa8fc6b7f65251a5cf33eb1" title="Address of status-array in SPU&amp;#39;s local-storage.">status_base_in_ls</a> = temp2[0];
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116 <span class="comment">/* send memory address of prozess list to all SPU-processes */</span>
<a name="l00117"></a>00117 <span class="keywordflow">for</span> (i = 0; i &lt; moc_spu_thread_count; i++)
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119 *((uint64_t*) temp2) = (uint64_t) <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#528d5743c1b49553cc9b812a211afa53" title="list of all other MOC-processes (index is rank of process)">moc_process_list</a>;
<a name="l00120"></a>00120 if (spe_in_mbox_write(<a class="code" href="../../dc/df1/group__internal__spu__thread.html#ga5b74732b1e31ec1674ea0e5ae465c4e" title="array of SPU-Threads.">moc_spu_thread_list</a>[i].speid, temp2, 2,
<a name="l00121"></a>00121 SPE_MBOX_ALL_BLOCKING) != 2)
<a name="l00122"></a>00122 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 <span class="keywordflow">return</span> 0;
<a name="l00125"></a>00125 }
<a name="l00126"></a>00126
</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>