| 262 | == Override the Number of Threads Used == |
| 263 | |
| 264 | Let's have a closer look at the third implementation ''03.multisaxpy_task'' which took 0.648536 seconds to finish using 48 threads. |
| 265 | |
| 266 | A full CM node features 48 threads (0-47) divided in two sockets: 0-11,24-35 for the first socket and 12-23,36-47 for the second socket. **Notice that they are indeed not consecutive! ** |
| 267 | |
| 268 | We can change the threads used by !OmpSs-2 with the Linux command `taskset`. For example, the command to run this binary with 24 threads interleaved between the two sockets would be: |
| 269 | |
| 270 | `taskset -c 0-23 ./03.multisaxpy_task 16777216 8192 100` |
| 271 | |
| 272 | Similarly, to run this benchmark using all the 24 threads of the second socket use the following command: |
| 273 | |
| 274 | `taskset -c 12-23,36-47 ./03.multisaxpy_task 16777216 8192 100` |
| 275 | |
| 276 | You can also try to run this example with only 12 threads of the first socket: |
| 277 | |
| 278 | `taskset -c 0-11 ./03.multisaxpy_task 16777216 8192 100` |
| 279 | |
| 280 | or 12 threads interleaved between the two sockets: |
| 281 | |
| 282 | `taskset -c 0-5,12-17 ./03.multisaxpy_task 16777216 8192 100` |
| 283 | |
| 284 | Changing the number of threads assigned to !OmpSs-2 affects the performance of the application: |
| 285 | {{{ |
| 286 | $ ./03.multisaxpy_task 16777216 8192 100 |
| 287 | size: 16777216, bs: 8192, iterations: 100, time: 0.653537, performance: 2.56714 |
| 288 | $ taskset -c 0-23 ./03.multisaxpy_task 16777216 8192 100 |
| 289 | size: 16777216, bs: 8192, iterations: 100, time: 0.686265, performance: 2.44471 |
| 290 | $ taskset -c 12-23,36-47 ./03.multisaxpy_task 16777216 8192 100 |
| 291 | size: 16777216, bs: 8192, iterations: 100, time: 0.650363, performance: 2.57967 |
| 292 | $ taskset -c 0-11 ./03.multisaxpy_task 16777216 8192 100 |
| 293 | size: 16777216, bs: 8192, iterations: 100, time: 0.55417, performance: 3.02745 |
| 294 | $ taskset -c 0-5,12-17 ./03.multisaxpy_task 16777216 8192 100 |
| 295 | size: 16777216, bs: 8192, iterations: 100, time: 0.705859, performance: 2.37685 |
| 296 | }}} |
| 297 | |
| 298 | |
| 299 | |