mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
tests: nproc: ensure scheduler and OMP_NUM_THREADS are independent
* tests/nproc/nproc-quota-systemd.sh: Explicitly set OMP_NUM_THREADS to an ignorable value, to ensure scheduler processing is independent. * tests/nproc/nproc-quota.sh: Likewise for the SCHED_FIFO check. https://github.com/coreutils/coreutils/pull/290
This commit is contained in:
1 parent
c5d2f42c43
commit
5800d91721
2 files changed
+5
-2
No files matched your search
@@ -31,7 +31,10 @@ check_sched_quota()
|
||||
pct=$1; shift
|
||||
|
||||
if systemd-run --scope -q -p CPUQuota=$pct chrt $* true; then
|
||||
test $(systemd-run --scope -q -p CPUQuota=$pct chrt $* nproc) = $cpu ||
|
||||
test $(systemd-run --scope -q -p CPUQuota=$pct \
|
||||
chrt $* \
|
||||
env OMP_NUM_THREADS=0 \
|
||||
nproc) = $cpu ||
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
|
||||
@@ -116,7 +116,7 @@ test $(OMP_NUM_THREADS=$ncpus NPROC) -eq $ncpus || fail=1
|
||||
|
||||
echo '100000 100000' > $ROOT/sys/fs/cgroup/cpu.max &&
|
||||
echo 'policy : 1' > $ROOT/proc/self/sched && # No quota for SCHED_FIFO
|
||||
test $(NPROC) -eq $ncpus || fail=1
|
||||
test $(OMP_NUM_THREADS= NPROC) -eq $ncpus || fail=1
|
||||
echo 'policy : 2' > $ROOT/proc/self/sched && # No quota for SCHED_RR
|
||||
test $(NPROC) -eq $ncpus || fail=1
|
||||
echo 'policy : 6' > $ROOT/proc/self/sched && # No quota for SCHED_DEADLINE
|
||||
|
||||
Reference in new issue
Block a user