aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/lib
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2023-05-15 20:00:07 +0200
committerThomas Schwinge <thomas@codesourcery.com>2023-06-02 09:51:15 +0200
commit04abe1944d30eb18a2060cfcd9695d085f7b4752 (patch)
tree486155250ba19bb4f69f0270179e39a8d05cc46f /libgomp/testsuite/lib
parent49153588abc4eb8ba6a16b9cb9ff65a47f8e0fdb (diff)
downloadgcc-04abe1944d30eb18a2060cfcd9695d085f7b4752.zip
gcc-04abe1944d30eb18a2060cfcd9695d085f7b4752.tar.gz
gcc-04abe1944d30eb18a2060cfcd9695d085f7b4752.tar.bz2
Support parallel testing in libgomp: fallback Perl 'flock' [PR66005]
Follow-up to commit 6c3b30ef9e0578509bdaf59c13da4a212fe6c2ba "Support parallel testing in libgomp, part II [PR66005]" ("..., and enable if 'flock' is available for serializing execution testing"), where we saw: > On my Dell Precision 7530 laptop: > > $ uname -srvi > Linux 5.15.0-71-generic #78-Ubuntu SMP Tue Apr 18 09:00:29 UTC 2023 x86_64 > $ grep '^model name' < /proc/cpuinfo | uniq -c > 12 model name : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz > $ nvidia-smi -L > GPU 0: Quadro P1000 (UUID: GPU-e043973b-b52a-d02b-c066-a8fdbf64e8ea) > > ... [...]: case (c) standard configuration, no offloading > configured, [...] > $ \time make check-target-libgomp > > Case (c), baseline; [...]: > > 1180.98user 110.80system 19:36.40elapsed 109%CPU (0avgtext+0avgdata 505148maxresident)k > 1133.22user 111.08system 19:35.75elapsed 105%CPU (0avgtext+0avgdata 505212maxresident)k > > Case (c), parallelized [using 'flock']: > > [...] > -j12 GCC_TEST_PARALLEL_SLOTS=12 > 2591.04user 192.64system 4:44.98elapsed 976%CPU (0avgtext+0avgdata 505216maxresident)k > 2581.23user 195.21system 4:47.51elapsed 965%CPU (0avgtext+0avgdata 505212maxresident)k Quite the same when instead of 'flock' using this fallback Perl 'flock': 2565.23user 194.35system 4:46.77elapsed 962%CPU (0avgtext+0avgdata 505216maxresident)k 2549.38user 200.20system 4:46.08elapsed 961%CPU (0avgtext+0avgdata 505216maxresident)k PR testsuite/66005 gcc/ * doc/install.texi: Document (optional) Perl usage for parallel testing of libgomp. libgomp/ * testsuite/lib/libgomp.exp: 'flock' through stdout. * testsuite/flock: New. * configure.ac (FLOCK): Point to that if no 'flock' available, but 'perl' is. * configure: Regenerate.
Diffstat (limited to 'libgomp/testsuite/lib')
-rw-r--r--libgomp/testsuite/lib/libgomp.exp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index 3ad5503..2f9e538 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -338,12 +338,14 @@ if ![info exists ::env(GCC_RUNTEST_PARALLELIZE_DIR)] {
rename libgomp_load standard_libgomp_load
proc libgomp_load { program args } {
# ... in order to serialize execution testing via an exclusive lock.
+ # We use stdout, as per <https://perldoc.perl.org/functions/flock>
+ # "[...] FILEHANDLE [...] be open with write intent to use LOCK_EX".
set lock_file ../lock
set lock_kind --exclusive
set lock_fd [open $lock_file a+]
set lock_clock_begin [clock seconds]
global FLOCK
- exec $FLOCK $lock_kind 0 <@ $lock_fd
+ exec $FLOCK $lock_kind 1 >@ $lock_fd
set lock_clock_end [clock seconds]
verbose -log "Got ${FLOCK}('$lock_file', '$lock_kind') at [clock format $lock_clock_end] after [expr $lock_clock_end - $lock_clock_begin] s" 2