From patchwork Thu Dec 1 09:55:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andre Vehreschild X-Patchwork-Id: 85995 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp612665qgi; Thu, 1 Dec 2016 01:56:17 -0800 (PST) X-Received: by 10.99.122.92 with SMTP id j28mr67201140pgn.64.1480586177108; Thu, 01 Dec 2016 01:56:17 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 3si40089606plx.202.2016.12.01.01.56.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 01:56:17 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-443166-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-443166-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-443166-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=sGCWADjdweCWc5lk 6ityxg209nYM81qYTt75DCOsHU6CmfuQKWxR9p818ACnFfRrFVFzVVPmIpuLM81+ gVOhZZvNvST3x1EfBM3Cgmgom/Q2N7iKMblCRs/6nJW36dt8yas7kAcqFaWsx2uw 0saFrnmG8WYm9KOuXRxKtte2TD4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=+oZwwsz9zD+fsbF2KFoe2P blPJI=; b=JNz+OfVu9yJ8TkkME4c7y5+SuSpbmP2TkjNp+jCZ6vCriDjMgQ0zb7 vMMfJftsXNjqoeSNobxWiLktU8zxrONjjNU5nFVbZPrTY7igxn8/6RY1z20E2krp CqoUuAEO4DQC/YugPYRklB1SP+qYku5SAAlttC9NGNRvwGLSzJBzw= Received: (qmail 107359 invoked by alias); 1 Dec 2016 09:55:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 107337 invoked by uid 89); 1 Dec 2016 09:55:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=paul.richard.thomas@gmail.com, paulrichardthomasgmailcom, dim, r243034 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mout.gmx.net Received: from Unknown (HELO mout.gmx.net) (212.227.15.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Dec 2016 09:55:47 +0000 Received: from vepi2 ([92.76.205.227]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LaooK-1caQFL3uWW-00kNzL; Thu, 01 Dec 2016 10:55:36 +0100 Date: Thu, 1 Dec 2016 10:55:35 +0100 From: Andre Vehreschild To: Dominique Dhumieres , GCC-Patches-ML , GCC-Fortran-ML Cc: Paul Richard Thomas Subject: Re: PING! [PATCH, Fortran, accaf, v1] Add caf-API-calls to asynchronously handle allocatable components in derived type coarrays. Message-ID: <20161201105535.23358a5a@vepi2> In-Reply-To: <20161130165939.4bc669fc@vepi2> References: <20161122204650.03893214@vepi2> <20161128193330.55c0802a@vepi2> <20161130143007.235e8c73@vepi2> <20161130152246.03eec0fd@vepi2> <20161130153529.54bb0740@vepi2> <20161130165939.4bc669fc@vepi2> MIME-Version: 1.0 X-UI-Out-Filterresults: notjunk:1; V01:K0:2kySGRVAT2A=:///1osGts4X4vNlAOQishV 0uoaFeCEQSUqUFa4aP+J721TvwKDdn9gLFOvFTnXb7Ucv3R4GPZ9NfcXoTyXvnnBMpbMuOZ8T +5JlLm8eco0Vf5BfsZLfDJqC8jSsusA/owaGhJBfXIp7+JcV+Y8D8dQvGI6KVH5mzVvfvj8LO efwtzjOd7rrNezc+MO9rggFZ5QIWwWiml3hupiMDm8cUcTXExjuqQiJ2L9ts6+DROQDlh9qxq Ih5H2qCLjKpgeGDmC5k7LCr8CNugS3m6E/YjhNj418ujE2JJ7NbsHlKDDQfvO6gr5/FGPAXno GHbCKCyycVI+v8a1T2dNgDKM2j1Ry7EFoCXu9cJHHgaH7NNYwWxKorzlHr+P6hQt4A5UfBmsW e0MNy3tvwKvcgbkFaUd2dSW+ZLm7UiyoCm94Xs84oUbt6bkXt+HrpP/3Cb3AGCCbw0nZZHSqW r5hA4NGMINT8FuJzG0GXCSsq/UYfJDSh6ucYkvDUCtZ1N+7x9fYYYDjoHYLJ6E1uHibDAFoiK 9+a8Wahf2/E6mUnVbDrlNfTysaF/yPukzJ2q4XBdctFkcgFiq5o+snwd4VZ8SzoVl36MOuFuQ ZDJoT+t1Te7t453YDBqjOM2UYJZFNCjQxqrFgJvla2tkzUJ7VJo6CrogGul1i6zy6VeUbOPFx +jHnN2Gb5WbqPlHTGfMywEO4uJ+9FzTdHcHjhaabToXEf/GE5iGZbtrRV0Qxvi4WOab5m1z3G y7FOnNgF0M0MyuWgLWPSR90bPa3cepOmSouuG4v06a7knCR2cZORmGiemy0= Hi all, and another aftermatch reported by Dominique. Fixing testcase coarray_lib_alloc_4.f90 for 32-bit. Committed as obvious as r243101. Thanks for reporting Dominique. - Andre On Wed, 30 Nov 2016 16:59:39 +0100 Andre Vehreschild wrote: > Fixed -> r243034. > > - Andre > > On Wed, 30 Nov 2016 15:53:39 +0100 > Janus Weil wrote: > > > Hi, > > > > > on IRC: > > > 15:28:22 dominiq: vehre: add /* FALLTHROUGH */ > > > > > > Done and committed as obvious as r243023. > > > > thanks. However, I still see these two: > > > > > > >> > /home/jweil/gcc/gcc7/trunk/libgfortran/caf/single.c: In function > > >> > ‘_gfortran_caf_get_by_ref’: > > >> > /home/jweil/gcc/gcc7/trunk/libgfortran/caf/single.c:1863:29: warning: > > >> > ‘src_size’ may be used uninitialized in this function > > >> > [-Wmaybe-uninitialized] > > >> > if (size == 0 || src_size == 0) > > >> > ~~~~~~~~~^~~~ > > >> > /home/jweil/gcc/gcc7/trunk/libgfortran/caf/single.c: In function > > >> > ‘_gfortran_caf_send_by_ref’: > > >> > /home/jweil/gcc/gcc7/trunk/libgfortran/caf/single.c:2649:29: warning: > > >> > ‘src_size’ may be used uninitialized in this function > > >> > [-Wmaybe-uninitialized] > > >> > if (size == 0 || src_size == 0) > > >> > ~~~~~~~~~^~~~ > > > > Can you please fix them as well? > > > > Thanks, > > Janus > > > > > > > > > > >> > 2016-11-30 14:30 GMT+01:00 Andre Vehreschild : > > >> > > Hi Paul, > > >> > > > > >> > > thanks for the review. Committed with the changes requested and the > > >> > > one reported by Dominique on IRC for coarray_lib_alloc_4 when > > >> > > compiled with -m32 as r243021. > > >> > > > > >> > > Thanks for the review and tests. > > >> > > > > >> > > Regards, > > >> > > Andre > > >> > > > > >> > > On Wed, 30 Nov 2016 07:49:13 +0100 > > >> > > Paul Richard Thomas wrote: > > >> > > > > >> > >> Dear Andre, > > >> > >> > > >> > >> This all looks OK to me. The only comment that I have that you might > > >> > >> deal with before committing is that some of the Boolean expressions, > > >> > >> eg: > > >> > >> + int caf_dereg_mode > > >> > >> + = ((caf_mode & GFC_STRUCTURE_CAF_MODE_IN_COARRAY) != 0 > > >> > >> + || c->attr.codimension) > > >> > >> + ? ((caf_mode & GFC_STRUCTURE_CAF_MODE_DEALLOC_ONLY) != 0 > > >> > >> + ? GFC_CAF_COARRAY_DEALLOCATE_ONLY > > >> > >> + : GFC_CAF_COARRAY_DEREGISTER) > > >> > >> + : GFC_CAF_COARRAY_NOCOARRAY; > > >> > >> > > >> > >> are getting be sufficiently convoluted that a small, appropriately > > >> > >> named, helper function might be clearer. Of course, this is true of > > >> > >> many parts of gfortran but it is not too late to start making the > > >> > >> code a bit clearer. > > >> > >> > > >> > >> You can commit to the present trunk as far as I am concerned. I know > > >> > >> that the caf enthusiasts will test it to bits before release! > > >> > >> > > >> > >> Regards > > >> > >> > > >> > >> Paul > > >> > >> > > >> > >> > > >> > >> On 28 November 2016 at 19:33, Andre Vehreschild > > >> > >> wrote: > > >> > >> > PING! > > >> > >> > > > >> > >> > I know it's a lengthy patch, but comments would be nice anyway. > > >> > >> > > > >> > >> > - Andre > > >> > >> > > > >> > >> > On Tue, 22 Nov 2016 20:46:50 +0100 > > >> > >> > Andre Vehreschild wrote: > > >> > >> > > > >> > >> >> Hi all, > > >> > >> >> > > >> > >> >> attached patch addresses the need of extending the API of the > > >> > >> >> caf-libs to enable allocatable components asynchronous > > >> > >> >> allocation. Allocatable components in derived type coarrays are > > >> > >> >> different from regular coarrays or coarrayed components. The > > >> > >> >> latter have to be allocated on all images or on none. > > >> > >> >> Furthermore is the allocation a point of synchronisation. > > >> > >> >> > > >> > >> >> For allocatable components the F2008 allows to have some > > >> > >> >> allocated on some images and on others not. Furthermore is the > > >> > >> >> registration with the caf-lib, that an allocatable component is > > >> > >> >> present in a derived type coarray no longer a synchronisation > > >> > >> >> point. To implement these features two new types of coarray > > >> > >> >> registration have been introduced. The first one just > > >> > >> >> registering the component with the caf-lib and the latter doing > > >> > >> >> the allocate. Furthermore has the caf-API been extended to > > >> > >> >> provide a query function to learn about the allocation status of > > >> > >> >> a component on a remote image. > > >> > >> >> > > >> > >> >> Sorry, that the patch is rather lengthy. Most of this is due to > > >> > >> >> the structure_alloc_comps' signature change. The routine and its > > >> > >> >> wrappers are used rather often which needed the appropriate > > >> > >> >> changes. > > >> > >> >> > > >> > >> >> I know I left two or three TODOs in the patch to remind me of > > >> > >> >> things I have to investigate further. For the current state these > > >> > >> >> TODOs are no reason to hold back the patch. The third party > > >> > >> >> library opencoarrays implements the mpi-part of the caf-model and > > >> > >> >> will change in sync. It would of course be advantageous to just > > >> > >> >> have to say: With gcc-7 gfortran implements allocatable > > >> > >> >> components in derived coarrays nearly completely. > > >> > >> >> > > >> > >> >> I know we are in stage 3. But the patch bootstraps and regtests > > >> > >> >> ok on x86_64-linux/F23. So, is it ok for trunk or shall it go to > > >> > >> >> 7.2? > > >> > >> >> > > >> > >> >> Regards, > > >> > >> >> Andre > > >> > >> > > > >> > >> > > > >> > >> > -- > > >> > >> > Andre Vehreschild * Email: vehre ad gmx dot de > > >> > >> > > >> > >> > > >> > >> > > >> > > > > >> > > > > >> > > -- > > >> > > Andre Vehreschild * Email: vehre ad gmx dot de > > >> > > >> > > > > > > > > > -- > > > Andre Vehreschild * Email: vehre ad gmx dot de > > -- Andre Vehreschild * Email: vehre ad gmx dot de Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (Revision 243100) +++ gcc/testsuite/ChangeLog (Arbeitskopie) @@ -1,3 +1,7 @@ +2016-12-01 Andre Vehreschild + + * gfortran.dg/coarray_lib_alloc_4.f90: Fix for 32-bits. + 2016-12-01 Jakub Jelinek PR debug/78587 Index: gcc/testsuite/gfortran.dg/coarray_lib_alloc_4.f90 =================================================================== --- gcc/testsuite/gfortran.dg/coarray_lib_alloc_4.f90 (Revision 243100) +++ gcc/testsuite/gfortran.dg/coarray_lib_alloc_4.f90 (Arbeitskopie) @@ -38,7 +38,7 @@ end ! { dg-final { scan-tree-dump-times "_gfortran_caf_is_present \\(xx\\.token, 2 - \\(integer\\(kind=4\\)\\) xx\\.dim\\\[0\\\]\\.lbound, &caf_ref\\.\[0-9\]+\\)|_gfortran_caf_is_present \\(xx\\.token, 2 - xx\\.dim\\\[0\\\]\\.lbound, &caf_ref\\.\[0-9\]+\\)" 10 "original" } } -! { dg-final { scan-tree-dump-times "_gfortran_caf_register \\(72, 1, &xx\\.token, \\(void \\*\\) &xx, 0B, 0B, 0\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "_gfortran_caf_register \\(\[0-9\]+, 1, &xx\\.token, \\(void \\*\\) &xx, 0B, 0B, 0\\)" 1 "original" } } ! { dg-final { scan-tree-dump-times "_gfortran_caf_register \\(\[0-9\]+, 7" 2 "original" } } ! { dg-final { scan-tree-dump-times "_gfortran_caf_register \\(\[0-9\]+, 8" 2 "original" } } ! { dg-final { scan-tree-dump-times "_gfortran_caf_deregister \\(&xx\\.token, 0, 0B, 0B, 0\\)" 1 "original" } }