From patchwork Mon Sep 12 08:52:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1159 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp1787247wrt; Mon, 12 Sep 2022 01:53:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR5vrocd2xl8XqJ59WMooHh6hfPpZRCA1+PZoheiMo9v/dk7SGMAbHKiDEoirbrf3gUbwpXm X-Received: by 2002:a05:6402:c8a:b0:44e:81b3:4b7e with SMTP id cm10-20020a0564020c8a00b0044e81b34b7emr21231843edb.181.1662972825239; Mon, 12 Sep 2022 01:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662972825; cv=none; d=google.com; s=arc-20160816; b=sQm2lp4iFgozg86VWaHyznCU6KJTtKDVBpktpDxS2yxV9MJehT9iUIgmR/UfLCMlJI 0b+tYCpMU/q5xdiCoGJQrD7LbqyCM/KcFxeEfC+eG62hq+j7jCBFx0GE2a+VX4W6n5MA uLHldE11V/vHtaHD4v6uXf0R7VSXGHJMMqcP8Idr49h9j5sTzq1/N0Sez8tFJQphYxTm IZVrMuok3SNKdBy3dm+ZsPckjnVhnCi/l9bGR21qomDQVsQwcg5i8h+UO237ICWu1FLJ uWTWxMcNhwxiSpzxKvAQifFBJ4NS+k0U28SfHFiqQTQlOjk8L576XYvpD8KyPh8eoBNZ MJgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=bmp8d8qkNb4D1gU1XRtbisSFfiFiYNgwaX7Iebx1FwY=; b=qc2c/Bmdx1Vrah2z+n41OVXM+Dlgtht4Y5ngm7JJJWMhP5bk3wT0/X/lQfcf1xpaQ1 wJBypcaRft3zP0zY7489fx/0P7M/QjxZqoGyNOLQgr+JjLkR7aPw8uloTIZM/bjcarRg li/XOpirbDKd057t49XUO2RZS9C/Cn56iYKSxF3DtZlXhtcznJ38hOkJZxYnlX5J2l0T TuXtCUd1qwvzCBNNHnj7f3GbxyTk3siq8qj2hrNzBZUka8/y/IkcWbRLJNLJGJcn3Ygz rezD1cQAvcTzAzddF7LRBulsPhxJP6GDuVMItOmv6MUCrthFuxr2yFEwePKoCPpl+IHm +NJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=QEy76j7w; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id 21-20020a170906311500b00730ac298aa9si5728640ejx.783.2022.09.12.01.53.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 01:53:45 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=QEy76j7w; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B4FFB38515F3 for ; Mon, 12 Sep 2022 08:53:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4FFB38515F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662972818; bh=bmp8d8qkNb4D1gU1XRtbisSFfiFiYNgwaX7Iebx1FwY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=QEy76j7w1F3Vx4NhyyG0LFVov9nHzdeJO4Axb0mOMyFZao3bBPi08K39LRANuWyP6 5LT2bchen7Gt2nDTgh3rn3WAAyiGAA9NLh7PajksFWCR6jcH7SE1wZJ3kPg+AUpQ6L jSWqxbry4TEtWLAlO43BbxOdEOqfeS11q1QbGBJU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 53D4B3857004 for ; Mon, 12 Sep 2022 08:52:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 53D4B3857004 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-533-b5wWuzzNOAq3cYwzPJYZ0Q-1; Mon, 12 Sep 2022 04:52:50 -0400 X-MC-Unique: b5wWuzzNOAq3cYwzPJYZ0Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79CD180418F; Mon, 12 Sep 2022 08:52:50 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27EEB17584; Mon, 12 Sep 2022 08:52:50 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 28C8qlMr166933 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 12 Sep 2022 10:52:48 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 28C8qkCK166932; Mon, 12 Sep 2022 10:52:46 +0200 Date: Mon, 12 Sep 2022 10:52:46 +0200 To: gcc-patches@gcc.gnu.org Subject: [committed] libgomp: Fix up icv-6.c [PR106894] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: Marcel Vollweiler , Tobias Burnus Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1743753393265163646?= X-GMAIL-MSGID: =?utf-8?q?1743753393265163646?= Hi! The thing is, make check or make check RUNTESTFLAGS="c.exp='icv-6.c' c++.exp='icv-6.c'" in libgomp obj dir work fine, but make -j32 -k check RUNTESTFLAGS="c.exp='icv-6.c' c++.exp='icv-6.c'" fails. The thing is that the testcase as written relies on OMP_NUM_THREADS not being set in environment (as it takes priority over OMP_NUM_THREADS_ALL for the host). So, if either a user has OMP_NUM_THREADS=42 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=8; export OMP_NUM_THREADS; \ echo @@@ libgomp OMP_NUM_THREADS adjusted to 8 because of parallel make check and too many CPUs; \ fi; \ in libgomp/testsuite/Makefile.am and so the test fails. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2022-09-12 Jakub Jelinek PR libgomp/106894 * testsuite/libgomp.c-c++-common/icv-6.c: Include string.h. (main): Avoid tests for which corresponding non-_ALL suffixed variable is in the environment, or for OMP_NUM_TEAMS on the device OMP_NUM_TEAMS_DEV_?. Jakub --- 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 17:00:36.409255776 +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 () != 42 - || !omp_get_dynamic () - || kind != 3 || chunk_size != 4 - || omp_get_teams_thread_limit () != 44 - || omp_get_thread_limit () != 45 - || omp_get_max_threads () != 46 - || omp_get_proc_bind () != omp_proc_bind_spread - || omp_get_max_active_levels () != 47) + if ((!getenv ("OMP_NUM_TEAMS") && omp_get_max_teams () != 42) + || (!getenv ("OMP_DYNAMIC") && !omp_get_dynamic ()) + || (!getenv ("OMP_SCHEDULE") && (kind != 3 || chunk_size != 4)) + || (!getenv ("OMP_TEAMS_THREAD_LIMIT") && omp_get_teams_thread_limit () != 44) + || (!getenv ("OMP_THREAD_LIMIT") && omp_get_thread_limit () != 45) + || (!getenv ("OMP_NUM_THREADS") && omp_get_max_threads () != 46) + || (!getenv ("OMP_PROC_BIND") && omp_get_proc_bind () != omp_proc_bind_spread) + || (!getenv ("OMP_MAX_ACTIVE_LEVELS") && omp_get_max_active_levels () != 47)) abort (); int num_devices = omp_get_num_devices () > 3 ? 3 : omp_get_num_devices (); - for (int i=0; i < num_devices; i++) + for (int i = 0; i < num_devices; i++) + { + char name[sizeof ("OMP_NUM_TEAMS_DEV_1")]; + strcpy (name, "OMP_NUM_TEAMS_DEV_1"); + name[sizeof ("OMP_NUM_TEAMS_DEV_1") - 2] = '0' + i; + if (getenv (name)) + continue; #pragma omp target device (i) if (omp_get_max_teams () != 43) abort (); + } return 0; }