public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hafiz Abid Qadeer <abid_qadeer@mentor.com>
To: Thomas Schwinge <thomas@codesourcery.com>,
	Tobias Burnus <tobias@codesourcery.com>,
	Jakub Jelinek <jakub@redhat.com>
Cc: <gcc-patches@gcc.gnu.org>, <fortran@gcc.gnu.org>
Subject: Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0).
Date: Sat, 5 Feb 2022 19:09:35 +0000	[thread overview]
Message-ID: <1fff44cf-e1c4-110b-80a6-78ca00b9ce4a@mentor.com> (raw)
In-Reply-To: <e2093e0c-d46c-7c61-c444-3e48a897aefc@mentor.com>

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

On 04/02/2022 11:25, Hafiz Abid Qadeer wrote:
> On 04/02/2022 09:46, Thomas Schwinge wrote:
> 
>>
>> Abid, are you going to address these?  I think it does make sense if the
>> C/C++ and Fortran test cases match as much as feasible.
>>
> Sure. I will do that.

The attached patch address those issues apart from removing pool_size trait.

Thanks
-- 
Hafiz Abid Qadeer

[-- Attachment #2: 0001-libgomp-Fix-multiple-issue-in-the-testcase-allocate-.patch --]
[-- Type: text/x-patch, Size: 3027 bytes --]

From 7b4dbd5b7c853f0165436ef58339663edce802d5 Mon Sep 17 00:00:00 2001
From: Hafiz Abid Qadeer <abidh@codesourcery.com>
Date: Mon, 31 Jan 2022 19:02:14 +0000
Subject: [PATCH] [libgomp] Fix multiple issue in the testcase allocate-1.f90.

1. Thomas reported in
https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589039.html
that this testcase is randomly failing. The problem was fixed pool
size which was exhausted when there were a lot of threads. Fixed it
by removing pool_size trait which causes default pool size to be used
which should be big enough.

2. Array indices have been changed to check the last element in the
array.

3. Remove a redundant assignment and move some code to better match
C testcase.

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/allocate-1.f90: Remove pool_size
	trait.  Test last index in w and v array.  Remove redundant
	assignment to V(1).  Move alignment checks at the end of
	parallel region.
---
 .../testsuite/libgomp.fortran/allocate-1.f90  | 26 +++++++++----------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/libgomp/testsuite/libgomp.fortran/allocate-1.f90 b/libgomp/testsuite/libgomp.fortran/allocate-1.f90
index 0a31d35d5ac..1547d2baeef 100644
--- a/libgomp/testsuite/libgomp.fortran/allocate-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/allocate-1.f90
@@ -74,31 +74,30 @@ subroutine foo (x, p, q, h, fl)
   if (x /= 42) then
     stop 1
   end if
-  v(1) = 7
-  if ( (and(fl, 2) /= 0) .and.          &
-       ((is_64bit_aligned(x) == 0) .or. &
-        (is_64bit_aligned(y) == 0) .or. &
-        (is_64bit_aligned(v(1)) == 0))) then
-      stop 2
-  end if
 
   !$omp barrier
   y = 1;
   x = x + 1
   v(1) = 7
-  v(41) = 8
+  v(42) = 8
   !$omp barrier
   if (x /= 43 .or. y /= 1) then
     stop 3
   end if
-  if (v(1) /= 7 .or. v(41) /= 8) then
+  if (v(1) /= 7 .or. v(42) /= 8) then
     stop 4
   end if
+  if ( (and(fl, 2) /= 0) .and.        &
+     ((is_64bit_aligned(x) == 0) .or. &
+      (is_64bit_aligned(y) == 0) .or. &
+      (is_64bit_aligned(v(1)) == 0))) then
+    stop 2
+  end if
   !$omp end parallel
   !$omp teams
   !$omp parallel private (y) firstprivate (x, w) allocate (h: x, y, w)
 
-  if (x /= 42 .or. w(17) /= 17 .or. w(41) /= 41) then
+  if (x /= 42 .or. w(17) /= 17 .or. w(42) /= 42) then
     stop 5
   end if
   !$omp barrier
@@ -314,13 +313,12 @@ program main
   integer, dimension(4) :: p
   integer, dimension(4) :: q
 
-  type (omp_alloctrait) :: traits(3)
+  type (omp_alloctrait) :: traits(2)
   integer (omp_allocator_handle_kind) :: a
 
   traits = [omp_alloctrait (omp_atk_alignment, 64), &
-            omp_alloctrait (omp_atk_fallback, omp_atv_null_fb), &
-            omp_alloctrait (omp_atk_pool_size, 8192)]
-  a = omp_init_allocator (omp_default_mem_space, 3, traits)
+            omp_alloctrait (omp_atk_fallback, omp_atv_null_fb)]
+  a = omp_init_allocator (omp_default_mem_space, 2, traits)
   if (a == omp_null_allocator) stop 1
 
   call omp_set_default_allocator (omp_default_mem_alloc);
-- 
2.25.1


  reply	other threads:[~2022-02-05 19:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211022130502.2211568-1-abidh@codesourcery.com>
2021-10-22 13:28 ` Tobias Burnus
     [not found] ` <20211102162714.GF304296@tucnak>
     [not found]   ` <e3c9083c-0906-699a-b437-84a49ece33b8@mentor.com>
     [not found]     ` <20211220200650.GN2646553@tucnak>
     [not found]       ` <fddcdfcf-3fab-1674-722e-2756a1d6aef8@mentor.com>
2022-01-14  9:10         ` Thomas Schwinge
2022-01-14 11:45           ` Tobias Burnus
2022-01-14 11:55             ` Jakub Jelinek
2022-01-14 12:20               ` Tobias Burnus
2022-01-17 14:01                 ` Hafiz Abid Qadeer
2022-01-21 17:15         ` Thomas Schwinge
2022-01-21 17:43           ` Tobias Burnus
2022-01-24  8:45             ` Tobias Burnus
2022-01-24 12:54               ` Hafiz Abid Qadeer
2022-01-25  9:19                 ` Thomas Schwinge
2022-01-25 10:32                   ` Tobias Burnus
2022-01-31 19:13                     ` Hafiz Abid Qadeer
2022-02-04  9:46                       ` Thomas Schwinge
2022-02-04 11:25                         ` Hafiz Abid Qadeer
2022-02-05 19:09                           ` Hafiz Abid Qadeer [this message]
2022-02-16 10:29                             ` Hafiz Abid Qadeer
2022-02-04  9:37               ` Thomas Schwinge
2022-02-04 13:57                 ` [committed] libgomp.fortran/allocate-1.f90: Minor cleanup (was: Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0).) Tobias Burnus
2022-02-04 15:33                   ` Thomas Schwinge
2022-02-04 16:34                     ` Tobias Burnus

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=1fff44cf-e1c4-110b-80a6-78ca00b9ce4a@mentor.com \
    --to=abid_qadeer@mentor.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=thomas@codesourcery.com \
    --cc=tobias@codesourcery.com \
    /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).