From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 417D0385734A; Fri, 9 Sep 2022 14:55:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 417D0385734A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662735322; bh=IDwd4j7d/diYxnKDnLcpew9JkqDpfmI/yB4HOmMeP5I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=P1CWCaZM9QQzvdmZjNWcDUJGcTTdN8M7ALHzbRqig1nG0MnQ8JxG9ysfDXAMcZXyt uiwtvpj26RsDjfikGL3Dz+C7yYeY8E+i5nayHLVIx+nLVXRST/YVd1HbG58MXsJc6o 8x5505Al5fZcYP6vqu3k2S3eGlRb3wWQzbWM7Y2E= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/106894] [13 regression] multiple libgomp failures after r13-2545-g9f2fca56593a2b Date: Fri, 09 Sep 2022 14:55:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgomp X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106894 --- Comment #5 from Jakub Jelinek --- Ah, sorry about icv-6.c, I did debug just one of the testcases and after fi= xing it tested all the mentioned tests and all passed, so thought it is fixed. I can now reproduce it though. The thing is, make check or make check RUNTESTFLAGS=3D"c.exp=3D'icv-6.c' c++.exp=3D'icv-6.c'" in libgomp obj dir work fine, but make -j32 -k check RUNTESTFLAGS=3D"c.exp=3D'icv-6.c' c++.exp=3D'icv-6.c'" fails. The thing is that the testcase as written relies on OMP_NUM_THREADS not bei= ng set in environment (as it takes priority over OMP_NUM_THREADS_ALL for the host). So, if either a user has OMP_NUM_THREADS=3D42 in the environment by himself= , or when doing make check with -jN, we trigger: if test $$num_cpus -gt 8 && test -z "$$OMP_NUM_THREADS"; then \ OMP_NUM_THREADS=3D8; export OMP_NUM_THREADS; \ echo @@@ libgomp OMP_NUM_THREADS adjusted to 8 because of paral= lel make check and too many CPUs; \ fi; \ in libgomp/testsuite/Makefile.am and so the test fails. So, I think we need something like: --- libgomp/testsuite/libgomp.c-c++-common/icv-6.c.jj 2022-09-08 20:22:07.903182970 +0200 +++ libgomp/testsuite/libgomp.c-c++-common/icv-6.c 2022-09-09 16:49:29.442195701 +0200 @@ -17,6 +17,7 @@ #include #include +#include int main () @@ -25,21 +26,28 @@ main () int chunk_size; omp_get_schedule(&kind, &chunk_size); - if (omp_get_max_teams () !=3D 42 - || !omp_get_dynamic () - || kind !=3D 3 || chunk_size !=3D 4 - || omp_get_teams_thread_limit () !=3D 44 - || omp_get_thread_limit () !=3D 45 - || omp_get_max_threads () !=3D 46 - || omp_get_proc_bind () !=3D omp_proc_bind_spread - || omp_get_max_active_levels () !=3D 47) + if ((!getenv ("OMP_NUM_TEAMS") && omp_get_max_teams () !=3D 42) + || (!getenv ("OMP_DYNAMIC") && !omp_get_dynamic ()) + || (!getenv ("OMP_SCHEDULE") && (kind !=3D 3 || chunk_size !=3D 4)) + || (!getenv ("OMP_TEAMS_THREAD_LIMIT") && omp_get_teams_thread_limit= () !=3D 44) + || (!getenv ("OMP_THREAD_LIMIT") && omp_get_thread_limit () !=3D 45) + || (!getenv ("OMP_NUM_THREADS") && omp_get_max_threads () !=3D 46) + || (!getenv ("OMP_PROC_BIND") && omp_get_proc_bind () !=3D omp_proc_bind_spread) + || (!getenv ("OMP_MAX_ACTIVE_LEVELS") && omp_get_max_active_levels (= ) !=3D 47)) abort (); int num_devices =3D omp_get_num_devices () > 3 ? 3 : omp_get_num_devices= (); - for (int i=3D0; i < num_devices; i++) + for (int i =3D 0; i < num_devices; i++) + { + char name[sizeof ("OMP_NUM_TEAMS_DEV_0")]; + strcpy (name, "OMP_NUM_TEAMS_DEV_0"); + name[sizeof ("OMP_NUM_TEAMS_DEV_0") - 2] =3D '0' + i; + if (getenv (name)) + continue; #pragma omp target device (i) if (omp_get_max_teams () !=3D 43) abort (); + } return 0; } or if we say users are on their own if they make check with any OMP_* environment variables, then at least do that for OMP_NUM_THREADS because we set it ourselves.=