public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Thomas Koenig <tkoenig@netcologne.de>
Cc: sgk@troutmask.apl.washington.edu,
	       "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	       gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch, fortran] Remove parallell annotation from DO CONCURRENT
Date: Wed, 11 Apr 2018 18:35:00 -0000	[thread overview]
Message-ID: <20180411154423.GU8577@tucnak> (raw)
In-Reply-To: <3e6497e3-56b8-91ea-5a19-c41e6d28a073@netcologne.de>

On Tue, Apr 10, 2018 at 11:50:44PM +0200, Thomas Koenig wrote:
> 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?

Avoid using that much stack?  ulimit -s is usually around 8MB on Linux, on
other OSes it can be as low as 2MB or even less, so using 160MB edof array
is way too much.  Also, even if you e.g. allocated it from heap rather than
stack (still for some targets it would be too much), isn't that just too
expensive for the testsuite?
Can you reproduce say even with ne = 200000 (with the fix reverted)?

Also, are you going to do the suggested change (because can_be_parallel
is something only autopar cares about, but annot_expr_parallel_kind
sets like annot_expr_ivdep_kind also safelen to INTMAX):
--- gcc/fortran/trans-stmt.c.jj	2018-04-10 08:52:25.467790554 +0200
+++ gcc/fortran/trans-stmt.c	2018-04-11 17:42:40.670493050 +0200
@@ -3643,12 +3643,13 @@ gfc_trans_forall_loop (forall_info *fora
       cond = fold_build2_loc (input_location, LE_EXPR, logical_type_node,
 			      count, build_int_cst (TREE_TYPE (count), 0));
 
-      /* PR 83064 means that we cannot use the annotation if the
-	 autoparallelizer is active.  */
-      if (forall_tmp->do_concurrent && ! flag_tree_parallelize_loops)
+      /* PR 83064 means that we cannot use the annot_expr_parallel_kind
+	 annotation until autopar is tought to handle local variables
+	 in loops annotated that way.  */
+      if (forall_tmp->do_concurrent)
 	cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
 		       build_int_cst (integer_type_node,
-				      annot_expr_parallel_kind),
+				      annot_expr_ivdep_kind),
 		       integer_zero_node);
 
       tmp = build1_v (GOTO_EXPR, exit_label);


> ! { 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

	Jakub

  reply	other threads:[~2018-04-11 18:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09 20:10 Thomas Koenig
2018-04-09 20:28 ` Steve Kargl
2018-04-09 20:58   ` Thomas Koenig
2018-04-09 21:19     ` Steve Kargl
2018-04-10  6:44     ` Richard Biener
2018-04-10 13:36     ` Jakub Jelinek
2018-04-10 21:50       ` Thomas Koenig
2018-04-11 18:35         ` Jakub Jelinek [this message]
2018-04-11 18:18           ` Thomas Koenig
2018-04-11 18:35             ` Jakub Jelinek
2018-04-11 19:47               ` Thomas Koenig
2018-04-12  7:17                 ` Jakub Jelinek
2018-04-12 21:14                   ` Thomas Koenig
2018-04-12 21:35                     ` Jakub Jelinek
2018-04-09 23:35 ` Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180411154423.GU8577@tucnak \
    --to=jakub@redhat.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sgk@troutmask.apl.washington.edu \
    --cc=tkoenig@netcologne.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).