From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id E21F53858416; Fri, 22 Oct 2021 13:28:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E21F53858416 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: 0WhPIWDMdk0o6Ieyvio7wpjPaolGGx5j2xPLQDpnLNwQYCx5491xK7b1l2lo+v0c47kLc1qo3I nReOSM0c7p0WGyEdIMj3Mrm4l+KlSajYcWTP4mMLNtAXXCHkLOXEWGfHkIx7AQMBtgbJQO3oeJ uhWvPlmEl2vtejFjQqqFNL3GYzCKcY/0/+0fJdVex0vqD64eNX20yHXqkY25JTj+AdSZCJ2n40 PeTE5NKF2ceZwuCCNiVwq6nVqOGTHYRvbzyCykXXaaPtb+on5GRUAJBIvdImKCvosqcQRTEwdK sNuxeQP+yklBgzJqkvGFyRX8 X-IronPort-AV: E=Sophos;i="5.87,172,1631606400"; d="scan'208";a="69983272" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 22 Oct 2021 05:28:56 -0800 IronPort-SDR: ZiQWqpkggUcrLCfANVpsybddLpHZTaaBG82gTtB/LV2desiJvE4DFzhsLVCkcZNtAeCzr/GcPK 9Lm64aeLU3Iwg70naG/wU6Br9QHHVGFyuwTDZuPN83bYnALtX7EL3ojy3AFgDEOeVd070Ezk0n +jVioNnE+9PyqncRnG4uzuEpGcxu+e/61gGaBrIFTK8t9dSiU7tzxxY7RyndeoLs6BE2UGmVnv zCNPztFOKm+Kum7Jo/1q3ODji9cxTN26E+RkdSe+vgoW1LNgZbHiF/U+5cUiXJe1wiwzCM36K/ HJc= Message-ID: Date: Fri, 22 Oct 2021 15:28:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0). Content-Language: en-US To: Hafiz Abid Qadeer , , fortran CC: References: <20211022130502.2211568-1-abidh@codesourcery.com> From: Tobias Burnus In-Reply-To: <20211022130502.2211568-1-abidh@codesourcery.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable 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.5 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 22 Oct 2021 13:29:00 -0000 Hi all, On 22.10.21 15:05, Hafiz Abid Qadeer wrote: > This patch adds support for OpenMP 5.0 allocate clause for fortran. It do= es not > yet support the allocator-modifier as specified in OpenMP 5.1. The alloca= te > clause is already supported in C/C++. I think the following shouldn't block the acceptance of the patch, but I think we eventually need to handle the following as well: type t integer, allocatable :: xx(:) end type type(t) :: tt class(t), allocatable :: cc allocate(t :: cc) tt%xx =3D [1,2,3,4,5,6] cc%xx =3D [1,2,3,4,5,6] ! ... !$omp task firstprivate(tt, cc) allocate(h) ... In my spec reading, both tt/cc itself and tt%ii and cc%ii should use the specified allocator. And unless I missed something (I only glanced at the patch so far), it is not handled. But for derived types (except for recursive allocatables, valid since 5.1), I think it can be handled in gfc_omp_clause_copy_ctor / gfc_omp_clause_dtor= , but I have not checked whether those support it properly. For CLASS + recursive allocatables, it requires some more changes (which might be provided by my derived-type deep copy patch, of which only 1/3 has been written). Tobias PS: Just a side note, OpenMP has the following for Fortran: "If any operation of the base language causes a reallocation of a variable that is allocated with a memory allocator then that memory allocator will be used to deallocate the current memory and to allocate the new memory. For allocated allocatable components of such variables, the allocator that will be used for the deallocation and allocation is unspecified." ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955