00001 00002 00003 /** 00004 * \page restrictions Restrictions of the Cell-Architecture 00005 * 00006 * \par 00007 * \section res_arch CBE Architecture 00008 * 00009 * There are some restriction caused by the CBE architecture. Programming a SPU can be 00010 * compared to programming a microcontroller: 00011 * \li \b Small \b local-store \b of \b SPUs: Only 256 KByte of local-store are available 00012 * on a SPU which is moreover shared by data and instructions. Because of this a economic 00013 * stewardship of available resources is needed. 00014 * \li \b No \b underlying \b OS: The operation system is running on the PPU, but not on 00015 * the SPUs. Although the OS also manages the SPUs, there are some things which 00016 * are missing or have to be done in a very performance decreasing and complex way. 00017 * E.g. there is no support for several threads on one SPU (unless you program it yourself) 00018 * and most of the system-calls are delegated to the PPU. 00019 * \li \b Limited \b I/O-Capabilities: File-operations are only possible on the PPU. So if you 00020 * want to store data of an SPU into a file, you have to send it to the PPU who then stores 00021 * the data into a file. Main-memory is managed by the PPU and the SPUs can only read 00022 * from or write into the main-memory. Allocation of main-memory has to be done by the PPU. 00023 * 00024 * 00025 * \par 00026 * \section res_alignment Memory-Alignment 00027 * 00028 * All Buffers used in send- or receive-functions have to be aligned at a 16-byte boundary 00029 * (for better performance a 128-byte alignment is recommended). This restriction cannot be 00030 * circumvented. 00031 * 00032 * 00033 * \par 00034 * \section res_size Transfer-Size 00035 * 00036 * DMA-calls only transfer data in chunks of 16 bytes. Send-receive operations and 00037 * DMA-get-operations provided by this library hide this restriction by the use of intermediate 00038 * buffers. But you should keep this restriction in mind because to gain maximum performance 00039 * the size of data to be transfered should be a multiple of 16 bytes. 00040 * 00041 * 00042 * 00043 **/ 00044 00045 00046 /** 00047 * \page violations Violations of the MPI-Standard 00048 * 00049 * \par 00050 * \section viol_prefix Prefix of functions: 00051 * 00052 * The prefix of functions and data-structures is not 'MPI_' as stated by the MPI-standard. 00053 * Instead it is 'MOC_' to allow the usage of another MPI-Library (e.g. to connect several 00054 * playstations) and to stress that this implementation is not fully conform with the 00055 * MPI-standard. 00056 * 00057 * 00058 * \par 00059 * \section viol_startup Application Startup 00060 * 00061 * MPI-applications (Version 1.3) are started using mpiexec/mpirun and normally only one 00062 * binary is executed on all MPI-nodes. Because PPU- and SPU-instructions aren't compatible 00063 * at least two executables (and two compilers) are needed. Also SPU-threads have to be initialized 00064 * and started by the PPU. Because of this the SPU-binaries are embedded into the PPU-binary 00065 * and started by this PPU-binary during runtime. 00066 * In this library this concept is also used. So you have to program at least one PPU- and one 00067 * SPU-program, embed the SPU-program into the PPU-executable and add the SPU-program-handle to 00068 * the MOC-environment (see \ref MOC_Add_spu_thread) during runtime before calling MOC_Init. 00069 * 00070 * 00071 * \par 00072 * \section viol_queue Order of received messages: 00073 * 00074 * Because of the internal design of this implementation the order of 00075 * incoming messages cannot be preserved in all cases. Currently the 00076 * correct order is only preserved from messages from the same source, 00077 * with the same message-tag and same communicator. 00078 * 00079 * 00080 * \par 00081 * \section viol_tag Number of usable message-tag 00082 * 00083 * According to the MPI-standard there should be at least 32767 tags available. But to save 00084 * memory we use only one byte to encode the message-tag. So there are only 256 usable 00085 * message-tags. Message-tags greater than 249 are reserved for internal purposes. 00086 * 00087 * 00088 * \par 00089 * \section viol_nr_pending Number of simultaneous pending send-receive operations 00090 * 00091 * According to the MPI-standard there should be hardly any limitations in the number of 00092 * possible simultaneous transfers. It is stated that only in pathological cases the maximum 00093 * of possible outstanding transfers should be reached. Because the resources of an SPU are 00094 * very limited our implementation has a tight limit of possible simultaneous transfers. 00095 * Although the upper-limit can be changed using \ref MOC_Set_queue_size, it is limited by 00096 * the 256 KByte of local-storage of a SPU. 00097 * There is also a limit of the number of simultaneous DMA-calls, because for each DMA-operation 00098 * an exclusive DMA-tag is used and there are only 32 DMA-tag (on the PPU only 15) available. 00099 * 00100 * \par 00101 * \section viol_init MPI_Init: 00102 * 00103 * The parameters of the init-function for the SPU does not match the parameters 00104 * defined by the MPI-standard (see \ref moc_init_spu "MOC_Init (SPU)") 00105 * 00106 * 00107 **/ 00108 00109 00110 /** 00111 * \page performance Performance Measurements 00112 * 00113 * The measurements were taken on a Playstation 3 running Yellow Dog Linux release 6.0 00114 * using Cell SDK 3.1. To measure send-receive operations ping-pongs were used and to 00115 * measure DMA-calls the time till the used DMA-tag is marked to have no pending calls 00116 * is used. The stated latencies in the pictures above are one-way latencies. 00117 * 00118 * \section perf_send_recv Send-Receive performance 00119 * 00120 * The following two figures show latency and bandwidth achieved by our implementation. 00121 * The theoretical maximum bandwidth is 25 GByte/s and synchronous send between SPUs is 00122 * at a close range to this limit if the data-size is large enough. There is also a big 00123 * difference between SPU-SPU and SPU-PPU operations. The reason for this is the fact that 00124 * the PPU cannot handle DMA-operations itself but only remote-control the SPU's 00125 * Memory Flow Controller. And as you will see later the main-memory performance of the PPU 00126 * is much lower than that of the SPUs. Because we use ping-pongs there is no way to 00127 * determine differences in sending from or to the PPU, but other measurements indicate 00128 * such differences. 00129 * 00130 * \image html latency-kb.png 00131 * 00132 * \image html bandwidth-kb.png 00133 * 00134 * The following figure shows the latency of send-receive operations at a lower scale than 00135 * the first figure. If you look at the latency of synchronous send operations then you can 00136 * see that there is a big start-up latency and only a very small data-size dependend latency. 00137 * So there's only a very small time-difference between sending 10 byte and 1 Kbyte, but there 00138 * is naturally a difference in throughput. 00139 * 00140 * \image html latency-b.png 00141 * 00142 * \section perf_moc_vs_dma Send-Recv vs. DMA performance 00143 * 00144 * The following two figures demonstrate the difference in performance of send-recv operations 00145 * and DMA-calls. The performance of DMA-calls reaches it's peak much earlier than send-recv 00146 * and the peak-value is higher than that of send-recv even though the difference is not much. 00147 * So DMA is a lot faster than send-recv especially for small messages, but for big messages 00148 * the difference is much lower. It seems that it is always better to use DMA, but keep in mind 00149 * that in practical applications calculation time easily exceeds communication time. 00150 * 00151 * \image html dma-vs-moc-lat.png 00152 * 00153 * \image html dma-vs-moc-bw.png 00154 * 00155 * \section perf_spu_vs_ppu SPU- vs PPU-initiated transfer 00156 * 00157 * The following figure shows the difference between SPU- and PPU-initiated DMA-calls. 00158 * As you can see the highest performance can be achieved by using SPU-SPU DMA-calls. There 00159 * is also hardly any difference between put and get operations. DMA-operations between SPU and 00160 * main-memory achieves lower performance and there is a difference between put and get 00161 * operations. PPU to SPU DMA calls have the lowest performance with small transfer sizes, but 00162 * if the transfer-size is big enough they are faster than SPU-main-memory transfers. 00163 * The lowest performance has a memcopy on the PPU, which also explains the bad performance of 00164 * buffered send between SPU and PPU. 00165 * 00166 * \image html spu-ppu-dma-bw-kb.png 00167 * 00168 * \section perf_mem DMA vs. memcpy 00169 * 00170 * The official Cell documentation states that it is also possible to use 00171 * memcpy to transfer data from the PPU to a SPU. However one should use 00172 * DMA, because it is always faster. 00173 * If you look at the following figure, this is not always true. If the 00174 * data-size is small enough memcpy is faster. 00175 * 00176 * \image html ppu-transfer-bw-b.png 00177 * 00178 **/ 00179 00180 00181 00182 /** 00183 * \page conclusion Summary & Conclusions 00184 * 00185 * \details MPI wasn't designed for the Cell Broadband Engine. A common MPI-node has one or more 00186 * normal CPUs and several GBytes of RAM. The Cell Broadband Engine features a normal CPU 00187 * (the PPU) and several special processing units with only a very limited amount 00188 * of memory. The SPUs support only one thread per SPU and a complex handling of system-calls 00189 * is needed. Because of this there are several restrictions in implementing MPI on the Cell 00190 * Broadband Engine. 00191 * 00192 * Nevertheless MPI on Cell makes sense. It greatly simlifies programming on the Cell Broadband 00193 * Engine, features a public API which is well known and widely used and message passing operations 00194 * are generally easier to use than DMA (DMA needs memory-addresses and explicit synchronization, 00195 * whereas MPI only needs the ranks of participating processes and features implicit 00196 * synchronization). 00197 * 00198 * But message parsing operations cannot replace DMA. Both methods of communication have their 00199 * advantages and disadvantages and they complement one another. So this library additionally 00200 * features some easy to use DMA operations, if someone wants to gain maximum performance. Using 00201 * DMA alltogether with send-recv especially speeds up application with a lot of communication 00202 * going on between SPUs and PPU. 00203 **/ 00204
1.5.6