Replies: 3 comments 4 replies
-
I've benchmarked different schedulers with different slice sizes on my desktop machine (1000 particles, 1000 turns). There's no significant difference. It would be interesting to repeat these calculations on a bigger machine.
#!/usr/bin/env bash
rm -f results
for n in $(seq 1 $(nproc)); do
for sc in auto runtime dynamic "dynamic, 1" "dynamic, 10" "dynamic, 50" \
guided "guided, 1" "guided, 10" "guided, 50" \
static "static, 1" "static, 10" "static, 50"; do
echo "Threads: $n; scheduler: $sc" | tee --append results
OMP_NUM_THREADS="$n" OMP_SCHEDULE="$sc" octave --eval 'bootstrap;trackMultipleParticles' >> results
done
done
sed -i '/\/at\//d' results
sed -i -Ez 's/\n[0-9a-z, ]+?, +(with|without) +[0-9a-z, ]+?: +([0-9.]+)[0-9a-z, ]+?/; \1: \2/g' results
echo 'threads,without,with,scheduler,slices' > data.csv
sed -E 's/^[Tt]hreads: +([0-9]+); +scheduler: +([0-9a-zA-Z, ]+); +without: +([0-9.]+); +with: +([0-9.]+)/\1,\3,\4,\2/g' results | sed 's/ //g' >> data.csv
#!/usr/bin/env python3
import pandas as pd
import pylab as plt
data = pd.read_csv('data.csv', delimiter=',')
data.slices.unique()
for rad, radname in [('with', 'With longitudinal motion'),
('without', 'Without longitudinal motion')]:
plt.figure(figsize=(7, 5), dpi=200)
for scheduler in data.scheduler.unique():
d = data[data.scheduler == scheduler]
plt.scatter(d.threads, d[rad], label=scheduler)
plt.legend()
plt.grid()
plt.title(radname)
plt.xlabel("Threads")
plt.ylabel("Time, [s]")
plt.savefig(f"{rad}.png")
plt.close() |
Beta Was this translation helpful? Give feedback.
-
Thanks for this interesting test, I'll try here! We introduce a new parameter controlled with the existing Then
Pros:
Cons:
Additionally, if could be interesting to know in Matlab if OpenMP is active or not, for instance through another read-only |
Beta Was this translation helpful? Give feedback.
-
The control of the number of threads is implemented in #226 and #230 |
Beta Was this translation helpful? Give feedback.
-
The behaviour of OpenMP, if activated, is fully controlled by the defaults values. Should more control be available ?
Beta Was this translation helpful? Give feedback.
All reactions