From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 0050A387090B; Tue, 9 Feb 2021 12:45:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0050A387090B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Tobias_Burnus@mentor.com IronPort-SDR: 6zVURTSm5ActRGnxViiZaXjCcqX0FKhyJHx1KiWqOTRQ6cL5HqAoBHKt8+TFxAeDEPn/bjV4DN S3fwEd10k/0tQShYpcgx8i01bU4Ed7ypwhVxpswQX3Hz3rWoZr77kSp+CJ602VripPvt83oNuk lXtxBmgnTOwtN1a0MDEL3YpDzxqwtGLF+3lLLtcgOtN3nqFDO5ja/KtRPCkAIwRU3MmvbMnvgZ wJH0pmsEpEeiA/aZx82sFPg5bsQHCGcI6xh+8182NH+fi+AdItKGpjbuMKeKR4iDmFOIboU2NO x0Y= X-IronPort-AV: E=Sophos;i="5.81,164,1610438400"; d="scan'208";a="58058711" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 09 Feb 2021 04:45:42 -0800 IronPort-SDR: XOnlfTBlKpFuCPZqtgUKocgbGQHclTL9thbdqbwJWDbsl8fsktYNFJOLTD2lJilsAiJwBkNZtw 7VfQgnKBcPxkwIfCeUko8ePpVl9pGAmvhN94bzQ8Sq8iOyB7gCIGUNcjpB4+pja05oewHIbU/z ueW1knw14DN2FWYpvDbmwTnRr1OUJzyUk08HveXnGsInHPHNWNuA+EfAJ2SfJ/oRoWy2TGAXms 0TM2k40c+WIJj8sljSVpnBhwx4S5gIUWZVqTQOqvgmCsuwvTjZwscO17FtY8E7EC6E1c0NhVyT G1s= Subject: Re: [Patch] Fortran: %re/%im fixes for OpenMP/OpenACC + gfc_is_simplify_contiguous To: Thomas Schwinge , Julian Brown , Jakub Jelinek , , References: <87wnvhfuci.fsf@euler.schwinge.homeip.net> <87zh0dv4e4.fsf@dem-tschwing-1.ger.mentorg.com> From: Tobias Burnus Message-ID: <82276ca1-9b8c-61cf-9613-18636ce7fbe7@codesourcery.com> Date: Tue, 9 Feb 2021 13:45:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <87zh0dv4e4.fsf@dem-tschwing-1.ger.mentorg.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 12:45:46 -0000 On 09.02.21 12:58, Thomas Schwinge wrote: >> Granted. The array(:)%re access might update too much, but that's not >> different to array with strides or with contiguous arrays sections >> which contain component reference (and more than one component). > (Is that indeed allowed to "update too much"?) Yes - that's the general problem with strides or bit sets; copying only a subset =E2=80=93 and doing so atomically =E2=80=93 is not always possible or feasible. *OpenACC* 3.1 has for "2.14.4 Update Directive" the restriction: "Noncontiguous subarrays may appear. It is implementation-specific whether noncontiguous regions are updated by using one transfer for each contiguous subregion, or whether the noncontiguous data is packed, transferred once, and unpacked, or whether one or more larger subarrays (no larger than the smallest contiguous region that contains the specified subarray) are updated." For map, I saw that that's the case =E2=80=93 but I think Julian's patch does not handle this correctly for: type t integer :: i, j, k end type t type(t) :: A(100) ... host(A(:)%j) I think instead of transferring A(1)%j to A(100)%j, it transfers all of A(:), i.e. also A(1)%i and A(100)%k :-( ^=E2=80=93 Julian? For OpenMP and map, I recall encountering a code which did do this for OpenMP (i.e. contiguous subsection). I think it was related to derived-type 'map', but I do not recall anymore. Looking at the *OpenMP* 5.1 spec, I see that 'target update' also allows: "The list items that appear in the to or from clauses may include array sections with stride expressions." While for the map clause, there is: 'If a list item is an array section, it must specify contiguous storage.' But I did not see a more explicit description how that should be handled, contrary to the rather explicit description for OpenACC. Tobias ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 M=C3=BCnchen R= egistergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas H= eurung, Frank Th=C3=BCrauf