From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 2F389385AC37 for ; Wed, 30 Jun 2021 10:40:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F389385AC37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: mzUCmWxi4JrA1yT+FXnvpN79uLVOWkW83xJ66u4Xs73lYtjZm9rsqYlqQYyOnx4OabS9wyUV3b D71EgNnsCCtYzpnXisMNZnjxUAEEnYcaP99ERJxHGL7CqknUge7XCDAHY8yMFSZk4EoxZqPS28 /hlhRmlC80Il/V65wZExw1ySbO4ZAc4nRfUV5gvsqomnqdNj41P0n6auP1rKHpjfsppRRhN1eX C1y/9i5u5J5t+JRloTq3PNr2EuD+iQZu7PRUgbICLboiM5xvhVs1p+uOX/pwLzVJ3zKArDEdHf siM= X-IronPort-AV: E=Sophos;i="5.83,311,1616486400"; d="scan'208";a="63002518" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 30 Jun 2021 02:40:40 -0800 IronPort-SDR: 9Q5dd1bAGmzd/MkOKGtR6yAAks8E1LznJhf+5Icp4903RR1G+AtRLED58/XPak6cEaxFb9qhwH gVQpVHKqV/UhjUFaW6HHIBkeO3oD7c1IIJTBZmTWxHzBTgI1l1ZmARc2E7z7j8oVU3Jl5vPieU Da/i9L6qoiQY4eePqkFx4RjFHHtZoBhu6IdTO4GzspOYmKwC4ucmlUdJtCHDh6NYuG6sp00+2+ zjlwX3KgpSXjg1p6j+CBdLBO8/W92J4neqbLIraKvyK/ItuimfrfVdDa7QtF7ECPVzDURZUmAu LOE= Date: Wed, 30 Jun 2021 11:40:33 +0100 From: Julian Brown To: Thomas Schwinge CC: , Jakub Jelinek , "Chung-Lin Tang" Subject: Re: [PATCH 0/4] openacc: Async fixes Message-ID: <20210630114033.4e85103f@squid.athome> In-Reply-To: <87pmw3ycxb.fsf@euler.schwinge.homeip.net> References: <87pmw3ycxb.fsf@euler.schwinge.homeip.net> Organization: Mentor Graphics X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-05.mgc.mentorg.com (139.181.222.5) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 30 Jun 2021 10:40:42 -0000 On Wed, 30 Jun 2021 10:28:00 +0200 Thomas Schwinge wrote: > > - The OpenACC profiling-interface implementation did not measure > > asynchronous operations properly. > > We'll need to be careful: (possibly, an older version of) that one we > internally had identified to be causing some issues; see the > "acc_prof-parallel-1.c intermittent failure on og10 branch" emails, > 2020-07. Hmm, I'll check those. > > - Several test cases misuse OpenACC asynchronous support (more race > > conditions). > > Mostly ACK, but some more changes may be necessary; please see > > (you were CCed). Thanks -- these test changes have been floating around uncommitted for too long already, I guess... > > .../libgomp.oacc-c-c++-common/deep-copy-10.c | 14 +- > > Please provide some detail about that one ("Fix async behaviour"). > It's not obvious to me what's wrong with the current version (but I > haven't really spent time on that yet). Aha, well I didn't see what was wrong with it either when I wrote the test! The problem is that we have copyin/modify-on-target/copyout operations that process the *same data* from different async streams on successive loop iterations. Those async streams are independent from one another, so depending on how they are scheduled, we can be copying-in on one async stream whilst simultaneously copying-out on another async stream -- so of course, the data gets corrupted. So the fix makes sure that each async stream only operates on "its own" data. The increase in number of loop iterations was specifically to tickle the flaw in the workaround used for GCN wrt. the ephemeral copies -- i.e. snapshotting all host data immediately. HTH, Julian