puzzlef/sum-openmp-adjust-schedule: Comparing various schedules for OpenMP-based vector element sum
Authors/Creators
Description
Comparing various schedules for OpenMP-based vector element sum.
In this experiment, we summed together all values of a floating-point vector x, with number of elements from 1E+6 to 1E+9 using OpenMP. Each element count was attempted with various OpenMP schedule configs, running each config 5 times to get a good time measure. Sum here represents any reduce() operation that processes several values to a single value. Results indicate a schedule-kind of auto/guided to be suitable.
All outputs are saved in a gist and a small part of the output is listed here. Some charts are also included below, generated from sheets. This experiment was done with guidance from Prof. Kishore Kothapalli and Prof. Dip Sankar Banerjee.
<br>
$ g++ -std=c++17 -O3 -fopenmp main.cxx
$ ./a.out
# OMP_NUM_THREADS=12
# # Elements 1e+06
# [00001.687 ms] [1.644725] sumSeq
# [00003.840 ms] [1.644881] sumOmp {sch_kind: static, chunk_size: 1}
# [00001.138 ms] [1.644891] sumOmp {sch_kind: static, chunk_size: 2}
# [00000.523 ms] [1.644898] sumOmp {sch_kind: static, chunk_size: 4}
# ...
#
# ...
# [00162.374 ms] [1.644725] sumOmp {sch_kind: auto, chunk_size: 16384}
# [00178.243 ms] [1.644725] sumOmp {sch_kind: auto, chunk_size: 32768}
# [00162.962 ms] [1.644725] sumOmp {sch_kind: auto, chunk_size: 65536}
<br> <br>
References- What's the difference between "static" and "dynamic" schedule in OpenMP?
- OpenMP Dynamic vs Guided Scheduling
<br> <br>
Files
puzzlef/sum-openmp-adjust-schedule-1.0.0.zip
Files
(36.3 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:3c02da258b81944925c4f716f04c500d
|
36.3 kB | Preview Download |
Additional details
Related works
- Is supplement to
- https://github.com/puzzlef/sum-openmp-adjust-schedule/tree/1.0.0 (URL)