From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107671 invoked by alias); 10 Apr 2018 21:50:59 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 107653 invoked by uid 89); 10 Apr 2018 21:50:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=sum X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout2.netcologne.de Received: from cc-smtpout2.netcologne.de (HELO cc-smtpout2.netcologne.de) (89.1.8.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Apr 2018 21:50:56 +0000 Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout2.netcologne.de (Postfix) with ESMTP id 7BD1B128B5; Tue, 10 Apr 2018 23:50:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id 6F65911DBD; Tue, 10 Apr 2018 23:50:54 +0200 (CEST) Received: from [78.35.153.70] (helo=cc-smtpin1.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 5acd31be-029d-7f0000012729-7f000001a91e-1 for ; Tue, 10 Apr 2018 23:50:54 +0200 Received: from [192.168.178.68] (xdsl-78-35-153-70.netcologne.de [78.35.153.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA; Tue, 10 Apr 2018 23:50:48 +0200 (CEST) Subject: Re: [patch, fortran] Remove parallell annotation from DO CONCURRENT To: Jakub Jelinek Cc: sgk@troutmask.apl.washington.edu, "fortran@gcc.gnu.org" , gcc-patches References: <20180409202803.GB51810@troutmask.apl.washington.edu> <20180410133602.GF8577@tucnak> From: Thomas Koenig Message-ID: <3e6497e3-56b8-91ea-5a19-c41e6d28a073@netcologne.de> Date: Tue, 10 Apr 2018 21:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180410133602.GF8577@tucnak> Content-Type: multipart/mixed; boundary="------------0463069C77B79A7F383C10AA" X-SW-Source: 2018-04/txt/msg00050.txt.bz2 This is a multi-part message in MIME format. --------------0463069C77B79A7F383C10AA Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 387 Hi Jakub, > The new test FAILs everywhere, gfortran.dg doesn't have infrastructure to > run -fopenmp, -fopenacc nor -ftree-parallelize-loops= tests. > You need to put such tests into libgomp/testsuite/libgomp.fortran/ I put the test case in the attached form into the libgomp.fortran directory, but it failed execution, without error message. Anything I could have done differently? --------------0463069C77B79A7F383C10AA Content-Type: text/x-fortran; name="do_concurrent_5.f90" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="do_concurrent_5.f90" Content-length: 2105 ! { dg-do run } ! PR 83064 - this used to give wrong results. ! { dg-additional-options "-O3 -ftree-parallelize-loops=2" } ! Original test case by Christian Felter program main use, intrinsic :: iso_fortran_env implicit none integer, parameter :: nsplit = 4 integer(int64), parameter :: ne = 20000000 integer(int64) :: stride, low(nsplit), high(nsplit), edof(ne), i real(real64), dimension(nsplit) :: pi edof(1::4) = 1 edof(2::4) = 2 edof(3::4) = 3 edof(4::4) = 4 stride = ceiling(real(ne)/nsplit) do i = 1, nsplit high(i) = stride*i end do do i = 2, nsplit low(i) = high(i-1) + 1 end do low(1) = 1 high(nsplit) = ne pi = 0 do concurrent (i = 1:nsplit) pi(i) = sum(compute( low(i), high(i) )) end do if (abs (sum(pi) - atan(1.0d0)) > 1e-5) STOP 1 contains pure function compute( low, high ) result( ttt ) integer(int64), intent(in) :: low, high real(real64), dimension(nsplit) :: ttt integer(int64) :: j, k ttt = 0 ! Unrolled loop ! do j = low, high, 4 ! k = 1 ! ttt(k) = ttt(k) + (-1)**(j+1) / real( 2*j-1 ) ! k = 2 ! ttt(k) = ttt(k) + (-1)**(j+2) / real( 2*j+1 ) ! k = 3 ! ttt(k) = ttt(k) + (-1)**(j+3) / real( 2*j+3 ) ! k = 4 ! ttt(k) = ttt(k) + (-1)**(j+4) / real( 2*j+5 ) ! end do ! Loop with modulo operation ! do j = low, high ! k = mod( j, nsplit ) + 1 ! ttt(k) = ttt(k) + (-1)**(j+1) / real( 2*j-1 ) ! end do ! Loop with subscripting via host association do j = low, high k = edof(j) ttt(k) = ttt(k) + (-1.0_real64)**(j+1) / real( 2*j-1 ) end do end function end program main --------------0463069C77B79A7F383C10AA--