139 | | |
140 | | |
141 | | |
142 | | |
143 | | |
| 139 | == Description == |
| 140 | |
| 141 | This benchmark runs several SAXPY operations. SAXPY is a combination of scalar multiplication and vector addition (a common operation in computations with vector processors) and constitutes a level 1 operation in the Basic Linear Algebra Subprograms (BLAS) package. |
| 142 | |
| 143 | There are **7 implementations** of this benchmark. |
| 144 | |
| 145 | == Execution instructions == |
| 146 | |
| 147 | `./multisaxpy SIZE BLOCK_SIZE INTERATIONS` |
| 148 | |
| 149 | where: |
| 150 | * SIZE is the number of elements of the vectors used on the SAXPY operation. |
| 151 | * The SAXPY operation will be applied to the vector in blocks that contains BLOCK_SIZE elements. |
| 152 | * ITERATIONS is the number of times the SAXPY operation is executed. |
| 153 | |
| 154 | == Example output == |
| 155 | |
| 156 | {{{ |
| 157 | $ make clean |
| 158 | rm -f 01.multisaxpy_seq 02.multisaxpy_task_loop 03.multisaxpy_task 04.multisaxpy_task+dep 05.multisaxpy_task+weakdep 06.multisaxpy_task_loop+weakdep 07.multisaxpy_task+reduction |
| 159 | |
| 160 | $ make |
| 161 | mcxx --ompss-2 01.multisaxpy_seq.cpp main.cpp -o 01.multisaxpy_seq -lrt |
| 162 | mcxx --ompss-2 02.multisaxpy_task_loop.cpp main.cpp -o 02.multisaxpy_task_loop -lrt |
| 163 | mcxx --ompss-2 03.multisaxpy_task.cpp main.cpp -o 03.multisaxpy_task -lrt |
| 164 | 03.multisaxpy_task.cpp:3:13: info: adding task function 'axpy_task' for device 'smp' |
| 165 | 03.multisaxpy_task.cpp:12:3: info: call to task function '::axpy_task' |
| 166 | 03.multisaxpy_task.cpp:3:13: info: task function declared here |
| 167 | mcxx --ompss-2 04.multisaxpy_task+dep.cpp main.cpp -o 04.multisaxpy_task+dep -lrt |
| 168 | 04.multisaxpy_task+dep.cpp:3:13: info: adding task function 'axpy_task' for device 'smp' |
| 169 | 04.multisaxpy_task+dep.cpp:12:3: info: call to task function '::axpy_task' |
| 170 | 04.multisaxpy_task+dep.cpp:3:13: info: task function declared here |
| 171 | mcxx --ompss-2 05.multisaxpy_task+weakdep.cpp main.cpp -o 05.multisaxpy_task+weakdep -lrt |
| 172 | 05.multisaxpy_task+weakdep.cpp:3:13: info: adding task function 'axpy_task' for device 'smp' |
| 173 | 05.multisaxpy_task+weakdep.cpp:12:3: info: call to task function '::axpy_task' |
| 174 | 05.multisaxpy_task+weakdep.cpp:3:13: info: task function declared here |
| 175 | mcxx --ompss-2 06.multisaxpy_task_loop+weakdep.cpp main.cpp -o 06.multisaxpy_task_loop+weakdep -lrt |
| 176 | mcxx --ompss-2 07.multisaxpy_task+reduction.cpp main.cpp -o 07.multisaxpy_task+reduction -lrt |
| 177 | 07.multisaxpy_task+reduction.cpp:14:13: info: reduction of variable 'yy' of type 'double [elements]' solved to 'operator +' |
| 178 | <openmp-builtin-reductions>:1:1: info: reduction declared here |
| 179 | 07.multisaxpy_task+reduction.cpp:21:13: info: reduction of variable 'y' of type 'double [N]' solved to 'operator +' |
| 180 | <openmp-builtin-reductions>:1:1: info: reduction declared here |
| 181 | |
| 182 | $ make run |
| 183 | ./01.multisaxpy_seq 16777216 8192 100 |
| 184 | size: 16777216, bs: 8192, iterations: 100, time: 3.2982, performance: 0.508678 |
| 185 | NANOS6_SCHEDULER=fifo ./02.multisaxpy_task_loop 16777216 8192 100 |
| 186 | size: 16777216, bs: 8192, iterations: 100, time: 0.40835, performance: 4.10854 |
| 187 | ./03.multisaxpy_task 16777216 8192 100 |
| 188 | size: 16777216, bs: 8192, iterations: 100, time: 0.646697, performance: 2.59429 |
| 189 | ./04.multisaxpy_task+dep 16777216 8192 100 |
| 190 | size: 16777216, bs: 8192, iterations: 100, time: 1.00903, performance: 1.6627 |
| 191 | ./05.multisaxpy_task+weakdep 16777216 8192 100 |
| 192 | size: 16777216, bs: 8192, iterations: 100, time: 1.17464, performance: 1.42829 |
| 193 | NANOS6_SCHEDULER=fifo ./06.multisaxpy_task_loop+weakdep 16777216 8192 100 |
| 194 | size: 16777216, bs: 8192, iterations: 100, time: 3.81836, performance: 0.439382 |
| 195 | ./07.multisaxpy_task+reduction 16777216 8192 100 |
| 196 | size: 16777216, bs: 8192, iterations: 100, time: 4.26565, performance: 0.39331 |
| 197 | }}} |
| 198 | |
| 199 | == References == |
| 200 | |
| 201 | * [https://pm.bsc.es/gitlab/ompss-2/examples/multisaxpy] |
| 202 | * [https://pm.bsc.es/ftp/ompss-2/doc/examples/local/sphinx/03-fundamentals.html] |
| 203 | * [http://en.wikipedia.org/wiki/AXPY] |
| 204 | |